public function create(Entity $entity) { $id = $this->getId($entity); if ($id) { // No need to insert a new record. // Instead return the id of the notification that exists return $id; } $state = ['user_id' => $entity->user_id, 'created' => time()]; return parent::create($entity->setState($state)); }
public function create(Entity $entity) { $id = $this->getId($entity); // @todo perhaps allow fields for existing entity to be defined when an entity is being created if ($id) { // No need to insert a new record. // Instead return the id of the contact that exists return $id; } $state = ['created' => time()]; return parent::create($entity->setState($state)); }
public function create(Entity $entity) { $state = ['created' => time()]; return parent::create($entity->setState($state)); }
public function create(Entity $entity) { return parent::create($entity->setState(['status' => \Message_Status::PENDING, 'direction' => \Message_Direction::OUTGOING, 'created' => time()])); }
public function create(Entity $entity) { $state = ['created' => time(), 'password' => $this->hasher->hash($entity->password)]; return parent::create($entity->setState($state)); }
public function create(Entity $entity) { // todo ensure default group is created return parent::create($entity->setState(['created' => time()])); }