/** * @see Component::staticContainer() * @param array $fields * @param EntityInterface $parent * @param ODM $odm * @param array $odmSchema */ public function __construct($fields = [], EntityInterface $parent = null, ODM $odm = null, $odmSchema = null) { parent::__construct($fields, $parent, $odm, $odmSchema); if (!$this->isLoaded() && !$this->isEmbedded()) { //Document is newly created instance $this->solidState(true)->invalidate(); } }
/** * {@inheritdoc} */ public function __construct($fields = [], EntityInterface $parent = null, ODM $odm = null, $odmSchema = null) { if (is_string($fields)) { try { $fields = json_decode($fields, true); } catch (\ErrorException $exception) { $fields = []; } } parent::__construct($fields, $parent, $odm, $odmSchema); }