I have the following models and relations (sample code) (phalcon 1.3.5)
<?php
class User extends \Phalcon\Mvc\Model
{
public function initialize()
{
parent::initialize();
$this->hasMany("user_id", "UserContent", "user_id", ['alias' => 'user']);
}
}
<?php
class UserContent extends \Phalcon\Mvc\Model
{
public function initialize()
{
parent::initialize();
$this->belongsTo("user_id","User","user_id", ["alias" => "user"] );
}
}
<?php
$user_content = new UserContent();
$user_content->some_key = 'some_value';
$user_content->save();
Calling save() on the UserContent is triggering a save on the related 'User' module as well. I have gone through phalcon code and found that save() calls the _preSaveRelatedRecords() function.
Is there a way to disable this functionality or a work around tonot save User when UserContent is saved.