public function getId() { if ($this->__isInitialized__ === false) { return (int) $this->_identifier["id"]; } $this->__load(); return parent::getId(); }
public function getAllNotInLocalSecretsByType(\Buggl\MainBundle\Entity\EGuide $eGuide, LocalAuthor $author, $type, $offset = 0, $limit = 0) { $typeClause = !is_null($type) ? 'AND sd.spot_type_id = ?' : ''; $sql = "SELECT sd . *\n\t\t\t\t\tFROM `spot_detail` AS sd\n\t\t\t\t\tWHERE 1\n\t\t\t\t\t\tAND sd.local_author_id = ?\n\t\t\t\t\t\tAND sd.id NOT IN (\n\t\t\t\t\t\t\tSELECT egts.spot_detail_id\n\t\t\t\t\t\t\tFROM e_guide_to_spot_detail AS egts\n\t\t\t\t\t\t\tWHERE egts.e_guide_id = ?\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{$typeClause}"; // echo $sql; $params = array($author->getId(), $eGuide->getId()); if (!is_null($type)) { $params = array_merge($params, array($type->getId())); } if ($limit > 0) { $sql .= " LIMIT ?,?"; $params = array_merge($params, array($offset, $limit)); } $spotDetails = $this->executeNativeQuery($sql, $params); return $spotDetails; }