| @@ 54-68 (lines=15) @@ | ||
| 51 | * |
|
| 52 | * @param Metadata $metadata Entity metadata |
|
| 53 | */ |
|
| 54 | protected function createConstructor(Metadata $metadata) |
|
| 55 | { |
|
| 56 | $class = "\n\t".'/**'; |
|
| 57 | $class .= "\n\t".' * @param ViewInterface $renderer Rendering instance'; |
|
| 58 | $class .= "\n\t" . ' * @param QueryInterface $query Database query instance'; |
|
| 59 | $class .= "\n\t".' * @param string $locale Localization identifier'; |
|
| 60 | $class .= "\n\t".' */'; |
|
| 61 | $class .= "\n\t" . 'public function __construct(ViewInterface $renderer, QueryInterface $query = null, $locale = null)'; |
|
| 62 | $class .= "\n\t".'{'; |
|
| 63 | $class .= "\n\t\t" . '$this->renderer = $renderer;'; |
|
| 64 | $class .= "\n\t\t" . 'parent::__construct(isset($query) ? $query : new dbQuery(), $locale);'; |
|
| 65 | $class .= "\n\t".'}'; |
|
| 66 | ||
| 67 | $this->generator->text($class); |
|
| 68 | } |
|
| 69 | } |
|
| 70 | //[PHPCOMPRESSOR(remove,end)] |
|
| 71 | ||
| @@ 415-429 (lines=15) @@ | ||
| 412 | /** |
|
| 413 | * Generate constructor for collection class. |
|
| 414 | */ |
|
| 415 | protected function generateConstructorCollectionClass() |
|
| 416 | { |
|
| 417 | $class = "\n\t".'/**'; |
|
| 418 | $class .= "\n\t".' * @param ViewInterface $renderer Rendering instance'; |
|
| 419 | $class .= "\n\t" . ' * @param QueryInterface $query Database query instance'; |
|
| 420 | $class .= "\n\t".' * @param string $locale Localization identifier'; |
|
| 421 | $class .= "\n\t".' */'; |
|
| 422 | $class .= "\n\t" . 'public function __construct(ViewInterface $renderer, QueryInterface $query = null, $locale = null)'; |
|
| 423 | $class .= "\n\t".'{'; |
|
| 424 | $class .= "\n\t\t" . '$this->renderer = $renderer;'; |
|
| 425 | $class .= "\n\t\t" . 'parent::__construct(isset($query) ? $query : new dbQuery(), $locale);'; |
|
| 426 | $class .= "\n\t".'}'."\n"; |
|
| 427 | ||
| 428 | return $class; |
|
| 429 | } |
|
| 430 | ||
| 431 | /** |
|
| 432 | * Generate classes for entity additional field gallery. |
|
| @@ 596-611 (lines=16) @@ | ||
| 593 | /** |
|
| 594 | * Generate constructor for table class. |
|
| 595 | */ |
|
| 596 | protected function generateConstructorTableClass() |
|
| 597 | { |
|
| 598 | $class = "\n\t" . '/**'; |
|
| 599 | $class .= "\n\t" . ' * @param QueryInterface $query Database query instance'; |
|
| 600 | $class .= "\n\t" . ' * @param ViewInterface $renderer Rendering instance'; |
|
| 601 | $class .= "\n\t" . ' * @param integer $entityID Entity identifier to whom this table belongs'; |
|
| 602 | $class .= "\n\t" . ' * @param string $locale Localization identifier'; |
|
| 603 | $class .= "\n\t" . ' */'; |
|
| 604 | $class .= "\n\t" . 'public function __construct(QueryInterface $query, ViewInterface $renderer, $entityID, $locale = null)'; |
|
| 605 | $class .= "\n\t" . '{'; |
|
| 606 | $class .= "\n\t\t" . '$this->renderer = $renderer;'; |
|
| 607 | $class .= "\n\t\t" . 'parent::__construct($query, static::$navigationIDs, $entityID, $locale);'; |
|
| 608 | $class .= "\n\t" . '}' . "\n"; |
|
| 609 | ||
| 610 | return $class; |
|
| 611 | } |
|
| 612 | ||
| 613 | /** |
|
| 614 | * Generate constructor for table query class. |
|
| @@ 616-629 (lines=14) @@ | ||
| 613 | /** |
|
| 614 | * Generate constructor for table query class. |
|
| 615 | */ |
|
| 616 | protected function generateConstructorTableQueryClass() |
|
| 617 | { |
|
| 618 | $class = "\n\t" . '/**'; |
|
| 619 | $class .= "\n\t" . ' * @param int $entityID Entity identifier to whom this table belongs'; |
|
| 620 | $class .= "\n\t" . ' * @param QueryInterface $query Database query instance'; |
|
| 621 | $class .= "\n\t" . ' * @param string $locale Localization identifier'; |
|
| 622 | $class .= "\n\t" . ' */'; |
|
| 623 | $class .= "\n\t" . 'public function __construct($entityID, QueryInterface $query, $locale = null)'; |
|
| 624 | $class .= "\n\t" . '{'; |
|
| 625 | $class .= "\n\t\t" . 'parent::__construct(static::$navigationIDs, $entityID, $query, $locale);'; |
|
| 626 | $class .= "\n\t" . '}' . "\n"; |
|
| 627 | ||
| 628 | return $class; |
|
| 629 | } |
|
| 630 | ||
| 631 | /** |
|
| 632 | * Generate Query::where() analog for specific field. |
|