/** * @param $item * @return UUID * @throws \Exception */ public static function getByItem($item) { $self = new self(); $self->setSystemInstanceIdentifier(); $self->setUuid($self->setItem($item)->createUuid()); return $self; }
/** * * @param array $data * @return Folder */ public static function create(array $data = array()) { $defaults = array('id' => null, 'parent_id' => null, 'name' => null, 'url' => null, 'uuid' => null, 'data' => new IdentifiableDataContainer(array())); $data = array_merge($defaults, $data); $obj = new self(); $obj->setId($data['id']); $obj->setParentId($data['parent_id']); $obj->setName($data['name']); $obj->setUrl($data['url']); $obj->setUuid($data['uuid']); $obj->setData($data['data']); return $obj; }
/** * Creates an instance with data * * @param array $data * @return self */ public static function create(array $data = array()) { $defaults = array('id' => null, 'folder_id' => null, 'profile' => null, 'name' => null, 'date_created' => new DateTime(), 'status' => null, 'resource' => null, 'uuid' => null, 'data' => new IdentifiableDataContainer(array())); $data = array_merge($defaults, $data); $obj = new self(); $obj->setId($data['id']); $obj->setFolderId($data['folder_id']); $obj->setProfile($data['profile']); $obj->setName($data['name']); $obj->setDateCreated($data['date_created']); $obj->setStatus($data['status']); $obj->setResource($data['resource']); $obj->setUuid($data['uuid']); $obj->setData($data['data']); return $obj; }
/** * Creates an instance with data * * @param array $data * @return Resource */ public static function create(array $data = array()) { $defaults = array('id' => null, 'uuid' => null, 'hash' => null, 'date_created' => new DateTime(), 'data' => new IdentifiableDataContainer(array()), 'mimetype' => null, 'size' => null, 'exclusive' => false); $data = array_merge($defaults, $data); $obj = new self(); $obj->setUuid($data['uuid']); $obj->setId($data['id']); $obj->setHash($data['hash']); $obj->setDateCreated($data['date_created']); $obj->setData($data['data']); $obj->setMimetype($data['mimetype']); $obj->setSize($data['size']); $obj->setExclusive($data['exclusive']); return $obj; }