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


PHP Person::QuerySingle方法代碼示例

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


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

示例1: Run

 /**
  * Main DataGen Runner
  * @return void
  */
 public static function Run()
 {
     self::$SystemStartDate = new QDateTime('2004-01-01');
     self::$MaximumPersonId = Person::QuerySingle(QQ::All(), QQ::OrderBy(QQN::Person()->Id, false))->Id;
     self::DisplayForEachTaskStart($strDescription = 'Generating Signup Forms for Ministry', Ministry::CountByActiveFlag(true));
     foreach (Ministry::LoadArrayByActiveFlag(true) as $objMinistry) {
         self::DisplayForEachTaskNext($strDescription);
         $intCount = rand(self::FormsPerMinistryMinimum, self::FormsPerMinistryMaximum);
         self::DisplayForEachTaskStart($strDescriptionInside = '   Generating Signup Forms', $intCount);
         for ($i = 0; $i < $intCount; $i++) {
             self::DisplayForEachTaskNext($strDescriptionInside);
             self::GenerateFormInMinistry($objMinistry);
         }
         self::DisplayForEachTaskEnd($strDescriptionInside, true);
     }
     self::DisplayForEachTaskEnd($strDescription);
 }
開發者ID:alcf,項目名稱:chms,代碼行數:21,代碼來源:datagen-forms.cli.php

示例2: testQuerySingleEmpty

 public function testQuerySingleEmpty()
 {
     $targetPerson = Person::QuerySingle(QQ::Equal(QQN::Person()->Id, 1241243));
     $this->assertEqual($targetPerson, null, "QuerySingle should return null for a not-found record");
 }
開發者ID:tomVertuoz,項目名稱:framework,代碼行數:5,代碼來源:BasicOrmTests.php

示例3: LoadByPrimaryEmailId

 /**
  * Load a single Person object,
  * by PrimaryEmailId Index(es)
  * @param integer $intPrimaryEmailId
  * @return Person
  */
 public static function LoadByPrimaryEmailId($intPrimaryEmailId, $objOptionalClauses = null)
 {
     return Person::QuerySingle(QQ::Equal(QQN::Person()->PrimaryEmailId, $intPrimaryEmailId), $objOptionalClauses);
 }
開發者ID:alcf,項目名稱:chms,代碼行數:10,代碼來源:PersonGen.class.php

示例4: testOrderByReverseReference

 public function testOrderByReverseReference()
 {
     // orders by the private key of the reverse reference node.
     $objPerson = Person::QuerySingle(QQ::IsNotNull(QQN::Person()->ProjectAsManager->Id), [QQ::OrderBy(QQN::Person()->ProjectAsManager)]);
     $this->assertEquals(7, $objPerson->Id, "Manager of first project found.");
 }
開發者ID:vaibhav-kaushal,項目名稱:qc-framework,代碼行數:6,代碼來源:BasicOrmTest.php

示例5: constructs

		The next few examples will examine all three major constructs (<b>QQ Node</b>, <b>QQ Condition</b> and <b>QQ Clause</b>) in greater
		detail.<br/><br/>
		
		And as a final note, notice that <b>Qcodo Query</b> doesn't have any construct to describe what would normally be your SELECT clause.
		This is because we take advantage of the code generation process to allow <b>Qcodo Query</b> to automagically "know" which
		fields that should be SELECT-ed based on the query, conditions and clauses you are performing.  This will allow a lot
		greater flexbility in your data model.  Because the framework is now taking care of column names, etc., instead of the
		developer needing to manually hard code it, you can make changes to columns in your tables without needing to rewrite
		your <b>Qcodo Query</b> calls.
	</div>



	<h3>QuerySingle Example</h3>
<?php 
$objPerson = Person::QuerySingle(QQ::Equal(QQN::Person()->Id, 1));
// Notice that QuerySingle returned just a single Person object
_p($objPerson->FirstName . ' ' . $objPerson->LastName);
_p('<br/>', false);
?>



	<h3>QueryArray Example</h3>
<?php 
$objPersonArray = Person::QueryArray(QQ::In(QQN::Person()->Id, array(5, 6, 8)));
// Notice that QueryArray returns an array of Person objects... this will
// be true even if the result set only yields 1 row.=
foreach ($objPersonArray as $objPerson) {
    _p($objPerson->FirstName . ' ' . $objPerson->LastName);
    _p('<br/>', false);
開發者ID:qcodo,項目名稱:qcodo,代碼行數:31,代碼來源:qq.php

示例6: LoadByEmail

 /**
  * Load a single Person object,
  * by Email Index(es)
  * @param string $strEmail
  * @return Person
  */
 public static function LoadByEmail($strEmail)
 {
     return Person::QuerySingle(QQ::Equal(QQN::Person()->Email, $strEmail));
 }
開發者ID:qcodo,項目名稱:qcodo-website,代碼行數:10,代碼來源:PersonGen.class.php

示例7: testNullArray

 public function testNullArray()
 {
     $arrPeople = Person::QuerySingle(QQ::Equal(QQN::Person()->Id, 2));
     $this->assertTrue(is_null($arrPeople->_ProjectAsManagerArray), "_ProjectAsManagerArray is null");
 }
開發者ID:hiptc,項目名稱:dle2wordpress,代碼行數:5,代碼來源:ExpandAsArrayTests.php

示例8: testTypeExpansion

 public function testTypeExpansion()
 {
     $clauses = QQ::Clause(QQ::ExpandAsArray(QQN::Person()->PersonType));
     $objPerson = Person::QuerySingle(QQ::Equal(QQN::Person()->Id, 7), $clauses);
     $intPersonTypeArray = $objPerson->_PersonTypeArray;
     $this->assertEqual($intPersonTypeArray, array(PersonType::Manager, PersonType::CompanyCar), "PersonType expansion is correct");
 }
開發者ID:tomVertuoz,項目名稱:framework,代碼行數:7,代碼來源:ExpandAsArrayTests.php

示例9: LoadByUsername

 /**
  * Load a single Person object,
  * by Username Index(es)
  * @param string $strUsername
  * @return Person
  */
 public static function LoadByUsername($strUsername)
 {
     return Person::QuerySingle(QQ::Equal(QQN::Person()->Username, $strUsername));
 }
開發者ID:qcodo,項目名稱:qcodo-api,代碼行數:10,代碼來源:PersonGen.class.php


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