Newscoop\Package\Item::__construct PHP 메소드

__construct() 공개 메소드

public __construct ( Package $package, mixed $item )
$package Package
$item mixed
    public function __construct(Package $package, $item)
    {
        if (is_a($item, 'Newscoop\\Image\\LocalImage')) {
            $this->image = $item;
            $this->setCaption($item->getCaption());
        } else {
            $this->videoUrl = $item->getUrl();
        }
        $this->package = $package;
        $this->offset = (int) count($this->package->getItems());
        $this->package->getItems()->set($this->offset, $this);
    }