Created
November 21, 2011 15:00
-
-
Save rafi/1382870 to your computer and use it in GitHub Desktop.
validation: model related with other models
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Model_Core_Account extends Abstract_Model_Base { | |
public $list_fields = array(); | |
public function check() | |
{ | |
// validate list fields if exist, here! | |
// call parent model validation | |
return parent::check(); | |
} | |
class Controller_API_Accounts extends Controller_API { | |
public function post_collection() | |
{ | |
$account = new ... | |
$account->list_fields = arr::get($this->_request_body, 'fields', array()); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment