示例#1
0
 /**
  * {@inheritdoc}
  */
 public function remove(EntityInterface $entity)
 {
     assert($entity instanceof StateInterface);
     /* @var $entity StateInterface */
     if (array_key_exists($entity->getStateId(), $this->states)) {
     }
 }
示例#2
0
 /**
  * @param Todo $entity
  */
 public function run(EntityInterface $entity)
 {
     assert($entity instanceof Todo);
     $entity->setStatus(new TodoStatus());
     $this->repository->add($entity);
     $this->entityManager->flush();
 }
 /**
  * {@inheritDoc}
  */
 public function remove(EntityInterface $entity)
 {
     /* @var $entity \PHPMentors\PageflowerBundle\Pageflow\Pageflow */
     if (array_key_exists($entity->getPageflowId(), $this->pageflows)) {
         unset($this->pageflows[$entity->getPageflowId()]);
     }
 }
 /**
  * {@inheritDoc}
  */
 public function remove(EntityInterface $entity)
 {
     /* @var $entity \PHPMentors\PageflowerBundle\Controller\ReflectionConversationalController */
     if (array_key_exists($entity->getClass()->getName(), $this->entities)) {
         unset($this->entities[$entity->getClass()->getName()]);
     }
 }
 /**
  * {@inheritDoc}
  */
 public function isSatisfiedBy(EntityInterface $entity)
 {
     if ($entity->getStartDate() <= $this->clock->getCurrentDateTime() && $entity->getEndDate() > $this->clock->getCurrentDateTime()) {
         return true;
     }
     return false;
 }
示例#6
0
 /**
  * {@inheritdoc}
  */
 public function remove(EntityInterface $entity)
 {
     assert($entity instanceof EventInterface);
     /* @var $entity EventInterface */
     if (array_key_exists($entity->getEventId(), $this->events)) {
         unset($this->events[$entity->getEventId()]);
     }
 }
示例#7
0
 public function save(EntityInterface $notes)
 {
     $notesData = array('user_id' => $notes->getUserId(), 'user_username' => $notes->getUserName(), 'status' => $notes->getStatus(), 'title' => $notes->getTitle(), 'content' => $notes->getContent());
     if ($notes->getNotesId()) {
         $notesData['updated_at'] = date("Y-m-d H:i:s", time());
         $notesData['created_at'] = $notes->getCreatedAt();
         $this->db->update('sticky_notes', $notesData, array('notes_id' => $notes->getNotesId()));
     } else {
         $notesData['updated_at'] = date("Y-m-d H:i:s", time());
         $notesData['created_at'] = date("Y-m-d H:i:s", time());
         $this->db->insert('sticky_notes', $notesData);
         $id = $this->db->lastInsertId();
         $notes->setNotesId($id);
     }
     return null;
 }
示例#8
0
 public function save(EntityInterface $user)
 {
     $userData = array('login_id' => $user->getLoginId(), 'name' => $user->getName(), 'email' => $user->getEmail(), 'username' => $user->getUsername());
     if ($user->getId()) {
         $userData['updated_at'] = date("Y-m-d H:i:s", time());
         $userData['created_at'] = $user->getCreatedAt();
         $this->db->update('user_info', $userData, array('id' => $user->getId()));
     } else {
         $userData['updated_at'] = date("Y-m-d H:i:s", time());
         $userData['created_at'] = date("Y-m-d H:i:s", time());
         $this->db->insert('user_info', $userData);
         $id = $this->db->lastInsertId();
         $user->setId($id);
     }
     return null;
 }
 /**
  * {@inheritDoc}
  *
  * @return void
  */
 public function run(EntityInterface $user)
 {
     $user->setActivationKey(base64_encode($this->secureRandom->nextBytes(24)));
     $user->setPassword($this->passwordEncoder->encodePassword($user->getPassword(), User::SALT));
     $user->setRegistrationDate(new \DateTime());
     $this->entityManager->getRepository(User::class)->add($user);
     $this->entityManager->flush();
 }
 /**
  * {@inheritDoc}
  */
 public function remove(EntityInterface $entity)
 {
     /* @var $entity \PHPMentors\PageflowerBundle\Conversation\Conversation */
     unset($this->conversationCollection[$entity->getConversationId()]);
 }
 /**
  * @param Todo $entity
  */
 public function isSatisfiedBy(EntityInterface $entity)
 {
     assert($entity instanceof Todo);
     return $entity->getStatus()->isCompleted();
 }
 /**
  * @inheritdoc
  */
 public function add(EntityInterface $entity)
 {
     /** @var Method $entity */
     $this->_data[$entity->getFQN()] = $entity;
 }
示例#13
0
 public function save(EntityInterface $event)
 {
     $eventData = array('user_id' => $event->getUserId(), 'username' => $event->getUserName(), 'title_status' => $event->getTitleStatus(), 'title' => $event->getTitle(), 'event_name' => $event->getEventName(), 'event_status' => $event->getEventStatus(), 'description' => $event->getDescription());
     if ($event->getId()) {
         $eventData['updated_at'] = date("Y-m-d H:i:s", time());
         $eventData['created_at'] = $event->getCreatedAt();
         $this->db->update('events', $eventData, array('id' => $event->getId()));
     } else {
         $eventData['updated_at'] = date("Y-m-d H:i:s", time());
         $eventData['created_at'] = date("Y-m-d H:i:s", time());
         $this->db->insert('events', $eventData);
         $id = $this->db->lastInsertId();
         $event->setId($id);
     }
     return null;
 }
 /**
  * @inheritdoc
  */
 public function add(EntityInterface $entity)
 {
     /** @var ClassModel $entity */
     $this->_data[$entity->getFQCN()] = $entity;
 }