当前位置: 首页>>代码示例>>PHP>>正文


PHP Query::execute方法代码示例

本文整理汇总了PHP中Query::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP Query::execute方法的具体用法?PHP Query::execute怎么用?PHP Query::execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Query的用法示例。


在下文中一共展示了Query::execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getProfile

 /**
  * Get user profile
  *
  * @access public
  * @param  resource  $ldap
  * @param  string    $baseDn
  * @param  string    $query
  * @return array
  */
 public function getProfile($ldap, $baseDn, $query)
 {
     $this->query->execute($ldap, $baseDn, $query, $this->getAttributes());
     $profile = array();
     if ($this->query->hasResult()) {
         $profile = $this->prepareProfile();
     }
     return $profile;
 }
开发者ID:Folcky,项目名称:kanboard,代码行数:18,代码来源:User.php

示例2: testExecuteQueryFailed

 public function testExecuteQueryFailed()
 {
     self::$functions->expects($this->once())->method('ldap_search')->with($this->equalTo('my_ldap_resource'), $this->equalTo('ou=People,dc=kanboard,dc=local'), $this->equalTo('uid=my_user'), $this->equalTo(array('displayname')))->will($this->returnValue(false));
     $query = new Query();
     $query->execute('my_ldap_resource', 'ou=People,dc=kanboard,dc=local', 'uid=my_user', array('displayname'));
     $this->assertFalse($query->hasResult());
 }
开发者ID:Folcky,项目名称:kanboard,代码行数:7,代码来源:QueryTest.php

示例3: toArray

    public function toArray()
    {
        $data = $this->_cache->getData();

//        print_r($data);

        if (empty($data))
        {
            $query = new Query($this->_callChain);
            try
            {
                $data = $query->execute();
                if (! empty($data))
                {
                    $this->_cache->populate($data[0]);
                }
                $data = $this->_cache->getData();
            }
            catch (Exception $e)
            {
                throw $e;
            }
        }

        return $data;
    }
开发者ID:Goodgulf,项目名称:nodemesh,代码行数:26,代码来源:class.Node.php

示例4: Query

 /**
  * Gets a Role object
  *
  * @param id the Role Id
  * @return the Role object
  */
 function &get($id)
 {
     $query = new Query("Role");
     $criteria = new Criteria($query, "ID", $id);
     $query->setCriterion($criteria);
     return $this->mapOne($query->execute());
 }
开发者ID:BackupTheBerlios,项目名称:icf-svn,代码行数:13,代码来源:roleMapper.php

示例5: execute

 public function execute(array $parameters = array(), array $options = array())
 {
     if ($stmt = parent::execute($parameters, $options)) {
         return $stmt->rowCount();
     }
     return $stmt;
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:7,代码来源:DeleteQuery.obj.php

示例6: Query

 /**
  * Gets RoleUser objects by a roleId
  *
  * @param $roleId role id looked up
  * @return Array - array with RoleUser objects
  */
 function &findByRoleId($roleId)
 {
     $query = new Query("RoleUser");
     $criteria = new Criteria($query, "roleID", $roleId);
     $query->setCriterion($criteria);
     return $this->mapAll($query->execute());
 }
开发者ID:BackupTheBerlios,项目名称:icf-svn,代码行数:13,代码来源:roleUserMapper.php

示例7: Query

 /**
  * Gets the classes whose objects the user can execute certain action
  *
  * @param $action object - The action that the user should be allowed to do
  * @param $user User - The user that holds de permissions
  * @return Array - an array of class objects
  */
 function &findByPermission($action, $user)
 {
     $classQuery = new Query("Class");
     // Navigate relationships
     $folderClassQuery =& $classQuery->queryRelationedClass("FolderClass");
     $permissionQuery =& $folderClassQuery->queryRelationedClass("Permission");
     $actionQuery =& $permissionQuery->queryRelationedClass("Action", Relationship::ManyToOneType());
     $roleQuery =& $permissionQuery->queryRelationedClass("Role", Relationship::ManyToOneType());
     $roleUserQuery =& $roleQuery->queryRelationedClass("RoleUser");
     $userQuery =& $roleUserQuery->queryRelationedClass("User", Relationship::ManyToOneType());
     // Criterias
     $criteriaGroup = new CriteriaGroup();
     $actionCriteria = new Criteria($actionQuery, "action", $action->getAction());
     $userCriteria = new Criteria($userQuery, "ID", $user->getId());
     $criteriaGroup->addCriterion($actionCriteria);
     $criteriaGroup->addCriterion($userCriteria);
     $classQuery->setCriterion($criteriaGroup);
     // sorting
     $order = new Order($classQuery, "title", "ASC");
     $classQuery->addOrder($order);
     // Execute the query
     $recordset =& $classQuery->execute();
     $array = $this->mapAll($recordset);
     return $array;
 }
开发者ID:BackupTheBerlios,项目名称:icf-svn,代码行数:32,代码来源:baseClassMapper.php

示例8: findByFolderClassId

 /**
  * Gets a list with permissions for a folderClass object
  * @param $folderClassId FolderClass - the folderClass object
  * @return Array with permission objects
  */
 function findByFolderClassId($folderClassId)
 {
     $query = new Query("Permission");
     $criteria = new Criteria($query, "folderClassID", $folderClassId);
     $query->setCriterion($criteria);
     return $this->mapAll($query->execute());
 }
开发者ID:BackupTheBerlios,项目名称:icf-svn,代码行数:12,代码来源:permissionMapper.php

示例9: findByClassId

 /**
  * Gets a class' attributes
  *
  * @param classId id of a class
  * @return array of class objects
  */
 function findByClassId($classId)
 {
     $query = new Query("ClassAttribute");
     $criteria = new Criteria($query, "classID", $classId);
     $query->setCriterion($criteria);
     $order = new Order($query, "position", Order::OrderTypeAsc());
     $query->addOrder($order);
     return $this->mapAll($query->execute());
 }
开发者ID:BackupTheBerlios,项目名称:icf-svn,代码行数:15,代码来源:classAttributeMapper.php

示例10: testBadData

 public function testBadData()
 {
     $path = __DIR__ . '/fixtures/datastore/querytest';
     $config = new Config($path . '/');
     $repo = new Repository('baddata', $config);
     $query = new Query($repo);
     $result = $query->execute();
     $this->assertEquals(1, count($result));
 }
开发者ID:gekt,项目名称:www,代码行数:9,代码来源:QueryTest.php

示例11: loadModels

 /**
  * Load the next round of models.
  */
 private function loadModels()
 {
     $start = $this->rangeStart($this->pointer, $this->limit);
     if ($this->loadedStart !== $start) {
         $this->query->start($start);
         $this->models = $this->query->execute();
         $this->loadedStart = $start;
     }
 }
开发者ID:jaredtking,项目名称:pulsar,代码行数:12,代码来源:Iterator.php

示例12: execute

 /**
  * Execution method
  * Bypasses constructor subject if value provided
  * @param mixed $value
  * @return array
  */
 public function execute($value = null)
 {
     if (is_null($value)) {
         if (empty($this->subject)) {
             return $value;
         }
         $value = $this->subject;
     }
     return parent::execute($value);
 }
开发者ID:jgswift,项目名称:filtratr,代码行数:16,代码来源:ArrayQuery.php

示例13: count

 public function count()
 {
     $this->count = true;
     if ($count = $this->getDataCache()) {
         return $count;
     }
     $count = parent::execute()->count();
     $this->setDataCache($count);
     return $count;
 }
开发者ID:mongator,项目名称:mongator,代码行数:10,代码来源:CachedQuery.php

示例14: execute

 /**
  * Checks the cache to see if this query exists and returns it. If it's
  * not in the cache then the query is run, stored and then returned.
  *
  * @return Result The result of the query.
  */
 public function execute()
 {
     // Generate a cache key by comparing our parameters to see if we've
     // made this query before
     $key = $this->getParameterHash() . $this->getFileHash();
     // Try and fetch a cached result object from APC
     $result = apc_fetch($key, $success);
     // If the result isn't in the cache then we run the real query
     if (!$success) {
         $result = parent::execute();
         apc_store($key, $result);
     }
     return $result;
 }
开发者ID:gekt,项目名称:www,代码行数:20,代码来源:CachedQuery.php

示例15: isPlay

function isPlay($idJoueur, $idTournoi, $database)
{
    $sql_func = 'SELECT * FROM joueurtournoi WHERE id_joueur = :id_joueur AND id_tournoi = :id_tournoi';
    $query_func = new Query($database, $sql_func);
    $query_func->bind(':id_joueur', $idJoueur, PDO::PARAM_INT);
    $query_func->bind(':id_tournoi', $idTournoi, PDO::PARAM_INT);
    if ($query_func->execute()) {
        $jeux = $query_func->getResult();
    }
    if (empty($jeux)) {
        //ne joue pas a ce jeux
        return 0;
    } else {
        //joue a ce jeux
        return 1;
    }
}
开发者ID:HehLan,项目名称:Intranet-5.0,代码行数:17,代码来源:registrations.php


注:本文中的Query::execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。