コード例 #1
0
ファイル: FileTag.php プロジェクト: peopleplan/Pyrus
 /**
  * Allow setting of attributes and tasks directly
  *
  * @param string $var
  * @param string|object $value
  */
 function __set($var, $value)
 {
     if (strpos($var, $this->_packagefile->getTasksNs()) === 0) {
         // setting a file task
         if ($value instanceof \Pyrus\Task\Common) {
             $this->_packagefile->setFileAttribute($this->dir . $this['attribs']['name'], $var, $value);
             return;
         }
         throw new \Pyrus\PackageFile\Exception('Cannot set ' . $var . ' to non-' . '\\Pyrus\\Task\\Common object in file ' . $this->dir . $this['attribs']['name']);
     }
     $this->_packagefile->setFileAttribute($this->dir . $this['attribs']['name'], $var, $value);
     parent::__construct($this->_packagefile->files[$this->dir . $this['attribs']['name']]);
 }