當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Person::QueryArray方法代碼示例

本文整理匯總了PHP中Person::QueryArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP Person::QueryArray方法的具體用法?PHP Person::QueryArray怎麽用?PHP Person::QueryArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Person的用法示例。


在下文中一共展示了Person::QueryArray方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testAlias1

 public function testAlias1()
 {
     $objPersonArray = Person::QueryArray(QQ::AndCondition(QQ::Equal(QQ::Alias(QQN::Person()->ProjectAsTeamMember, 'pm1')->ProjectId, 1), QQ::Equal(QQ::Alias(QQN::Person()->ProjectAsTeamMember, 'pm2')->ProjectId, 2)));
     $this->assertEqual(sizeof($objPersonArray), 3);
     $this->verifyObjectPropertyHelper($objPersonArray, 'FirstName', 'Kendall');
     $this->verifyObjectPropertyHelper($objPersonArray, 'LastName', 'Wolfe');
     $this->verifyObjectPropertyHelper($objPersonArray, 'LastName', 'Smith');
 }
開發者ID:tomVertuoz,項目名稱:framework,代碼行數:8,代碼來源:QQAliasTests.php

示例2: dtgPersons_Bind

 protected function dtgPersons_Bind()
 {
     // We must first let the datagrid know how many total items there are
     $this->dtgPersons->TotalItemCount = Person::QueryCount($this->dtgPersons->Conditions);
     // Next, we must be sure to load the data source, passing in the datagrid's
     // limit info into our loadall method.
     $this->dtgPersons->DataSource = Person::QueryArray($this->dtgPersons->Conditions, QQ::Clause($this->dtgPersons->OrderByClause, $this->dtgPersons->LimitClause));
 }
開發者ID:tomVertuoz,項目名稱:framework,代碼行數:8,代碼來源:filtering.php

示例3: auto_Bind

 public function auto_Bind($strFormId, $strControlId, $term)
 {
     $cond = QQ::OrCondition(QQ::Like(QQN::Person()->FirstName, '%' . $term . '%'), QQ::Like(QQN::Person()->LastName, '%' . $term . '%'));
     $a = Person::QueryArray($cond);
     $items = array();
     foreach ($a as $obj) {
         $items[] = new QListItem($obj->FirstName . ' ' . $obj->LastName, $obj->Id);
     }
     $this->auto2->DataSource = $items;
 }
開發者ID:vaibhav-kaushal,項目名稱:qc-framework,代碼行數:10,代碼來源:ui_select.php

示例4: dtgItems_Bind

 public function dtgItems_Bind()
 {
     $intYear = QApplication::PathInfo(0);
     $dttStart = new QDateTime($intYear . '-01-01');
     $dttEnd = new QDateTime($dttStart);
     $dttEnd->Year += 1;
     $dttStart->SetTime(null, null, null);
     $dttEnd->SetTime(null, null, null);
     $this->dtgItems->DataSource = Person::QueryArray(QQ::AndCondition(QQ::GreaterOrEqual(QQN::Person()->StewardshipContribution->DateCredited, $dttStart), QQ::LessThan(QQN::Person()->StewardshipContribution->DateCredited, $dttEnd), QQ::IsNull(QQN::Person()->PrimaryAddressText), QQ::IsNull(QQN::Person()->StewardshipAddressId)), QQ::Clause(QQ::Distinct(), QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName)));
 }
開發者ID:alcf,項目名稱:chms,代碼行數:10,代碼來源:invalid_addresses.php

示例5: testAssociationTables

 public function testAssociationTables()
 {
     // All People Who Are on a Project Managed by Karen Wolfe (Person ID #7)
     $objPersonArray = Person::QueryArray(QQ::Equal(QQN::Person()->ProjectAsTeamMember->Project->ManagerPersonId, 7), QQ::Clause(QQ::Distinct(), QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName)));
     $arrNamesOnly = array();
     foreach ($objPersonArray as $item) {
         $arrNamesOnly[] = $item->FirstName . " " . $item->LastName;
     }
     $this->assertEqual($arrNamesOnly, array("Brett Carlisle", "John Doe", "Samantha Jones", "Jacob Pratt", "Kendall Public", "Ben Robinson", "Alex Smith", "Wendy Smith", "Karen Wolfe"), "List managed persons is correct");
 }
開發者ID:hiptc,項目名稱:dle2wordpress,代碼行數:10,代碼來源:BasicOrmTests.php

示例6: testSelectSubsetInExpand

 public function testSelectSubsetInExpand()
 {
     $objPersonArray = Person::QueryArray(QQ::OrCondition(QQ::Like(QQN::Person()->ProjectAsManager->Name, '%ACME%'), QQ::Like(QQN::Person()->ProjectAsManager->Name, '%HR%')), QQ::Clause(QQ::Select(QQN::Person()->LastName), QQ::Expand(QQN::Person()->ProjectAsManager, null, QQ::Select(QQN::Person()->ProjectAsManager->Spent)), QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName)));
     foreach ($objPersonArray as $objPerson) {
         $this->assertNull($objPerson->FirstName, "FirstName should be null, since it was not selected");
         $this->assertNotNull($objPerson->Id, "Id should not be null since it's always added to the select list");
         $this->assertNotNull($objPerson->_ProjectAsManager->Id, "ProjectAsManager->Id should not be null since id's are always added to the select list");
         $this->assertNull($objPerson->_ProjectAsManager->Name, "ProjectAsManager->Name should be null since it was not selected");
     }
 }
開發者ID:hiptc,項目名稱:dle2wordpress,代碼行數:10,代碼來源:ExpandAsArrayTests.php

示例7: BindData

 protected function BindData()
 {
     if ($strFilter = $this->dtgTable->Search["search"]) {
         $objCondition = QQ::OrCondition(QQ::Like(QQN::Person()->FirstName, '%' . $strFilter . '%'), QQ::Like(QQN::Person()->LastName, '%' . $strFilter . '%'));
     } else {
         $objCondition = QQ::All();
     }
     $this->dtgTable->TotalItemCount = Person::QueryCount($objCondition);
     $objClauses[] = $this->dtgTable->OrderByClause;
     $objClauses[] = $this->dtgTable->LimitClause;
     $this->dtgTable->DataSource = Person::QueryArray($objCondition, $objClauses);
 }
開發者ID:qcubed,項目名稱:plugin_datatables,代碼行數:12,代碼來源:datatables2.php

示例8: dtgMembers_Bind

 public function dtgMembers_Bind()
 {
     $objCondition = QQ::In(QQN::Person()->GroupParticipation->GroupId, $this->intGroupIdArray);
     $objCondition = QQ::AndCondition($objCondition, QQ::IsNull(QQN::Person()->GroupParticipation->DateEnd));
     $this->dtgMembers->TotalItemCount = Person::QueryCount($objCondition);
     $objClauses = array(QQ::Distinct());
     if ($objClause = $this->dtgMembers->LimitClause) {
         $objClauses[] = $objClause;
     }
     if ($objClause = $this->dtgMembers->OrderByClause) {
         $objClauses[] = $objClause;
     }
     $this->dtgMembers->DataSource = Person::QueryArray($objCondition, $objClauses);
 }
開發者ID:alcf,項目名稱:chms,代碼行數:14,代碼來源:CpGroup_ViewGroupCategory.class.php

示例9: testAlias3

 public function testAlias3()
 {
     $emptySelect = QQ::Select();
     $emptySelect->SetSkipPrimaryKey(true);
     $nVoyel = QQ::Alias(QQN::Person()->ProjectAsManager->Milestone, 'voyel');
     $nConson = QQ::Alias(QQN::Person()->ProjectAsManager->Milestone, 'conson');
     $objPersonArray = Person::QueryArray(QQ::IsNotNull($nConson->Id), QQ::Clause(QQ::Expand($nVoyel, QQ::In($nVoyel->Name, array('Milestone A', 'Milestone E', 'Milestone I')), $emptySelect), QQ::Expand($nConson, QQ::NotIn($nConson->Name, array('Milestone A', 'Milestone E', 'Milestone I')), $emptySelect), QQ::GroupBy(QQN::Person()->Id), QQ::Minimum($nVoyel->Name, 'min_voyel'), QQ::Minimum($nConson->Name, 'min_conson'), QQ::Expand(QQN::Person()->ProjectAsManager, null, $emptySelect), QQ::Minimum(QQN::Person()->ProjectAsManager->Id, 'dummy'), QQ::Select(QQN::Person()->FirstName, QQN::Person()->LastName)));
     $this->assertEquals(3, sizeof($objPersonArray));
     $obj = $this->verifyObjectPropertyHelper($objPersonArray, 'LastName', 'Doe');
     $this->assertNull($obj->GetVirtualAttribute('min_voyel'));
     $this->assertEquals('Milestone F', $obj->GetVirtualAttribute('min_conson'));
     $obj = $this->verifyObjectPropertyHelper($objPersonArray, 'LastName', 'Ho');
     $this->assertEquals('Milestone E', $obj->GetVirtualAttribute('min_voyel'));
     $this->assertEquals('Milestone D', $obj->GetVirtualAttribute('min_conson'));
     $obj = $this->verifyObjectPropertyHelper($objPersonArray, 'LastName', 'Wolfe');
     $this->assertEquals('Milestone A', $obj->GetVirtualAttribute('min_voyel'));
     $this->assertEquals('Milestone B', $obj->GetVirtualAttribute('min_conson'));
 }
開發者ID:vaibhav-kaushal,項目名稱:qc-framework,代碼行數:18,代碼來源:QQAliasTest.php

示例10: getList

 protected function getList($strTerm = null, $blnHtml = false)
 {
     if ($strTerm) {
         $cond = QQ::OrCondition(QQ::Like(QQN::Person()->FirstName, '%' . $strTerm . '%'), QQ::Like(QQN::Person()->LastName, '%' . $strTerm . '%'));
     } else {
         $cond = QQ::All();
     }
     $clauses[] = QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName);
     $lst = Person::QueryArray($cond, $clauses);
     $a = array();
     foreach ($lst as $objPerson) {
         $item = new QListItem($objPerson->FirstName . ' ' . $objPerson->LastName, $objPerson->Id);
         if ($blnHtml) {
             $item->Label = '<em>' . $objPerson->FirstName . ' ' . $objPerson->LastName . '</em>';
         }
         $a[] = $item;
     }
     return $a;
 }
開發者ID:qcubed,項目名稱:plugin_autocomplete2,代碼行數:19,代碼來源:autocomplete2.php

示例11: dtgMembers_Bind

 public function dtgMembers_Bind()
 {
     $objConditions = QQ::Equal(QQN::Person()->GroupParticipation->GroupId, $this->objGroup->Id);
     $this->dtgMembers->TotalItemCount = Person::QueryCount($objConditions);
     if ($strName = trim($this->txtFirstName->Text)) {
         $objConditions = QQ::AndCondition($objConditions, QQ::Like(QQN::Person()->FirstName, $strName . '%'));
     }
     if ($strName = trim($this->txtLastName->Text)) {
         $objConditions = QQ::AndCondition($objConditions, QQ::Like(QQN::Person()->LastName, $strName . '%'));
     }
     $objClauses = array(QQ::Distinct());
     if ($objClause = $this->dtgMembers->LimitClause) {
         $objClauses[] = $objClause;
     }
     if ($objClause = $this->dtgMembers->OrderByClause) {
         $objClauses[] = $objClause;
     }
     $this->dtgMembers->DataSource = Person::QueryArray($objConditions, $objClauses);
 }
開發者ID:alcf,項目名稱:chms,代碼行數:19,代碼來源:CpGroup_ViewSmartGroup.class.php

示例12: COUNT

	<p>Note: the code below generates <a href="http://docs.hp.com/en/36216-90103/ch03s02.html">
	correlated (dependent) subqueries</a>. These are frequently not the
	fastest way to run queries against your SQL engine. If there is an
	opportunity to rewrite your subquery using simple joins, do it - this
	will improve the performance of your applications dramatically.</p>

	<p>In general, it's a good idea to use EXPLAIN statements to determine
	the query execution plan of the SQL statement that QQuery generates
	to determine what the SQL engine will actually do to run your queries.
	This is one of the best ways to improve the performance of your
	database-driven application.</p>
</div>

<div id="demoZone">
	<h2>Select names of project managers whose projects are over budget by at least $20</h2>
<?php 
QApplication::$Database[1]->EnableProfiling();
$objPersonArray = Person::QueryArray(QQ::IsNotNull(QQ::Virtual('over_budget_projects', QQ::SubSql("SELECT COUNT(*)\n\t\t\t\t\t\t\tFROM project\n\t\t\t\t\t\t\tWHERE (spent - budget > 20)\n\t\t\t\t\t\t\t\tAND manager_person_id={1}\n\t\t\t\t\t\t\tGROUP BY manager_person_id", QQN::Person()->Id))), QQ::Clause(QQ::OrderBy(QQ::Virtual('over_budget_projects'), false), QQ::Expand(QQ::Virtual('over_budget_projects'))));
foreach ($objPersonArray as $objPerson) {
    _p($objPerson->FirstName . ' ' . $objPerson->LastName . ': ' . $objPerson->GetVirtualAttribute("over_budget_projects") . " project(s) over budget");
    _p('<br/>', false);
}
?>
	<p><?php 
QApplication::$Database[1]->OutputProfiling();
?>
</p>
</div>

<?php 
require '../includes/footer.inc.php';
開發者ID:tomVertuoz,項目名稱:framework,代碼行數:31,代碼來源:subsql.php

示例13: CalculatePotentialSenderArray

 /**
  * Given a valid From EmailAddress, this will lookup and return a "Sender" array, a 3-item array containing:
  * 	Login
  * 	CommunicationListEntry
  * 	Person[]
  * that would correspond to this From EmailAddress.  Note that any one of those indexes can also be null
  * if there is no object corresponding to this From Email Address.
  * @return mixed[]
  */
 protected function CalculatePotentialSenderArray()
 {
     $objArrayToReturn = array();
     $objArrayToReturn[] = Login::LoadByEmail($this->FromAddress);
     $objArrayToReturn[] = CommunicationListEntry::LoadByEmail($this->FromAddress);
     // Get all Person objects that have this as an email address
     $objArrayToReturn[] = Person::QueryArray(QQ::Equal(QQN::Person()->Email->Address, $this->FromAddress), QQ::Distinct());
     return $objArrayToReturn;
 }
開發者ID:alcf,項目名稱:chms,代碼行數:18,代碼來源:EmailMessage.class.php

示例14: dtgPerson_Bind

 protected function dtgPerson_Bind()
 {
     $dtAfterValue = new QDateTime($this->dtxAfterValue->Text);
     $dtBeforeValue = new QDateTime($this->dtxBeforeValue->Text);
     $objConditions = QQ::All();
     $objConditions = QQ::AndCondition($objConditions, QQ::GreaterOrEqual(QQN::Person()->Comment->DatePosted, $dtAfterValue));
     $objConditions = QQ::AndCondition($objConditions, QQ::LessOrEqual(QQN::Person()->Comment->DatePosted, $dtBeforeValue));
     $objConditions = QQ::AndCondition($objConditions, QQ::Equal(QQN::Person()->Comment->CommentCategory->Name, "Pastoral"));
     $this->dtgPerson->TotalItemCount = count(Person::QueryArray($objConditions));
     $objPersonArray = Person::QueryArray($objConditions, $this->dtgPerson->LimitClause);
     $this->dtgPerson->DataSource = $objPersonArray;
 }
開發者ID:alcf,項目名稱:chms,代碼行數:12,代碼來源:confidential_report.php

示例15: LoadArrayBySearch

 public static function LoadArrayBySearch($strName, $objClauses = null)
 {
     $objCondition = QQ::All();
     if (!$objClauses) {
         $objClauses = array();
     }
     self::PrepareQqForSearch($strName, $objCondition, $objClauses);
     return Person::QueryArray($objCondition, $objClauses);
 }
開發者ID:alcf,項目名稱:chms,代碼行數:9,代碼來源:Person.class.php


注:本文中的Person::QueryArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。