| @@ 489-504 (lines=16) @@ | ||
| 486 | * |
|
| 487 | * @throws \InvalidArgumentException if $extras has invalid elements |
|
| 488 | */ |
|
| 489 | public function setConfigExtras(array $extras) |
|
| 490 | { |
|
| 491 | foreach ($extras as $configExtra) { |
|
| 492 | if (!$configExtra instanceof ConfigExtraInterface) { |
|
| 493 | throw new \InvalidArgumentException( |
|
| 494 | 'Expected an array of "Oro\Bundle\ApiBundle\Config\ConfigExtraInterface".' |
|
| 495 | ); |
|
| 496 | } |
|
| 497 | } |
|
| 498 | ||
| 499 | if (empty($extras)) { |
|
| 500 | $this->remove(self::CONFIG_EXTRAS); |
|
| 501 | } else { |
|
| 502 | $this->set(self::CONFIG_EXTRAS, $extras); |
|
| 503 | } |
|
| 504 | } |
|
| 505 | ||
| 506 | /** |
|
| 507 | * Checks whether some configuration data is requested. |
|
| @@ 616-631 (lines=16) @@ | ||
| 613 | * |
|
| 614 | * @throws \InvalidArgumentException if $extras has invalid elements |
|
| 615 | */ |
|
| 616 | public function setMetadataExtras(array $extras) |
|
| 617 | { |
|
| 618 | foreach ($extras as $configExtra) { |
|
| 619 | if (!$configExtra instanceof MetadataExtraInterface) { |
|
| 620 | throw new \InvalidArgumentException( |
|
| 621 | 'Expected an array of "Oro\Bundle\ApiBundle\Metadata\MetadataExtraInterface".' |
|
| 622 | ); |
|
| 623 | } |
|
| 624 | } |
|
| 625 | ||
| 626 | if (empty($extras)) { |
|
| 627 | $this->remove(self::METADATA_EXTRAS); |
|
| 628 | } else { |
|
| 629 | $this->set(self::METADATA_EXTRAS, $extras); |
|
| 630 | } |
|
| 631 | } |
|
| 632 | ||
| 633 | /** |
|
| 634 | * Checks whether some additional metadata info is requested. |
|