PhpExt : [ class tree ] [ index ] [ all elements ]

Source for file ComponentCollection.php

Documentation is available at ComponentCollection.php

  1. <?php
  2. /**
  3.  * PHP-Ext Library
  4.  * http://php-ext.googlecode.com
  5.  * @author Sergei Walter <sergeiw[at]gmail[dot]com>
  6.  * @copyright 2008 Sergei Walter
  7.  * @license http://www.gnu.org/licenses/lgpl.html
  8.  * @link http://php-ext.googlecode.com
  9.  * 
  10.  *  Reference for Ext JS: http://extjs.com
  11.  * 
  12.  */
  13. /**
  14.  * @see PhpExt_AbstractCollection
  15.  */
  16. include_once 'PhpExt/AbstractCollection.php';
  17. /**
  18.  * @see PhpExt_Component
  19.  */
  20. include_once 'PhpExt/Component.php';
  21.  
  22.  
  23. /**
  24.  * Provides functionality to manage a PhpExt_Component Collection
  25.  * 
  26.  * @package PhpExt
  27.  */
  28. {
  29.     protected $_owner;
  30.     
  31.     public function getOwner({
  32.         return $this->_owner;
  33.     }
  34.     
  35.     public function __construct($owner$collection array()) {
  36.         parent::__construct($collection);
  37.         $this->_owner = $owner;            
  38.     }
  39.     
  40.     
  41.     
  42.     /**
  43.      * Adds a PhpExt_Component to the Collection
  44.      *
  45.      * @param PhpExt_Component $object 
  46.      * @param string $name 
  47.      * @return int the index of the new element
  48.      */
  49.     public function add(PhpExt_Component $object$name null{
  50.         $object->setOwnerCollection($this);
  51.         return $this->addObject($object$name);
  52.     }
  53.     
  54.     /**
  55.      * Gets the Component with the key specified by $name
  56.      *
  57.      * @param string $name 
  58.      * @return PhpExt_Component 
  59.      */
  60.     public function getByName($name{
  61.         return $this->getObjectByName($name);
  62.     }
  63.     
  64.     /**
  65.      * Gets the Component in the specified index
  66.      *
  67.      * @param int $index 
  68.      * @return PhpExt_Component 
  69.      */
  70.     public function &getByIndex($index{
  71.         return $this->getObjectByIndex($index);
  72.     }
  73.             
  74. }

Documentation generated on Fri, 08 Aug 2008 15:51:55 -0500 by phpDocumentor 1.4.0