/** * Generates and adds fake data for a Timestamp on a entity. * * @param EntityInterface $entity an instance of the entity to fill with fake data. * @param AttributeInterface $attribute an instance of the Timestamp to fill with fake data. * @param array $options array of options to customize fake data creation. * * @return void */ protected function addTimestamp(EntityInterface $entity, AttributeInterface $attribute, array $options = array()) { $default_value = $attribute->getDefaultValue(); $this->setValue($entity, $attribute, $default_value ?: $this->faker->iso8601, $options); }
/** * Tells whether the valueholder's value is considered to be the same as * the default value defined on the attribute. * * @return boolean */ public function isDefault() { return $this->sameValueAs($this->attribute->getDefaultValue()); }