Ejemplo n.º 1
0
 /**
  * 
  * @param \Entity\Event $event
  * @return type
  */
 public function findByEvent($event)
 {
     $sql = 'SELECT description, equipment_id, time, create_timestamp, user_id, type FROM event ' . 'WHERE description = :description and ' . ' equipment_id = :equipment_id and ' . ' time = :time and ' . ' create_timestamp = :create_timestamp and ' . ' user_id = :user_id and ' . ' type = :type ';
     $stmt = $this->db->getConnection()->prepare($sql);
     $stmt->bindParam('equipment_id', $event->getEquipmentId());
     $stmt->bindParam('create_timestamp', $event->getTimestamp());
     $stmt->bindParam('user_id', $event->getUserId());
     $stmt->bindParam('type', $event->getType());
     $stmt->bindParam('time', $event->getTime());
     $stmt->execute();
     $result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
     return $this->eventFactory($result);
 }
Ejemplo n.º 2
0
 /**
  * Include Author
  *
  * @return League\Fractal\ItemResource
  */
 public function includeUser(\Entity\Event $event)
 {
     $user = $event->getUser();
     return $this->item($user, new UserTransformer());
 }