Example #1
0
    public static function LoadAllUsingOrderBy($strOrderBy = null, $strLimit = null, $objExpansionMap = null)
    {
        // Call to ArrayQueryHelper to Get Database Object and Get SQL Clauses
        DirectoryToken::ArrayQueryHelper($strOrderBy, $strLimit, $strLimitPrefix, $strLimitSuffix, $strExpandSelect, $strExpandFrom, $objExpansionMap, $objDatabase);
        // Setup the SQL Query
        $strQuery = sprintf('
				SELECT
				%s
					`directory_token`.`id` AS `id`,
					`directory_token`.`token` AS `token`,
					`directory_token`.`path` AS `path`,
					`directory_token`.`core_flag` AS `core_flag`,
					`directory_token`.`relative_flag` AS `relative_flag`
					%s
				FROM
					`directory_token` AS `directory_token`
					%s
				%s
				%s', $strLimitPrefix, $strExpandSelect, $strExpandFrom, $strOrderBy, $strLimitSuffix);
        // Perform the Query and Instantiate the Result
        $objDbResult = $objDatabase->Query($strQuery);
        return DirectoryToken::InstantiateDbResult($objDbResult);
    }
 /**
  * Static Qcodo Query method to query for an array of DirectoryToken objects.
  * Uses BuildQueryStatment to perform most of the work.
  * @param QQCondition $objConditions any conditions on the query, itself
  * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
  * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
  * @return DirectoryToken[] the queried objects as an array
  */
 public static function QueryArray(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null)
 {
     // Get the Query Statement
     try {
         $strQuery = DirectoryToken::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     // Perform the Query and Instantiate the Array Result
     $objDbResult = $objQueryBuilder->Database->Query($strQuery);
     return DirectoryToken::InstantiateDbResult($objDbResult, $objQueryBuilder->ExpandAsArrayNodes);
 }