コード例 #1
0
 /**
  * Returns the relations used for the model
  *
  * @return array
  * @see YdDressing::modelMap
  */
 public function relations()
 {
     if (!empty(Yii::app()->dressing->modelMap[get_class($this)]['relations'])) {
         return Yii::app()->dressing->modelMap[get_class($this)]['relations'];
     }
     return parent::relations();
 }
コード例 #2
0
ファイル: Webservice.php プロジェクト: bruno-melo/components
 /**
  * @param CActiveRecord $model
  * */
 private static function Model2ArrayRec($model)
 {
     $data = $model->attributes;
     //Levantando relacionamentos
     $rels = $model->relations();
     foreach ($rels as $relation => $params) {
         //Irá gerar um vetor com todos os relacionamentos
         if ($model->hasRelated($relation)) {
             $data[$relation] = self::relations2Array($model, $relation);
         }
     }
     return $data;
 }
コード例 #3
0
 /**
  * Recursive function that deletes all children models to the $model.
  * 
  * @param CActiveRecord $model the model to process.
  * @param boolean $delete whether to delete the $model (the top model's deletion is handled by beforeDelete).
  */
 protected function processModel($model, $delete = true)
 {
     foreach ($model->relations() as $relationName => $relation) {
         $type = $relation[0];
         $className = $relation[1];
         $foreignKey = $relation[2];
         if ($type == CActiveRecord::HAS_MANY) {
             foreach ($model->{$relationName} as $subModel) {
                 if (!empty($subModel)) {
                     $this->processModel($subModel);
                 }
             }
         } elseif ($type == CActiveRecord::HAS_ONE) {
             if (!empty($model->{$relationName})) {
                 $this->processModel($model->{$relationName});
             }
         }
     }
     if ($delete) {
         $model->delete();
     }
 }
コード例 #4
0
 public function relations()
 {
     return array_merge(parent::relations(), array('fiitFinv' => array(self::BELONGS_TO, 'FinvInvoice', 'fiit_finv_id'), 'fiitFprc' => array(self::BELONGS_TO, 'FprcProductCategory', 'fiit_fprc_id'), 'fiitFqnt' => array(self::BELONGS_TO, 'FqntQuantity', 'fiit_fqnt_id'), 'fiitFvat' => array(self::BELONGS_TO, 'FvatVat', 'fiit_fvat_id'), 'fixrFiitXRefs' => array(self::HAS_MANY, 'FixrFiitXRef', 'fixr_fiit_id')));
 }
コード例 #5
0
 public function relations()
 {
     return array_merge(parent::relations(), array('tsthTstt' => array(self::BELONGS_TO, 'TsttStatus', 'tsth_tstt_id'), 'tsthPprs' => array(self::BELONGS_TO, 'PprsPerson', 'tsth_pprs_id'), 'tsthTtsk' => array(self::BELONGS_TO, 'TtskTask', 'tsth_ttsk_id')));
 }
コード例 #6
0
 public function relations()
 {
     return array_merge(parent::relations(), array('vtdcVtdt' => array(self::BELONGS_TO, 'VtdtTruckDocType', 'vtdc_vtdt_id'), 'vtdcVtrc' => array(self::BELONGS_TO, 'VtrcTruck', 'vtdc_vtrc_id'), 'vtdcFixr' => array(self::BELONGS_TO, 'FixrFiitXRef', 'vtdc_fixr_id')));
 }
コード例 #7
0
 public function relations()
 {
     return array_merge(parent::relations(), array('ccdpCcmp' => array(self::BELONGS_TO, 'CcmpCompany', 'ccdp_ccmp_id')));
 }
コード例 #8
0
 public function relations()
 {
     return array_merge(parent::relations(), array('vtlsTrailerServices' => array(self::HAS_MANY, 'VtlsTrailerService', 'vtls_vtrl_id'), 'vtrdTrailerDocs' => array(self::HAS_MANY, 'VtrdTrailerDoc', 'vtrd_vtrl_id'), 'vtrlVtrt' => array(self::BELONGS_TO, 'VtrtTrailerType', 'vtrl_vtrt_id'), 'vtrlCcmp' => array(self::BELONGS_TO, 'CcmpCompany', 'vtrl_ccmp_id'), 'vvoyVoyages' => array(self::HAS_MANY, 'VvoyVoyage', 'vvoy_vtrl_id')));
 }
コード例 #9
0
 public function relations()
 {
     return array_merge(parent::relations(), array('tcmnCommunications' => array(self::HAS_MANY, 'TcmnCommunication', 'tcmn_tmed_id')));
 }
コード例 #10
0
 /**
  * Returns the relations used for the model
  * @return array
  * @see AccountModule::modelMap
  */
 public function relations()
 {
     /** @var AccountModule $account */
     $account = Yii::app()->getModule('account');
     if (!empty($account->modelMap[get_class($this)]['relations'])) {
         return $account->modelMap[get_class($this)]['relations'];
     }
     return parent::relations();
 }
コード例 #11
0
 public function relations()
 {
     return array_merge(parent::relations(), array('fddaDimDatas' => array(self::HAS_MANY, 'FddaDimData', 'fdda_fdm2_id'), 'fddpDimDataPeriods' => array(self::HAS_MANY, 'FddpDimDataPeriod', 'fddp_fdm2_id'), 'fdm2Fret' => array(self::BELONGS_TO, 'FretRefType', 'fdm2_fret_id'), 'fdm2Fdm1' => array(self::BELONGS_TO, 'Fdm1Dimension1', 'fdm2_fdm1_id'), 'fdm3Dimension3s' => array(self::HAS_MANY, 'Fdm3Dimension3', 'fdm3_fdm2_id'), 'fdspDimensionSplits' => array(self::HAS_MANY, 'FdspDimensionSplit', 'fdsp_fdm2_id'), 'vdimDimensions' => array(self::HAS_MANY, 'VdimDimension', 'vdim_fdm2_id'), 'vpdmPlaningDimensions' => array(self::HAS_MANY, 'VpdmPlaningDimension', 'vpdm_fdm2_id')));
 }
コード例 #12
0
ファイル: BaseAuthitem.php プロジェクト: uldisn/yii-user
 public function relations()
 {
     return array_merge(parent::relations(), array('authassignments' => array(self::HAS_MANY, 'Authassignment', 'itemname'), 'authitemchildren' => array(self::HAS_MANY, 'Authitemchild', 'child'), 'authitemchildren1' => array(self::HAS_MANY, 'Authitemchild', 'parent'), 'rights' => array(self::HAS_MANY, 'Rights', 'itemname'), 'stfaFlowAccesses' => array(self::HAS_MANY, 'StfaFlowAccess', 'stfa_authitem')));
 }
コード例 #13
0
 public function relations()
 {
     return array_merge(parent::relations(), array('ppxtPersonXTypes' => array(self::HAS_MANY, 'PpxtPersonXType', 'ppxt_ptyp_id')));
 }
コード例 #14
0
 /**
  * Returns the relations used for the model
  *
  * @return array
  * @see AuditModule::modelMap
  */
 public function relations()
 {
     $audit = Yii::app()->getModule('audit');
     if (!empty($audit->modelMap[get_class($this)]['relations'])) {
         return $audit->modelMap[get_class($this)]['relations'];
     }
     return parent::relations();
 }
コード例 #15
0
 /**
  * Returns the relations used for the model
  *
  * @return array
  * @see MenuModule::modelMap
  */
 public function relations()
 {
     $menu = Yii::app()->getModule('menu');
     if (!empty($menu->modelMap[get_class($this)]['relations'])) {
         return $menu->modelMap[get_class($this)]['relations'];
     }
     return parent::relations();
 }
コード例 #16
0
 public function relations()
 {
     return array_merge(parent::relations(), array('vtrsFixr' => array(self::BELONGS_TO, 'FixrFiitXRef', 'vtrs_fixr_id'), 'vtrsVtrc' => array(self::BELONGS_TO, 'VtrcTruck', 'vtrs_vtrc_id'), 'vtrsVsrv' => array(self::BELONGS_TO, 'VsrvServices', 'vtrs_vsrv_id')));
 }
コード例 #17
0
 public function relations()
 {
     return array_merge(parent::relations(), array('ccucUserCompanies' => array(self::HAS_MANY, 'CcucUserCompany', 'ccuc_cucp_id')));
 }
コード例 #18
0
 public function relations()
 {
     return array_merge(parent::relations(), array('ppxsPersonXSettings' => array(self::HAS_MANY, 'PpxsPersonXSetting', 'ppxs_psty_id')));
 }
コード例 #19
0
 public function relations()
 {
     return array_merge(parent::relations(), array('fpeoPeriodOdos' => array(self::HAS_MANY, 'FpeoPeriodOdo', 'fpeo_vodo_id'), 'vodoVtrc' => array(self::BELONGS_TO, 'VtrcTruck', 'vodo_vtrc_id')));
 }
コード例 #20
0
 public function relations()
 {
     return array_merge(parent::relations(), array('ecntContainers' => array(self::HAS_MANY, 'EcntContainer', 'ecnt_etpr_id')));
 }
コード例 #21
0
 public function relations()
 {
     return array_merge(parent::relations(), array('variants' => array(self::HAS_MANY, 'EavVariant', 'attribute_id', 'order' => 'variants.title'), 'activeVariants' => array(self::HAS_MANY, 'EavVariant', 'attribute_id', 'order' => 'activeVariants.title', 'scopes' => 'active'), 'existingVariants' => array(self::HAS_MANY, 'EavVariant', 'attribute_id', 'join' => 'LEFT JOIN {{eav_attribute_value}} `av` ON `existingVariants`.`id` = `av`.`variant_value`', 'condition' => '`av`.`variant_value` IS NOT NULL', 'order' => '`existingVariants`.`title`', 'scopes' => 'active'), 'variantsCount' => array(self::STAT, 'EavVariant', 'attribute_id')));
 }
コード例 #22
0
 public function relations()
 {
     return array_merge(parent::relations(), array('fixrFiitXRefs' => array(self::HAS_MANY, 'FixrFiitXRef', 'fixr_period_fret_id')));
 }
コード例 #23
0
ファイル: BasePerson.php プロジェクト: dbrisinajumi/person
 public function relations()
 {
     return array_merge(parent::relations(), array('ccucUserCompanies' => array(self::HAS_MANY, 'CcucUserCompany', 'ccuc_person_id'), 'user' => array(self::BELONGS_TO, 'User', 'user_id')));
 }
コード例 #24
0
 public function relations()
 {
     return array_merge(parent::relations(), array('itemname0' => array(self::BELONGS_TO, 'Authitem', 'itemname')));
 }
コード例 #25
0
 public function relations()
 {
     return array_merge(parent::relations(), array('ppxtPtyp' => array(self::BELONGS_TO, 'PtypType', 'ppxt_ptyp_id'), 'ppxtPprs' => array(self::BELONGS_TO, 'PprsPerson', 'ppxt_pprs_id')));
 }
コード例 #26
0
 public function relations()
 {
     return array_merge(parent::relations(), array('vtrdFixr' => array(self::BELONGS_TO, 'FixrFiitXRef', 'vtrd_fixr_id'), 'vtrdVtdt' => array(self::BELONGS_TO, 'VtdtTruckDocType', 'vtrd_vtdt_id'), 'vtrdVtrl' => array(self::BELONGS_TO, 'VtrlTrailer', 'vtrd_vtrl_id')));
 }
コード例 #27
0
 public function relations()
 {
     return array_merge(parent::relations(), array('fddpDimDataPeriods' => array(self::HAS_MANY, 'FddpDimDataPeriod', 'fddp_fdpe_id')));
 }
コード例 #28
0
 public function relations()
 {
     return array_merge(parent::relations(), array('tcmnTtsk' => array(self::BELONGS_TO, 'TtskTask', 'tcmn_ttsk_id'), 'tcmnPprs' => array(self::BELONGS_TO, 'PprsPerson', 'tcmn_pprs_id'), 'tcmnClientPprs' => array(self::BELONGS_TO, 'PprsPerson', 'tcmn_client_pprs_id'), 'tcmnTcst' => array(self::BELONGS_TO, 'TcstCommunicationStatus', 'tcmn_tcst_id'), 'tcmnTmed' => array(self::BELONGS_TO, 'TmedMedia', 'tcmn_tmed_id'), 'tcshComminicationStatusHistories' => array(self::HAS_MANY, 'TcshComminicationStatusHistory', 'tcsh_tcmn_id')));
 }
コード例 #29
0
ファイル: BasePfOrderItems.php プロジェクト: uldisn/ldm
 public function relations()
 {
     return array_merge(parent::relations(), array('pfOrderItemNotes' => array(self::HAS_MANY, 'PfOrderItemNotes', 'order_item_id'), 'order' => array(self::BELONGS_TO, 'PfOrder', 'order_id'), 'manufakturerCcmp' => array(self::BELONGS_TO, 'CcmpCompany', 'manufakturer_ccmp_id')));
 }
コード例 #30
0
 public function relations()
 {
     return array_merge(parent::relations(), array('ecntContainer' => array(self::HAS_MANY, 'EcntContainer', 'cctc_code')));
 }