Collections\Collection::__construct PHP 메소드

__construct() 공개 메소드

Instantiates the collection by specifying what type of Object will be used.
public __construct ( $type, array $items = [] )
$type
$items array
    public function __construct($type, $items = [])
    {
        $type = $this->determineType($type);
        $this->type = $type;
        if ($items) {
            $this->validateItems($items, $this->type);
        }
        $this->items = $items;
    }

Usage Example

예제 #1
0
 /**
  * Instantiates the collection by specifying what type of Object will be used.
  *
  * @param string $objectName Name of the class or interface used in the Collection
  */
 public function __construct($objectName = "{{foo}}")
 {
     parent::__construct($objectName);
 }
All Usage Examples Of Collections\Collection::__construct