Beispiel #1
0
 /**
  * Returns class instance
  *
  * @return YNSOCIALCONNECT_BOL_ServicesDao
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Beispiel #2
0
 public function findByUserId($userId)
 {
     //      init sql query
     $servicesDao = YNSOCIALCONNECT_BOL_ServicesDao::getInstance();
     $agentsDao = YNSOCIALCONNECT_BOL_AgentsDao::getInstance();
     $sqlQuery = "\n\t                        SELECT \t`ynu`.id, `ynu`.userId, `ynu`.identity, `ynu`.serviceId, `yns`.name, `yns`.title, `yna`.tokenData \t\n\t                        FROM  {$this->getTableName()}  AS `ynu`\n\t                        INNER JOIN `" . $servicesDao->getTableName() . "` AS `yns` ON(`yns`.`id` = `ynu`.`serviceId`) \n\t                        INNER JOIN `" . $agentsDao->getTableName() . "` AS `yna` ON(`yna`.`userId` = `ynu`.`userId` AND `yna`.`serviceId` = `ynu`.`serviceId`  AND `yna`.`identity` = `ynu`.`identity` )\n\t                        WHERE 1=1 \n\t\t                      ";
     $sqlQuery .= " AND `ynu`.userId = :userId";
     $sqlQuery .= " ORDER BY `yns`.ordering ASC, `ynu`.id ASC ";
     return $this->dbo->queryForList($sqlQuery, array('userId' => $userId));
 }