コード例 #1
0
ファイル: QcodoClass.class.php プロジェクト: qcodo/qcodo-api
 protected function AggregatePropertyArray(QcodoClass $objClass, $blnIsRootChild)
 {
     $objProperties = $objClass->GetClassPropertyArray(QQ::Clause(QQ::Expand(QQN::ClassProperty()->Variable)));
     foreach ($objProperties as $objProperty) {
         if ($blnIsRootChild) {
             $objProperty->InheritenceState = InheritenceState::RootChild;
             $this->objPropertyArray[$objProperty->Variable->Name] = $objProperty;
         } else {
             if (array_key_exists($objProperty->Variable->Name, $this->objPropertyArray)) {
                 // The Property already exists, younger in the array
                 if ($this->objPropertyArray[$objProperty->Variable->Name]->InheritenceState == InheritenceState::RootChild) {
                     // This means the Property in the array overrides
                     $this->objPropertyArray[$objProperty->Variable->Name]->InheritenceState = InheritenceState::Overrides;
                     $this->objPropertyArray[$objProperty->Variable->Name]->OverridesProperty = $objProperty;
                 }
             } else {
                 // The Property doesn't yet exist in the array
                 // So therefore, this class inherits the Property
                 $objProperty->InheritenceState = InheritenceState::Interited;
                 $this->objPropertyArray[$objProperty->Variable->Name] = $objProperty;
             }
         }
     }
     if ($objClass->ParentQcodoClassId) {
         $this->AggregatePropertyArray($objClass->ParentQcodoClass, false);
     }
 }