| @@ 82-91 (lines=10) @@ | ||
| 79 | return !empty($this->owner->parent); |
|
| 80 | } |
|
| 81 | ||
| 82 | private function attachRelations() |
|
| 83 | {
|
|
| 84 | $this->owner->getMetaData()->addRelation('modifications', array(
|
|
| 85 | BActiveRecord::HAS_MANY, 'BProduct', array('parent' => 'id'),
|
|
| 86 | )); |
|
| 87 | ||
| 88 | $this->owner->getMetaData()->addRelation('parentModel', array(
|
|
| 89 | BActiveRecord::HAS_ONE, 'BProduct', array('id' => 'parent'),
|
|
| 90 | )); |
|
| 91 | } |
|
| 92 | ||
| 93 | protected function onAfterRenderTableRow(CEvent $event) |
|
| 94 | {
|
|
| @@ 21-32 (lines=12) @@ | ||
| 18 | {
|
|
| 19 | private $child; |
|
| 20 | ||
| 21 | public function init() |
|
| 22 | {
|
|
| 23 | parent::init(); |
|
| 24 | ||
| 25 | $this->owner->getMetaData()->addRelation('modifications', array(
|
|
| 26 | FActiveRecord::HAS_MANY, 'Product', array('parent' => 'id'),
|
|
| 27 | )); |
|
| 28 | ||
| 29 | $this->owner->getMetaData()->addRelation('parentModel', array(
|
|
| 30 | FActiveRecord::HAS_ONE, 'Product', array('id' => 'parent'),
|
|
| 31 | )); |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * @return bool |
|