id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,modified_flg 909,モデルクラス,ghana,somebody,"[comu-ml:156] EC-CUBE 2.5 dev オブジェクトとモデルとDBの関係について に関連してモデルクラスを作成してみたました。(添付) {{{ class SC_Customer extends SC_Model var $select_key = 'customer_id'; var $select_table = 'dtb_customer'; var $arrRegistColumn = array( array(""name"" => ""ログインID"", ""column"" => ""login_id"", ""convert"" => ""n"", ""db"" => ""dtb_customer"", ""length"" => null, ""check"" => array(""EXIST_CHECK"", ""GRAPH_CHECK"")), array(""name"" => ""パスワード"", ""column"" => ""password"", ""convert"" => ""a"", ""db"" => ""dtb_customer"", ""length"" => null, ""check"" => array()) array(""name"" => ""名(姓)"", ""column"" => ""name01"", ""convert"" => ""aKV"", ""db"" => ""dtb_customer"", ""length"" => STEXT_LEN, ""check"" => array(""EXIST_CHECK"", ""MAX_LENGTH_CHECK"")), ); } $this->objCustomer = new SC_Customer(); }}} とすれば CRUD や {{{ $this->objCustomer >regist($this->arrForm); $this->objCustomer >update($this->arrForm); $this->objCustomer >delete($this->arrForm); (del_flg 方式) $this->objCustomer >getData($this->arrForm[customer_'id']); $this->objCustomer >getList($search_condition, $page_max, $offset); ($search_condition の実装は SC_Customer 内の setWhere で) }}} 変数のコンバートとエラーチェック {{{ $this->objCustomer >convertParam($this->arrForm); $this->objCustomer >errorCheck(); }}} が出来ます。 まだ簡単なものですがフォームの定義の使いまわしが簡単に行え 既存のオブジェクト等にも導入できます。 統一的に使えばかなりコードの 見通しがよくなると思うのですがどうでしょうか。 ",改善提案,new,中,バックログ,その他,2.5-dev,,,,0