å¾ã§æ¨æ²ããç¨memoï¼ç·¨é -> 確èª( -> å®äº)
edit
//å¦ç public function execute_auth() { // ãããconfããæ¥ãããã§ã¯ãªããå ´åãDBããã®æ å ±ãè¨å®ãã if (false === $this->is_bag('edit_from_cgi')) { $cobj = new hogehoge_clump(); $cobj->set_db($this->get_db()); $cobj->set_value('pk', $this->get_cgi_request()->find('pk')); if (true === $cobj->get()) { // ãã¼ã¿ä¸å¼ã¶ã¡è¾¼ã $cobj->set_all_to_conv($this->get_conv()); } else { // XXX ã©ãã«ã¨ã©ã¼ãã£é£ã°ãã¦ããããããï¼ $this->recursive_on(); $this->set_recursive_command('purgatorium'); return ; } } // return ; }
conf
//å¦ç public function execute_auth() { // cgiãªã¯ã¨ã¹ããè©°ã¾ã£ããªãã¸ã§ã¯ãåã£ã¦ãã $req = $this->get_cgi_request(); // convã¤ã³ã¹ã¿ã³ã¹åã£ã¦ãã $conv = $this->get_conv(); // DBã¤ã³ã¹ã¿ã³ã¹åã£ã¦ãã $dbh = $this->get_db(); // clumpä½ã $cobj = new hogehoge_clump(); // ã¾ãã¯DBããæ å ±ã $cobj->set_db($this->get_db()); $cobj->set_value('pk', $this->get_cgi_request()->find('pk')); if (false === $cobj->get()) { // XXX ã©ãã«ã¨ã©ã¼ãã£é£ã°ãã¦ããããããï¼ $this->recursive_on(); $this->set_recursive_command('purgatorium'); return ; } // æ å ±ãä¸æ¸ãããã«åå¾ $cobj->set_from_cgi($req); // ãã®ä¸è¡ã§formã®æå®ã®ãã¼ã¿ãä¸å¼ã²ãã // vlidate if (false === $cobj->is_valid($conv)) { // validate & ã¨ã©ã¼ãªãã¨ã©ã¼åºåç¨ã®è¨å®ãä¸å¼ // editã³ãã³ãã«æµã $this->set_bag('edit_from_cgi', true); // YYY $this->recursive_on(); $this->set_recursive_command('edit'); // YYY // return; } // ãã¾ããã£ãã£ã½ãªã®ã§â¦ // ãä»ã®æ¥ä»ããå ¥ãã¦ã¿ã $cobj->set_value_nowdate('update_date', false); // ã»ãã·ã§ã³ã«ãã¼ã¿ããã£ããã¶ã¡è¾¼ã $cobj->set_db($dbh); $cobj->set_to_tmp($this->get_session_obj()); // 確èªç»é¢ç¨ã®è¡¨ç¤ºãè¨å®ãã $cobj->set_all_to_conv($conv); // return ; }