public static function create($name) { if (static::_getCollection()->findOne(array('name' => $name))) { throw new Content_Type_Exception('Duplicate content type "' . $name . '"', Content_Type_Exception::CODE_DUP_CONTENT_TYPE); } $data = static::_getDefaultData(); $data['name'] = $name; return parent::create($data); }
public function __construct($type, $data) { $this->_type = $type; parent::__construct($data); }
/** * Fetch the path to the file within the mongo filesystem. This does not include * the name of the file/folder, although I am unsure of whether this is "correct" or not. * @return string - the path to the file/folder. */ public function getPath() { if (isset($this->mPath)) { # path to file in local storage. $path = $this->mPath; } else { # path withing the mongo filesystem $path = parent::getPath(); } return $path; }