| @@ 84-97 (lines=14) @@ | ||
| 81 | * |
|
| 82 | * @return $this |
|
| 83 | */ |
|
| 84 | public function cascade(array $cascade) |
|
| 85 | { |
|
| 86 | foreach ($cascade as $name) { |
|
| 87 | $method = 'cascade' . studly_case(strtolower($name)); |
|
| 88 | ||
| 89 | if (!method_exists($this->association, $method)) { |
|
| 90 | throw new InvalidArgumentException('Cascade [' . $name . '] does not exist'); |
|
| 91 | } |
|
| 92 | ||
| 93 | $this->{$method}(); |
|
| 94 | } |
|
| 95 | ||
| 96 | return $this; |
|
| 97 | } |
|
| 98 | ||
| 99 | /** |
|
| 100 | * @param string $strategy one of "LAZY", "EAGER", "EXTRA_LAZY" |
|
| @@ 104-115 (lines=12) @@ | ||
| 101 | * |
|
| 102 | * @return $this |
|
| 103 | */ |
|
| 104 | public function fetch($strategy) |
|
| 105 | { |
|
| 106 | $method = 'fetch' . studly_case(strtolower($strategy)); |
|
| 107 | ||
| 108 | if (!method_exists($this->association, $method)) { |
|
| 109 | throw new InvalidArgumentException('Fetch [' . $strategy . '] does not exist'); |
|
| 110 | } |
|
| 111 | ||
| 112 | $this->{$method}(); |
|
| 113 | ||
| 114 | return $this; |
|
| 115 | } |
|
| 116 | ||
| 117 | /** |
|
| 118 | * @return ClassMetadataBuilder |
|