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


PHP QQN::AttributeValue方法代码示例

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


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

示例1: CreateGroupParticipations

function CreateGroupParticipations(mysqli $objAcsDatabase, Group $objGroup, GroupRole $objRole, $intAcsGroupId, $intAcsReserveId)
{
    print "Adding for Group: " . $objGroup->Name . "\r\n      ";
    if ($intAcsReserveId) {
        $objResult = $objAcsDatabase->query(sprintf('select * from awgrrost where groupid=%s AND reserveid1=%s', $intAcsGroupId, $intAcsReserveId));
    } else {
        $objResult = $objAcsDatabase->query(sprintf('select * from awgrrost where groupid=%s', $intAcsGroupId));
    }
    while ($objRow = $objResult->fetch_array()) {
        $objAttributeValueArray = AttributeValue::QueryArray(QQ::AndCondition(QQ::Equal(QQN::AttributeValue()->AttributeId, 2), QQ::Equal(QQN::AttributeValue()->TextValue, $objRow['indvid'])));
        if (count($objAttributeValueArray) != 1) {
            printf("Issue with awgrrost.pkid of %s - IndvId %s for Group %s - AVCount of %s\r\n", $objRow['pkid'], $objRow['indvid'], $objGroup->Name, count($objAttributeValueArray));
        } else {
            $objPerson = $objAttributeValueArray[0]->Person;
            $dttStartDate = new QDateTime($objRow['dateadded']);
            if ($objRow['dateremoved']) {
                $dttEndDate = new QDateTime($objRow['dateremoved']);
            } else {
                $dttEndDate = null;
            }
            $objGroup->AddPerson($objPerson, $objRole->Id, $dttStartDate, $dttEndDate);
            print "*";
        }
    }
    print "\r\n      Done.\r\n\r\n";
}
开发者ID:alcf,项目名称:chms,代码行数:26,代码来源:acs-wsm-import.cli.php

示例2: SetupPanel

 protected function SetupPanel()
 {
     $this->dtgAttributes = new QDataGrid($this);
     $this->dtgAttributes->AddColumn(new QDataGridColumn('Attribute', '<a href="#attributes/edit/<?= $_ITEM->AttributeId; ?>"><?= QApplication::HtmlEntities($_ITEM->Attribute->Name); ?></a>', 'HtmlEntities=false', 'Width=180px;'));
     $this->dtgAttributes->AddColumn(new QDataGridColumn('Value', '<?= $_CONTROL->ParentControl->RenderValue($_ITEM); ?>', 'HtmlEntities=false', 'Width=570px'));
     $this->dtgAttributes->DataSource = $this->objPerson->GetAttributeValueArray(QQ::OrderBy(QQN::AttributeValue()->Attribute->Name));
 }
开发者ID:alcf,项目名称:chms,代码行数:7,代码来源:Vicp_Attributes.class.php

示例3: RenderSalvationDate

 public function RenderSalvationDate($objPerson)
 {
     $attributeArray = $objPerson->GetAttributeValueArray(QQ::OrderBy(QQN::AttributeValue()->Attribute->Name));
     foreach ($attributeArray as $objAttribute) {
         if ($objAttribute->Attribute->Name == 'Date Accepted Christ') {
             return $objAttribute->DateValue->ToString('MMMM D, YYYY');
         }
     }
 }
开发者ID:alcf,项目名称:chms,代码行数:9,代码来源:Attendees.php

示例4: ResolveContentItem

 /**
  * Used internally by the Meta-based Add Column tools.
  *
  * Given a QQNode or a Text String, this will return a AttributeValue-based QQNode.
  * It will also verify that it is a proper AttributeValue-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 == 'attribute_value') {
             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 "attribute_value".');
         }
     } else {
         if (is_string($mixContent)) {
             switch ($mixContent) {
                 case 'Id':
                     return QQN::AttributeValue()->Id;
                 case 'AttributeId':
                     return QQN::AttributeValue()->AttributeId;
                 case 'Attribute':
                     return QQN::AttributeValue()->Attribute;
                 case 'PersonId':
                     return QQN::AttributeValue()->PersonId;
                 case 'Person':
                     return QQN::AttributeValue()->Person;
                 case 'DateValue':
                     return QQN::AttributeValue()->DateValue;
                 case 'DatetimeValue':
                     return QQN::AttributeValue()->DatetimeValue;
                 case 'TextValue':
                     return QQN::AttributeValue()->TextValue;
                 case 'BooleanValue':
                     return QQN::AttributeValue()->BooleanValue;
                 case 'SingleAttributeOptionId':
                     return QQN::AttributeValue()->SingleAttributeOptionId;
                 case 'SingleAttributeOption':
                     return QQN::AttributeValue()->SingleAttributeOption;
                 default:
                     throw new QCallerException('Simple Property not found in AttributeValueDataGrid 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,代码行数:69,代码来源:AttributeValueDataGridGen.class.php

示例5: CalculateAttributeStatistics

function CalculateAttributeStatistics($objMembershipArray, $iTotalCount)
{
    $iEthnicity = array();
    $iFromPreviousChurch = 0;
    $iSalvationDate = array('Not Specified' => 0, 'Ten Years' => 0, 'Twenty Years' => 0, 'Thirty Years' => 0, 'Forty Years' => 0, 'Fifty Years Or More' => 0);
    $iMaritalStatus = array('Not Specified' => 0, 'Single' => 0, 'Married' => 0, 'Separated' => 0);
    $iAgeStatus = array('Not Specified' => 0, '0-10 Years Old' => 0, '10-20  Years Old' => 0, '20-30 Years Old' => 0, '30-40 Years Old' => 0, '40-50 Years Old' => 0, '50-60 Years Old' => 0, '60+ Years Old' => 0);
    foreach ($objMembershipArray as $objMembership) {
        $objPerson = $objMembership->Person;
        switch ($objPerson->MaritalStatusTypeId) {
            case MaritalStatusType::NotSpecified:
                $iMaritalStatus['Not Specified']++;
                break;
            case MaritalStatusType::Single:
                $iMaritalStatus['Single']++;
                break;
            case MaritalStatusType::Married:
                $iMaritalStatus['Married']++;
                break;
            case MaritalStatusType::Separated:
                $iMaritalStatus['Separated']++;
                break;
            default:
                $iMaritalStatus['Not Specified']++;
        }
        $iAge = $objPerson->Age;
        if ($iAge != null) {
            if ($iAge < 10) {
                $iAgeStatus['0-10 Years Old']++;
            } elseif ($iAge < 20) {
                $iAgeStatus['10-20  Years Old']++;
            } elseif ($iAge < 30) {
                $iAgeStatus['20-30 Years Old']++;
            } elseif ($iAge < 40) {
                $iAgeStatus['30-40 Years Old']++;
            } elseif ($iAge < 50) {
                $iAgeStatus['40-50 Years Old']++;
            } elseif ($iAge < 60) {
                $iAgeStatus['50-60 Years Old']++;
            } else {
                $iAgeStatus['60+ Years Old']++;
            }
        } else {
            $iAgeStatus['Not Specified']++;
        }
        $attributeArray = $objPerson->GetAttributeValueArray(QQ::OrderBy(QQN::AttributeValue()->Attribute->Name));
        foreach ($attributeArray as $objAttribute) {
            if ($objAttribute->Attribute->Name == 'Ethnicity') {
                if (array_key_exists($objAttribute->SingleAttributeOption->Name, $iEthnicity)) {
                    $iEthnicity[$objAttribute->SingleAttributeOption->Name]++;
                } else {
                    $iEthnicity[$objAttribute->SingleAttributeOption->Name] = 1;
                }
            }
            if ($objAttribute->Attribute->Name == 'Previous Church') {
                $iFromPreviousChurch++;
            }
            if ($objAttribute->Attribute->Name == 'Date Accepted Christ') {
                $dtsValue = $objAttribute->DateValue->Difference(QDateTime::Now());
                if ($dtsValue->IsNegative()) {
                    $intYear = abs($dtsValue->Years);
                    if ($intYear < 10) {
                        $iSalvationDate['Ten Years']++;
                    } elseif ($intYear < 20) {
                        $iSalvationDate['Twenty Years']++;
                    } elseif ($intYear < 30) {
                        $iSalvationDate['Thirty Years']++;
                    } elseif ($intYear < 40) {
                        $iSalvationDate['Forty Years']++;
                    } else {
                        $iSalvationDate['Fifty Years Or More']++;
                    }
                }
            }
        }
    }
    ksort($iEthnicity);
    $iSalvationDate['Not Specified'] = $iTotalCount - array_sum($iSalvationDate);
    // Now print it all out
    print "Total New Members From Other Churches:" . $iFromPreviousChurch . "\r\n";
    print "Salvation Date Statistics - New Member has been a Christian for:\r\n";
    foreach ($iSalvationDate as $key => $value) {
        print $key . ': ,' . $value . "\r\n";
    }
    print "Marital Statistics:\r\n";
    foreach ($iMaritalStatus as $key => $value) {
        print $key . ': ,' . $value . "\r\n";
    }
    print "Age Statistics:\r\n";
    foreach ($iAgeStatus as $key => $value) {
        print $key . ': ,' . $value . "\r\n";
    }
    print "Ethnicity BreakDown:\r\n";
    foreach ($iEthnicity as $key => $value) {
        print $key . ': ,' . $value . "\r\n";
    }
}
开发者ID:alcf,项目名称:chms,代码行数:97,代码来源:export_to_excel.php

示例6: IsAttributeOptionAsMultipleAssociated

 /**
  * Checks to see if an association exists with a specific AttributeOptionAsMultiple
  * @param AttributeOption $objAttributeOption
  * @return bool
  */
 public function IsAttributeOptionAsMultipleAssociated(AttributeOption $objAttributeOption)
 {
     if (is_null($this->intId)) {
         throw new QUndefinedPrimaryKeyException('Unable to call IsAttributeOptionAsMultipleAssociated on this unsaved AttributeValue.');
     }
     if (is_null($objAttributeOption->Id)) {
         throw new QUndefinedPrimaryKeyException('Unable to call IsAttributeOptionAsMultipleAssociated on this AttributeValue with an unsaved AttributeOption.');
     }
     $intRowCount = AttributeValue::QueryCount(QQ::AndCondition(QQ::Equal(QQN::AttributeValue()->Id, $this->intId), QQ::Equal(QQN::AttributeValue()->AttributeOptionAsMultiple->AttributeOptionId, $objAttributeOption->Id)));
     return $intRowCount > 0;
 }
开发者ID:alcf,项目名称:chms,代码行数:16,代码来源:AttributeValueGen.class.php

示例7: InitializeArray

 protected function InitializeArray()
 {
     $iAfricanAmerican = $iAfricanAmericanNative = $iAfricanAmericanItalian = $iAfricanAmericanCaucasian = 0;
     $iAsian = $iBrazilian = $iBritish = $iCaucasian = $iChinese = 0;
     $iChineseAmerican = $iEthiopian = $iFilipino = $iFilipinoPuertoRican = $iGreek = 0;
     $iHawaiian = $iHispanic = $iHispanicBrazilian = $iHispanicLatino = $iIndian = 0;
     $iJapanese = $iJapaneseCaucasian = $iKoreanAmerican = $iLatino = 0;
     $iMiddleEastern = $iPolynesian = $iSamoan = $iSpanish = $iSriLankan = $iSwiss = 0;
     $iTongan = $iVietnamese = $iOther = $iNigerian = 0;
     $iTotalEthnicCount = 0;
     $objPersonArray = Person::LoadArrayBy2016Attribute();
     $this->iTotalPersonCount = count($objPersonArray);
     foreach ($objPersonArray as $objPerson) {
         $attributeArray = $objPerson->GetAttributeValueArray(QQ::OrderBy(QQN::AttributeValue()->Attribute->Name));
         foreach ($attributeArray as $objAttribute) {
             if ($objAttribute->Attribute->Name == 'Ethnicity') {
                 $iTotalEthnicCount++;
                 switch ($objAttribute->SingleAttributeOption->Name) {
                     case "African American":
                         $iAfricanAmerican++;
                         break;
                     case "African American/Native American":
                         $iAfricanAmericanNative++;
                         break;
                     case "African America/Italian":
                         $iAfricanAmericanItalian++;
                         break;
                     case "African America/Caucasian":
                         $iAfricanAmericanCaucasian++;
                         break;
                     case "Asian":
                         $iAsian++;
                         break;
                     case "Brazilian":
                         $iBrazilian++;
                         break;
                     case "British":
                         $iBritish++;
                         break;
                     case "Caucasian":
                         $iCaucasian++;
                         break;
                     case "Chinese":
                         $iChinese++;
                         break;
                     case "Chinese American":
                         $iChineseAmerican++;
                         break;
                     case "Ethiopian":
                         $iEthiopian++;
                         break;
                     case "Filipino":
                         $iFilipino++;
                         break;
                     case "Filipino/Puerto Rican":
                         $iFilipinoPuertoRican++;
                         break;
                     case "Greek":
                         $iGreek++;
                         break;
                     case "Hawaiian":
                         $iHawaiian++;
                         break;
                     case "Hispanic":
                         $iHispanic++;
                         break;
                     case "Hispanic/Brazilian":
                         $iHispanicBrazilian++;
                         break;
                     case "Hispanic/Latino":
                         $iHispanicLatino++;
                         break;
                     case "Indian":
                         $iIndian++;
                         break;
                     case "Japanese":
                         $iJapanese++;
                         break;
                     case "Japanese/Caucasian":
                         $iJapaneseCaucasian++;
                         break;
                     case "Korean-American":
                         $iKoreanAmerican++;
                         break;
                     case "Latino":
                         $iLatino++;
                         break;
                     case "Middle Eastern":
                         $iMiddleEastern++;
                         break;
                     case "Polynesian":
                         $iPolynesian++;
                         break;
                     case "Samoan":
                         $iSamoan++;
                         break;
                     case "Spanish":
                         $iSpanish++;
                         break;
                     case "Sri Lankan":
//.........这里部分代码省略.........
开发者ID:alcf,项目名称:chms,代码行数:101,代码来源:churchEthnicity.php


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