Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
 public function create(Entity $entity)
 {
     $state = ['created' => time()];
     return parent::create($entity->setState($state));
 }
Exemplo n.º 4
0
 public function create(Entity $entity)
 {
     return parent::create($entity->setState(['status' => \Message_Status::PENDING, 'direction' => \Message_Direction::OUTGOING, 'created' => time()]));
 }
Exemplo n.º 5
0
 public function create(Entity $entity)
 {
     $state = ['created' => time(), 'password' => $this->hasher->hash($entity->password)];
     return parent::create($entity->setState($state));
 }
Exemplo n.º 6
0
 public function create(Entity $entity)
 {
     // todo ensure default group is created
     return parent::create($entity->setState(['created' => time()]));
 }