Pimcore\Model\Version::getById PHP Method

getById() public static method

public static getById ( integer $id ) : Version
$id integer
return Version
    public static function getById($id)
    {
        $version = new self();
        $version->getDao()->getById($id);
        return $version;
    }

Usage Example

Beispiel #1
0
 /**
  * Get latest available version, using $force always returns a version no matter if it is the same as the published one
  * @param bool $force
  * @return array
  */
 public function getLatestVersion($force = false)
 {
     $versionData = $this->db->fetchRow("SELECT id,date FROM versions WHERE cid = ? AND ctype='document' ORDER BY `id` DESC LIMIT 1", $this->model->getId());
     if ($versionData["id"] && $versionData["date"] > $this->model->getModificationDate() || $force) {
         $version = Version::getById($versionData["id"]);
         return $version;
     }
     return;
 }
All Usage Examples Of Pimcore\Model\Version::getById