Check if this record exists on live

@return bool
430814
public function isPublished()
    {
        $id = $this->owner->ID ?: $this->owner->OldID;
        if (!$id) {
            return false;
        }

        // Non-staged objects are considered "published" if saved
        if (!$this->hasStages()) {
            return true;
        }

        $liveVersion = static::get_versionnumber_by_stage($this->owner, Versioned::LIVE, $id);
        return (bool)$liveVersion;
    }
1162953
public function exists(): bool
    {
        $location_id = 0;

        $this->parts->reverse()->each(static function (string $place) use (&$location_id) {
            if ($location_id !== null) {
                $location_id = DB::table('placelocation')
                    ->where('pl_parent_id', '=', $location_id)
                    ->where('pl_place', '=', $place)
                    ->value('pl_id');
            }
        });

        return $location_id !== null;
    }
1301925
protected static function _tableExists()
    {
        $db = ConnectionManager::get('default');
        $tables = $db->schemaCollection()->listTables();

        if (in_array('settings_configurations', $tables)) {
            return true;
        }
        return false;
    }
54255
public function exists()
    {
        if (! array_key_exists($this->primaryKey, $this->attributes)) {
            return false;
        }

        return ! empty($this->attributes[$this->primaryKey]);
    }
761716
private function filesExist()
    {
        foreach (static::FILES as $file) {
            if (!file_exists($this->storage($file))) {
                return false;
            }
        }

        return true;
    }
132250
public static function check($key)
    {
        if (!self::_tableExists()) {
            return;
        }

        self::autoLoad();
        $model = self::model();

        if (key_exists($key, self::$_data)) {
            return true;
        }

        $query = $model->findByName($key);

        if (!$query->Count()) {
            return false;
        }

        return true;
    }
219456
public function exists()
    {
        $sql = 'SELECT count(*) FROM INFORMATION_SCHEMA.TABLES WHERE Table_Name=? ';
        $params = array($this->_name->table);

        if (is_null($this->_name->database)) {
            $sql .= 'AND TABLE_SCHEMA=database() ';
        } else {
            $sql .= 'AND TABLE_SCHEMA=? ';
            $params []= $this->_name->database;
        }

        return (bool) $this->_connection->execute($sql, $params)->scalar();
    }
122512
public function sessdb_table_exists() {
		try {
			$this->db->run_query("SELECT * FROM ". self::tableName .
					" ORDER BY ". self::tablePKey ." LIMIT 1");
			$exists = true;
		}
		catch(exception $e) {
			$this->exception_handler(__METHOD__ .": exception while trying to detect table::: ". $e->getMessage());
			$exists = false;
		}
		
		return($exists);
	}
919087
public function exists()
    {
        if (!Data::table($this->name)->exists())
            throw new LazerException('Table "' . $this->name . '" does not exists');

        if (!Config::table($this->name)->exists())
            throw new LazerException('Config "' . $this->name . '" does not exists');

        return TRUE;
    }
1125768
protected function check()
  {
    if ( $this->slugAble() ){
      if ( !$this->checkTitleUnique($this->row->get('id'), $this->row->get('title')) ){
        return false;
      }
      
      if ( !$this->checkSlugUnique($this->row->get('id'), $this->row->get('slug')) ){
        return false;
      }
    }
    
    if ( $this->orderingAble() ){
      if ( $this->shouldBeOrdered() ){
        $conditions = $this->getReorderConditions();
        $this->row->set('ordering', $this->getNextOrder($conditions));
      }
    }
    
    if ( $this->statesAble() ){
      $userId   = $this->db->getUid();
      $nullDate = $this->db->getNullDate();
      $nowDate  = Date::getInstance()->format($this->db->getDateFormat());
      
      if ( !$this->row->get($this->tbl_key) ){
        $this->row->set('created', $nowDate);
        $this->row->set('created_by', $userId); 
      }
      else {
        $this->row->set('modified', $nowDate);
        $this->row->set('modified_by', $userId); 
      }
    }
    
    if ( $this->versionAble() ){
      $version = (int)$this->row->get('version');
      $this->row->set('version', ++$version);
    }
    
    foreach($this->getFields() as $fieldName => $fieldInfos){
      $v = $this->row->get($fieldName);
      
      if ( 'YES' === $fieldInfos->Null ){
        switch($fieldInfos->Type){
          case 'bigint':
          case 'mediumint':
          case 'smallint':
          case 'tinyint':
            if ( 0 === $this->row->get($fieldName) ){
              $this->row->set($fieldName, null);
            }
            break;
          
          case 'datetime':
          case 'timestamp':
            if ( $this->db->getNullDate(true) === $this->row->get($fieldName) ){
              $this->row->set($fieldName, null);
            }
            break;
          
          case 'date':
            if ( $this->db->getNullDate(false) === $this->row->get($fieldName) ){
              $this->row->set($fieldName, null);
            }
            break;
          
          case 'time':
            if ( '00:00:00' === $this->row->get($fieldName) ){
              $this->row->set($fieldName, null);
            }
            break;
        }
      }
    }
    
    return true;
  }
937125
private function check_table_exists()
    {
        if ($this->type == 'sqlite') {
            $query = "SELECT count(*) FROM sqlite_master WHERE name='cache'";
            $result = $this->db->query($query);
            $numbers = $result->fetchAll();
            if ($numbers[0]['count(*)'] > 0) {
                // Ok
            } else {
                $this->create_table();
            }
        } else {
            $query = "show tables like 'cache'";
            $result = $this->db->query($query);
            if ($result->size() > 0) {
                // Ok
            } else {
                $this->create_table();
            }
        }
    }
1162052
protected function checkTableExists()
  {
    $m = $this->getManager();

    $q = 'SHOW TABLES LIKE "' . $m->getPrefix() . $this->getTable() . '"';

    return (bool)$m->query($q)->rowCount();
  }
190679
public function  exist(){
      $sql = $this->StringSql();
      $existsSql = "exists (".$sql.")";
      $select = 'select '.$existsSql;
      $this->initialize();
      return (bool) $this->query($select)->one()[$existsSql];
  }
401870
function record_exists($table, $data) {
		if (!empty($this->prefix) && !(substr_count($table,$this->prefix) > 0)) {
			$table = $this->prefix."_".$table;
        }
		$pairs = array();
		foreach($data as $key => $value) {
			if (!is_numeric($value)) {
				$pairs[] = $this->encapsulate_column_name($key)." = '".$this->escape($value)."'";
			} else {
				$pairs[] = $this->encapsulate_column_name($key)." = $value";
			}
		}
		$where = implode(" AND ", $pairs);
		$records = $this->select("*",$table,$data);
		if ($records->num_rows > 0) {
			return $records;
		} else {
			return false;
		}
	}
1266452
function exists()
    {
        $path = $this->PHPDir . '/' . $this->PHPFile;
        if ( !$this->ClusteringEnabled )
            return file_exists( $path );

        if ( !$this->ClusterHandler )
        {
            $this->ClusterHandler = eZClusterFileHandler::instance();
        }
        return $this->ClusterHandler->fileExists( $path );
    }
742264
protected function exists($shortname = null) {
        global $DB;
        if (is_null($shortname)) {
            $shortname = $this->shortname;
        }
        if (!empty($shortname) || is_numeric($shortname)) {
            return $DB->record_exists('course', array('shortname' => $shortname));
        }
        return false;
    }
951123
public function tableExists()
    {
        $dbh    = $this->db();
        $table  = $this->table();
        $driver = $dbh->getAttribute(PDO::ATTR_DRIVER_NAME);
        if ($driver === self::SQLITE_DRIVER_NAME) {
            $query = sprintf('SELECT name FROM sqlite_master WHERE type = "table" AND name = "%s";', $table);
        } else {
            $query = sprintf('SHOW TABLES LIKE "%s"', $table);
        }

        $this->logger->debug($query);
        $sth    = $dbh->query($query);
        $exists = $sth->fetchColumn(0);

        return !!$exists;
    }