[eluser]manix[/eluser]
OK, I found the answer (at least one option).You need to set "hooks point" as many you need, in my case I did it by this way:
Code:
class Article extends CI_Controller
{
public function index()
{
$title = $this->input->post('title');
$body = $this->input->post('body');
$article = new Article();
$article->setTitle($title);
$article->setBody($body);
do_action('before_persist', $article);
$this->my_db->save($article);
}
}
Finally, my "before_persist" function have the correct code in order to add new properties to $article object
Code:
$register_hook('before_persist', 'add_date_article', $params);
Code:
function add_date_article($params)
{
$article = $params[0];
$published = $this->input->post('date');
$article->setPublished($publiched);
}