Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $contentModel = new Content();
- $categoryModel = new Category();
- $category = $categoryModel->createRow();
- $category->setName('Name Category 4');
- $content = $contentModel->createRow();
- $content->setTitle('Title 4');
- $content->setCategory($category);
- $content->save();
- $contentModel = new Content();
- $categoryModel = new Category();
- $category = $categoryModel->createRow();
- $category->setName('Name Category 4');
- $content = $contentModel->createRow();
- $content->setTitle('Title 4');
- // saving populates the primary key field in the Row object
- $category->save();
- $content->setCategory($category->category_id);
- $content->save();
- protected $_rowClass = 'Db_Table_Row';
- public function __get($key)
- {
- $inflector = new Zend_Filter_Word_UnderscoreToCamelCase();
- $method = 'get' . $inflector->filter($key);
- if(method_exists($this, $method)) {
- return $this->{$method}();
- }
- return parent::__get($key);
- }
- public function __set($key, $value)
- {
- $inflector = new Zend_Filter_Word_UnderscoreToCamelCase();
- $method = 'set' . $inflector->filter($key);
- if(method_exists($this, $method))
- return $this->{$method}($value);
- return parent::__set($key, $value);
- }
- public function setCategory($value)
- {
- $this->category_id = $value->category_id;
- }
Add Comment
Please, Sign In to add comment