/** * {@inheritdoc} * * Accessor options include field type resolved by DocumentSchema. * * @throws ODMException * @throws DefinitionException */ protected function createAccessor($accessor, $value) { $accessor = parent::createAccessor($accessor, $value); if ($accessor instanceof CompositableInterface && !$this->isLoaded() && !$this->isEmbedded()) { //Newly created object $accessor->invalidate(); } return $accessor; }