コード例 #1
0
 public function getId($forceGeneration = true)
 {
     if ($this->realFile === null) {
         throw new EyeUnsupportedOperationException(__METHOD__ . ' on ' . $this->path);
     }
     $meta = $this->getMeta();
     $id = null;
     if ($meta !== null) {
         $id = $meta->get(self::METADATA_KEY_ID);
     }
     if ($id === null && $forceGeneration) {
         $id = ObjectIdGenerator::assignId($this);
     }
     return $id;
 }
コード例 #2
0
ファイル: interface.php プロジェクト: DavidGarciaCat/eyeos
 /**
  * Gets the ID and automatically generates one if it has none.
  * 
  * @return string
  */
 public final function getId($forceGeneration = true)
 {
     if ($this->id === null && $forceGeneration) {
         ObjectIdGenerator::assignId($this);
     }
     return $this->id;
 }
コード例 #3
0
ファイル: UserFile.php プロジェクト: DavidGarciaCat/eyeos
 public function getId($forceGeneration = true)
 {
     $meta = $this->getMeta();
     $id = null;
     if ($meta !== null) {
         $id = $meta->get(self::METADATA_KEY_ID);
     }
     if ($id === null && $forceGeneration) {
         $id = ObjectIdGenerator::assignId($this);
     }
     return $id;
 }