Open
Description
<?php
class Model extends \Jenssegers\Mongodb\Model
{
public function association()
{
return $this->embedsMany('ModelChild');
}
}
class ModelChild extends \Jenssegers\Mongodb\Model
{
}
$model = new Model;
$child = new ChildModel;
$model->association()->associate($child);
$model->save(); // The child's timestamps ARE NOT hydrated
$model = new Model;
$child = new ChildModel;
$model->save();
$model->association()->save($child); // The child's timestamps ARE hydrated
The result should have been the same regardless the way we saved the model (preferably, the timestamps should be there is both cases).