Returns the first value of a property or <code>null</code> if the
property is not set.

@param string $id
@return mixed
540146
private function getFirstValue($id)
    {
        if ($this->properties === null) {
            return null;
        }
        $properties = $this->properties->getProperties();

        if (isset($properties[$id])) {
            return $properties[$id]->getFirstValue();
        }

        return null;
    }
562766
final public function find(int $id = null)
    {
        $result = $this->first($id);

        if (!$result) {
            return null;
        }

        $this->setProperties($result);

        return $this;
    }
908736
private function getIncreasedValueEntry($id)
    {
        $value = intval($this->get($id));
        $value++;
        if ($this->isTtlMode()) {
            $value = [
                static::ENTRY_VALUE      => $value,
                static::ENTRY_EXPIRATION => null,
            ];
        }
        return $value;
    }
777374
public function getItem($id)
    {
        foreach ($this->entity->getItems() as $item) {
            if ($item->getId() === $id) {
                return $item;
            }
        }

        return null;
    }
1342800
public function getId()
    {
        $value = $this->getFirstValue(PropertyIds::OBJECT_ID);
        if (is_string($value)) {
            return $value;
        }
        return null;
    }
401800
private function first(int $id = null)
    {
        $this->firstIsSelected = true;  // utile pour active record

        if ($id) {
            $this->where('id', '=', $id);
        }

        $this->query->setStartSelect();

        $this->limit(1);

        $this->query->prepare()->bindWhere()->bindLimit()->execute();

        return $this->query->fetch();
    }
150587
public function getPage($id)
    {
        return isset($this->pages[$id])?$this->pages[$id]:null;
    }
1133581
public function getById($id)
    {       
        if (!is_null($this->_table) && !is_null($id)) {
            $this->_sql = "SELECT * FROM $this->_table WHERE id = $id";
            $row = $this->_select($this->_sql);
            return (isset($row[0])) ? $row[0] : null;
        }
    }
620295
public function read($id = null)
    {
        return ($id != null)
            ? $this->findByID($id)
            : $this->newModel();
    }
206610
public function get_from_id(int $id) {
        $records = $this->get_from_ids([$id]);
        return count($records) ? array_shift($records) : null;
    }
772210
public function getById($id)
    {
        $model = $this
            ->prepareQuery()
            ->where($this->model->getTable() . '.id', $id)
            ->first();

        if (empty($model))
            return null;

        $model = $this->addPermissionsForModel($model);

        return $this->formatModel($model);
    }
43655
public function get( $id ) {
		if ( isset( $this->types[ $id ] ) ) {
			return $this->types[ $id ];
		}

		return null;
	}
1370685
public function get($id = null) {
		if (empty($id)) {
			return false;
		}

		$fields = [
			$this->alias . '.id',
			$this->alias . '.value',
		];
		$blockExists = $this->hasField('block');
		if ($blockExists) {
			$fields[] = $this->alias . '.block';
		}
		$conditions = [$this->alias . '.id' => $id];
		$this->recursive = -1;

		return $this->find('first', compact('fields', 'conditions'));
	}
1010196
public function find($id)
    {
        foreach ($this->findAll() as $repo) {
            if ($id == $repo->getId()) {
                return $repo;
            }
        }

        return null;
    }
1027593
protected function getValue($id)
    {
        $file = $this->getFile($id);
        if (!file_exists($file)) {
            return null;
        }
        if (filemtime($file) < time()) { // filemtime : 文件最后修改时间
            @unlink($file);
            return null;
        }
        return file_get_contents($file);
    }
918694
public function getById($id)
    {
        $id = (int) $id;
        $rowSet = $this->getTableGateway()->select([$this->getPrimaryKey() => $id]);
        $row = $rowSet->current();
        return $row;
    }
966283
public function getElementById($id)
    {
        foreach ($this->getRecursiveIterator() as $element) {
            if ($id == $element->getId()) {
                return $element;
            }
        }
        return null;
    }