コード例 #1
0
ファイル: ServicesRecord.php プロジェクト: ivphpan/gwm
 public function getParts($withChild = false)
 {
     $result = $this->hasMany(ServicesPartsRecord::className(), ['serviceId' => 'id', 'lang' => 'lang'])->position();
     if (!$withChild) {
         $result->andWhere(['parentId' => 0]);
     }
     return $result;
 }
コード例 #2
0
ファイル: ServicesPartsRecord.php プロジェクト: ivphpan/gwm
 public function getChilds()
 {
     return $this->hasMany(ServicesPartsRecord::className(), ['parentId' => 'id', 'lang' => 'lang'])->position();
 }