当前位置: 首页>>代码示例>>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;未经允许,请勿转载。