当前位置: 首页>>代码示例>>PHP>>正文


PHP QQN::Membership方法代码示例

本文整理汇总了PHP中QQN::Membership方法的典型用法代码示例。如果您正苦于以下问题:PHP QQN::Membership方法的具体用法?PHP QQN::Membership怎么用?PHP QQN::Membership使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QQN的用法示例。


在下文中一共展示了QQN::Membership方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetPriorMembershipText

 public function GetPriorMembershipText()
 {
     $strPriors = null;
     foreach ($this->objPerson->GetMembershipArray(QQ::OrderBy(QQN::Membership()->DateStart, false)) as $objMembership) {
         if ($objMembership->DateEnd) {
             $strPriors .= sprintf('<br/><em>Prior membership from %s to %s</em>', $objMembership->DateStart->__toString('MMMM D, YYYY'), $objMembership->DateEnd->__toString('MMMM D, YYYY'));
         }
     }
     return $strPriors;
 }
开发者ID:alcf,项目名称:chms,代码行数:10,代码来源:Vicp_GeneralProfile.class.php

示例2: dtgNewMembers_Bind

 protected function dtgNewMembers_Bind()
 {
     $dtAfterValue = new QDateTime($this->dtxAfterValue->Text);
     $dtBeforeValue = new QDateTime($this->dtxBeforeValue->Text);
     $objcondition = QQ::Equal(QQN::Membership()->Person->AttributeValue->Attribute->Name, 'Post-2016');
     $this->dtgNewMembers->TotalItemCount = Membership::CountArrayByStartDateRange($dtAfterValue, $dtBeforeValue, $objcondition);
     $objMembershipArray = Membership::LoadArrayByStartDateRange($dtAfterValue, $dtBeforeValue, $objcondition, $this->dtgNewMembers->LimitClause);
     $this->dtgNewMembers->DataSource = $objMembershipArray;
     $this->iTotalCount = count($objMembershipArray);
     $this->CalculateMaritalAndAgeStatus($objMembershipArray);
     $this->CalculateAttributeStatistics($objMembershipArray);
 }
开发者ID:alcf,项目名称:chms,代码行数:12,代码来源:newMembers.php

示例3: Form_Create

 protected function Form_Create()
 {
     $this->lblLabel = new QLabel($this);
     $this->lblLabel->Text = "Members who left after ";
     $this->dtxBeforeValue = new QDateTimeTextBox($this);
     $this->dtxBeforeValue->Name = "Members who Exited Before:";
     $this->dtxBeforeValue->Required = true;
     $this->beforeCalValue = new QCalendar($this, $this->dtxBeforeValue);
     $this->dtxBeforeValue->RemoveAllActions(QClickEvent::EventName);
     $this->dtxBeforeValue->AddAction(new QChangeEvent(), new QAjaxAction('dtxDate_Change'));
     $this->dtxBeforeValue->Text = QApplication::PathInfo(1);
     $this->dtxAfterValue = new QDateTimeTextBox($this);
     $this->dtxAfterValue->Name = "Members who exited After:";
     $this->dtxAfterValue->Required = true;
     $this->afterCalValue = new QCalendar($this, $this->dtxAfterValue);
     $this->dtxAfterValue->RemoveAllActions(QClickEvent::EventName);
     $this->dtxAfterValue->AddAction(new QChangeEvent(), new QAjaxAction('dtxDate_Change'));
     $this->dtxAfterValue->Text = QApplication::PathInfo(0);
     $this->dtgExitingMembers = new QDataGrid($this);
     $this->dtgExitingMembers->AddColumn(new QDataGridColumn('Name', '<?= $_ITEM->Person->FullName; ?>', 'Width=270px'));
     $this->dtgExitingMembers->AddColumn(new QDataGridColumn('Membership End Date', '<?= $_ITEM->DateEnd; ?>', 'Width=270px'));
     $this->dtgExitingMembers->AddColumn(new QDataGridColumn('Termination Reason', '<?= $_ITEM->TerminationReason; ?>', 'Width=270px'));
     $dtAfterValue = new QDateTime($this->dtxAfterValue->Text);
     $dtBeforeValue = new QDateTime($this->dtxBeforeValue->Text);
     $objcondition = QQ::Equal(QQN::Membership()->Person->AttributeValue->Attribute->Name, 'Post-2016');
     $objMembershipArray = Membership::LoadArrayByEndDateRange($dtAfterValue, $dtBeforeValue, $objcondition);
     $this->iTotalCount = count($objMembershipArray);
     $this->dtgExitingMembers->DataSource = $objMembershipArray;
     $chartArray = array();
     $terminationReason = array();
     foreach ($objMembershipArray as $member) {
         if (array_key_exists($member->TerminationReason, $terminationReason)) {
             $terminationReason[$member->TerminationReason]++;
         } else {
             $terminationReason[$member->TerminationReason] = 1;
         }
     }
     ksort($terminationReason, SORT_STRING);
     foreach ($terminationReason as $key => $value) {
         $objItem = new memberArray();
         $objItem->reason = $key;
         $objItem->count = $value;
         $chartArray[] = $objItem;
     }
     QApplication::ExecuteJavaScript('initializeChart(' . json_encode($chartArray) . ');');
 }
开发者ID:alcf,项目名称:chms,代码行数:46,代码来源:exitMembers.php

示例4: RefreshMembershipStatusTypeId

 /**
  * Recalculates this member's Membership Status and updates MembershipStatusTypeId
  * based on the calculation.  Will call save if asked to do so
  * @param boolean $blnSave whether or not to call save after updating
  * @return integer the new/updated TypeId
  */
 public function RefreshMembershipStatusTypeId($blnSave = true)
 {
     // If this Individual record isn't saved yet, then we are automatically not a member
     if (!$this->intId) {
         $this->intMembershipStatusTypeId = MembershipStatusType::NonMember;
         if ($blnSave) {
             $this->Save();
         }
         return $this->intMembershipStatusTypeId;
     }
     // Pull the most recent Membership
     $objMembership = Membership::QuerySingle(QQ::Equal(QQN::Membership()->PersonId, $this->intId), QQ::OrderBy(QQN::Membership()->DateStart, false));
     // If no membership
     if (!$objMembership) {
         // TODO: Check to see if "Child of Member"
         $this->intMembershipStatusTypeId = MembershipStatusType::NonMember;
         if ($blnSave) {
             $this->Save();
         }
         return $this->intMembershipStatusTypeId;
     }
     // If no EndDate, or EndDate is in the future
     if (!$objMembership->DateEnd || $objMembership->DateEnd->IsLaterThan(QDateTime::Now(false))) {
         $this->intMembershipStatusTypeId = MembershipStatusType::Member;
         if ($blnSave) {
             $this->Save();
         }
         return $this->intMembershipStatusTypeId;
     }
     // Check to see if we're deceased
     if ($objMembership->TerminationReason == MembershipStatusType::ToString(MembershipStatusType::Deceased)) {
         $this->intMembershipStatusTypeId = MembershipStatusType::Deceased;
         if ($blnSave) {
             $this->Save();
         }
         return $this->intMembershipStatusTypeId;
     }
     // Otherwise, we are a Past member
     $this->intMembershipStatusTypeId = MembershipStatusType::FormerMember;
     if ($blnSave) {
         $this->Save();
     }
     return $this->intMembershipStatusTypeId;
 }
开发者ID:alcf,项目名称:chms,代码行数:50,代码来源:Person.class.php

示例5: CountByDateStart

 /**
  * Count Memberships
  * by DateStart Index(es)
  * @param QDateTime $dttDateStart
  * @return int
  */
 public static function CountByDateStart($dttDateStart, $objOptionalClauses = null)
 {
     // Call Membership::QueryCount to perform the CountByDateStart query
     return Membership::QueryCount(QQ::Equal(QQN::Membership()->DateStart, $dttDateStart), $objOptionalClauses);
 }
开发者ID:alcf,项目名称:chms,代码行数:11,代码来源:MembershipGen.class.php

示例6: ResolveContentItem

 /**
  * Used internally by the Meta-based Add Column tools.
  *
  * Given a QQNode or a Text String, this will return a Membership-based QQNode.
  * It will also verify that it is a proper Membership-based QQNode, and will throw an exception otherwise.
  *
  * @param mixed $mixContent
  * @return QQNode
  */
 protected function ResolveContentItem($mixContent)
 {
     if ($mixContent instanceof QQNode) {
         if (!$mixContent->_ParentNode) {
             throw new QCallerException('Content QQNode cannot be a Top Level Node');
         }
         if ($mixContent->_RootTableName == 'membership') {
             if ($mixContent instanceof QQReverseReferenceNode && !$mixContent->_PropertyName) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             }
             $objCurrentNode = $mixContent;
             while ($objCurrentNode = $objCurrentNode->_ParentNode) {
                 if (!$objCurrentNode instanceof QQNode) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
                 if ($objCurrentNode instanceof QQReverseReferenceNode && !$objCurrentNode->_PropertyName) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
             }
             return $mixContent;
         } else {
             throw new QCallerException('Content QQNode has a root table of "' . $mixContent->_RootTableName . '". Must be a root of "membership".');
         }
     } else {
         if (is_string($mixContent)) {
             switch ($mixContent) {
                 case 'Id':
                     return QQN::Membership()->Id;
                 case 'PersonId':
                     return QQN::Membership()->PersonId;
                 case 'Person':
                     return QQN::Membership()->Person;
                 case 'DateStart':
                     return QQN::Membership()->DateStart;
                 case 'DateEnd':
                     return QQN::Membership()->DateEnd;
                 case 'TerminationReason':
                     return QQN::Membership()->TerminationReason;
                 default:
                     throw new QCallerException('Simple Property not found in MembershipDataGrid content: ' . $mixContent);
             }
         } else {
             if ($mixContent instanceof QQAssociationNode) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             } else {
                 throw new QCallerException('Invalid Content type');
             }
         }
     }
 }
开发者ID:alcf,项目名称:chms,代码行数:59,代码来源:MembershipDataGridGen.class.php

示例7: dtgMemberships_Bind

 public function dtgMemberships_Bind()
 {
     $this->dtgMemberships->DataSource = $this->objPerson->GetMembershipArray(QQ::OrderBy(QQN::Membership()->DateStart, false));
 }
开发者ID:alcf,项目名称:chms,代码行数:4,代码来源:Vicp_GeneralProfile_ViewMembership.class.php

示例8: LoadArrayByEndDateRange

 public static function LoadArrayByEndDateRange($dttAfterDateStart, $dttBeforeDateStart, $objCondition = null, $objOptionalClauses = null)
 {
     // This will return an array of Membership objects
     $objCondition = QQ::AndCondition($objCondition, QQ::AndCondition(QQ::GreaterOrEqual(QQN::Membership()->DateEnd, $dttAfterDateStart), QQ::LessOrEqual(QQN::Membership()->DateEnd, $dttBeforeDateStart)));
     return Membership::QueryArray($objCondition, $objOptionalClauses);
 }
开发者ID:alcf,项目名称:chms,代码行数:6,代码来源:Membership.class.php


注:本文中的QQN::Membership方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。