Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @return yiidbActiveQuery
- */
- public function getComplexDocument()
- {
- return $this->hasMany(ComplexDocument::className(), ['complex_id' => 'id']);
- }
- /**
- * @return yiidbActiveQuery
- */
- public function getDocuments()
- {
- return $this->hasMany(Documents::className(), ['id' => 'document_id'])
- ->via('complexDocument');
- }
- public function beforeDelete()
- {
- foreach ($this->documents as $document){
- var_dump($document);
- }
- return parent::beforeDelete();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement