File tree Expand file tree Collapse file tree 1 file changed +2
-48
lines changed Expand file tree Collapse file tree 1 file changed +2
-48
lines changed Original file line number Diff line number Diff line change 2121 */
2222class Container extends Nette \ComponentModel \Container implements \ArrayAccess
2323{
24+ use Nette \ComponentModel \ArrayAccess;
25+
2426 /** @var callable[] function (Container $sender); Occurs when the form is validated */
2527 public $ onValidate ;
2628
@@ -434,54 +436,6 @@ public static function extensionMethod($name, /*callable*/ $callback): void
434436 }
435437
436438
437- /********************* interface \ArrayAccess ****************d*g**/
438-
439-
440- /**
441- * Adds the component to the container.
442- * @param string|int
443- * @param Nette\ComponentModel\IComponent
444- */
445- public function offsetSet ($ name , $ component ): void
446- {
447- $ this ->addComponent ($ component , $ name );
448- }
449-
450-
451- /**
452- * Returns component specified by name. Throws exception if component doesn't exist.
453- * @param string|int
454- * @throws Nette\InvalidArgumentException
455- */
456- public function offsetGet ($ name ): Nette \ComponentModel \IComponent
457- {
458- return $ this ->getComponent ($ name , true );
459- }
460-
461-
462- /**
463- * Does component specified by name exists?
464- * @param string|int
465- */
466- public function offsetExists ($ name ): bool
467- {
468- return $ this ->getComponent ($ name , false ) !== null ;
469- }
470-
471-
472- /**
473- * Removes component from the container.
474- * @param string|int
475- */
476- public function offsetUnset ($ name ): void
477- {
478- $ component = $ this ->getComponent ($ name , false );
479- if ($ component !== null ) {
480- $ this ->removeComponent ($ component );
481- }
482- }
483-
484-
485439 /**
486440 * Prevents cloning.
487441 */
You can’t perform that action at this time.
0 commit comments