本文整理汇总了PHP中Person::QueryCount方法的典型用法代码示例。如果您正苦于以下问题:PHP Person::QueryCount方法的具体用法?PHP Person::QueryCount怎么用?PHP Person::QueryCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Person
的用法示例。
在下文中一共展示了Person::QueryCount方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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));
}
示例2: 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);
}
示例3: 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);
}
示例4: 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);
}
示例5: RenderCount
public function RenderCount($objGroup)
{
// Count differently if it's a group Category or Growth Group
if ($objGroup->Type == GroupType::$NameArray[GroupType::GroupCategory]) {
// Setup Group Array
$objGroupArray = $objGroup->GetThisAndChildren();
$intGroupIdArray = array();
foreach ($objGroupArray as $objGroup) {
$intGroupIdArray[] = $objGroup->Id;
}
$objCondition = QQ::In(QQN::Person()->GroupParticipation->GroupId, $intGroupIdArray);
$objCondition = QQ::AndCondition($objCondition, QQ::IsNull(QQN::Person()->GroupParticipation->DateEnd));
$strReturn = Person::QueryCount($objCondition);
return "<b>" . $strReturn . "</b>";
} else {
$objCondition = QQ::Equal(QQN::Person()->GroupParticipation->GroupId, $objGroup->Id);
$objCondition = QQ::AndCondition($objCondition, QQ::IsNull(QQN::Person()->GroupParticipation->DateEnd));
return Person::QueryCount($objCondition);
}
}
示例6: IsNameItemAssociated
/**
* Checks to see if an association exists with a specific NameItem
* @param NameItem $objNameItem
* @return bool
*/
public function IsNameItemAssociated(NameItem $objNameItem)
{
if (is_null($this->intId)) {
throw new QUndefinedPrimaryKeyException('Unable to call IsNameItemAssociated on this unsaved Person.');
}
if (is_null($objNameItem->Id)) {
throw new QUndefinedPrimaryKeyException('Unable to call IsNameItemAssociated on this Person with an unsaved NameItem.');
}
$intRowCount = Person::QueryCount(QQ::AndCondition(QQ::Equal(QQN::Person()->Id, $this->intId), QQ::Equal(QQN::Person()->NameItem->NameItemId, $objNameItem->Id)));
return $intRowCount > 0;
}
示例7: _p
// 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);
}
?>
<h3>QueryCount Example</h3>
<?php
$intCount = Person::QueryCount(QQ::In(QQN::Person()->Id, array(5, 6, 8)));
// Notice that QueryCount returns an integer
_p($intCount . ' rows.');
?>
<?php
require __INCLUDES__ . '/examples/footer.inc.php';
示例8: IsTopicAsReadAssociated
/**
* Checks to see if an association exists with a specific TopicAsRead
* @param Topic $objTopic
* @return bool
*/
public function IsTopicAsReadAssociated(Topic $objTopic)
{
if (is_null($this->intId)) {
throw new QUndefinedPrimaryKeyException('Unable to call IsTopicAsReadAssociated on this unsaved Person.');
}
if (is_null($objTopic->Id)) {
throw new QUndefinedPrimaryKeyException('Unable to call IsTopicAsReadAssociated on this Person with an unsaved Topic.');
}
$intRowCount = Person::QueryCount(QQ::AndCondition(QQ::Equal(QQN::Person()->Id, $this->intId), QQ::Equal(QQN::Person()->TopicAsRead->TopicId, $objTopic->Id)));
return $intRowCount > 0;
}
示例9: CountForMemberSearch
public static function CountForMemberSearch($strDisplayName)
{
return Person::QueryCount(QQ::Like(QQN::Person()->DisplayName, '%' . $strDisplayName . '%'));
}
示例10: MetaDataBinder
/**
* Main utility method to aid with data binding. It is used by the default BindAllRows() databinder but
* could and should be used by any custom databind methods that would be used for instances of this
* MetaDataGrid, by simply passing in a custom QQCondition and/or QQClause.
*
* If a paginator is set on this DataBinder, it will use it. If not, then no pagination will be used.
* It will also perform any sorting (if applicable).
*
* @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself
* @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query
* @return void
*/
public function MetaDataBinder(QQCondition $objCondition = null, $objOptionalClauses = null)
{
// Setup input parameters to default values if none passed in
if (!$objCondition) {
$objCondition = QQ::All();
}
$objClauses = $objOptionalClauses ? $objOptionalClauses : array();
// We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
if ($this->Paginator) {
$this->TotalItemCount = Person::QueryCount($objCondition, $objClauses);
}
// If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
// the OrderByClause to the $objClauses array
if ($objClause = $this->OrderByClause) {
array_push($objClauses, $objClause);
}
// Add the LimitClause information, as well
if ($objClause = $this->LimitClause) {
array_push($objClauses, $objClause);
}
// Set the DataSource to be a Query result from Person, given the clauses above
$this->DataSource = Person::QueryArray($objCondition, $objClauses);
}
示例11: CountByCountryId
/**
* Count People
* by CountryId Index(es)
* @param integer $intCountryId
* @return int
*/
public static function CountByCountryId($intCountryId)
{
// Call Person::QueryCount to perform the CountByCountryId query
return Person::QueryCount(QQ::Equal(QQN::Person()->CountryId, $intCountryId));
}
示例12: dtgMembers_Bind
public function dtgMembers_Bind()
{
if ($this->chkViewAll->Checked) {
$objCondition = QQ::Equal(QQN::Person()->GroupParticipation->GroupId, $this->objGroup->Id);
} else {
$objCondition = QQ::AndCondition(QQ::Equal(QQN::Person()->GroupParticipation->GroupId, $this->objGroup->Id), 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);
}