Gets the last page number

@param string $id
@return int
338148
public function getLastPage($id = null)
    {
        $totalItems = ($this->getTotalItems($id) > 0) ? $this->getTotalItems($id) : 1;
        return (int)ceil($totalItems / $this->getItemsPerPage($id));
    }
847882
public function getStatus($id)
    {
        if ($this->isSuccess()) {
            foreach ($this->getResult() as $row) {
                if ($row['id'] == $id) {
                    return $row['status'];
                }
            }
        }

        return false;
    }
455047
public function get($id)
    {
        $entry = $this->readFile($id);
        if ($entry != false && $this->isTtlMode()) {
            $entry = (is_null($entry[static::ENTRY_EXPIRATION]) || $entry[static::ENTRY_EXPIRATION] > $this->getTime())
                ? $entry[static::ENTRY_VALUE]
                : false
            ;
        }
        return $entry;
    }
546611
public function findDocumentById($id)
    {
        $response = $this->request('GET', '/' . $id);
        if ($response->getStatusCode() !== 200) {
            return null;
        }

        return $this->documentFactory->createFromResponse($this, $id, $response);
    }
118376
public function getLastIndex()
    {	
		if (!$this->itemCountPerPage) return $this->getCountAll();
		$count = $this->itemCountPerPage + $this->itemCountPerPage * ($this->pageNumber - 1);
		if ($count > $this->getCountAll()) $count = $this->getCountAll();
		return $count;
	}
1047397
public function get($id)
    {
        return $this->_sendPayload(
            $this->_getService($this->_pageServiceKey)->getActiveTemplateSections($id)
        );
    }
398777
public function getBookInfo($id)
    {
        if (empty($id)) {
            return $this->handleError('Empty book id');
        }

        $requestResult = $this->sendRequest('addressbooks/' . $id);

        return $this->handleResult($requestResult);
    }
191904
public function read($id)
    { 
		$res = $this->getDbConnection()->fetchColumn('SELECT value FROM session_data WHERE id=?',[$id],0);
		if (!$res) $res = '';
		return $res;
    }
1273171
public function getParameterByID($id)
    {
        $param = current(array_filter($this->params, function (Param $param) use ($id) {
            return ($param->id === $id);
        }));

        return ($param) ? $param : null;
    }
52761
public function lastInsertedId()
    {
        $query = "MATCH (n) RETURN MAX(id(n)) AS lastIdCreated";

        $statement = $this->getCypherQuery($query, []);
        $result = $statement->getResultSet();

        return $result[0][0];
    }
895773
public function getStatus($id = null)
    {
        if ($this->isSuccess()) {
            if (!$id) {
                $result = $this->getResult();
                return $result[0]['status'];
            }

            foreach ($this->getResult() as $row) {
                if ($row['id'] == $id) {
                    return $row['status'];
                }
            }
        }

        return false;
    }
866650
public function getPage($id)
    {
        $found_page = null;

        foreach ($this->pages as $page) {
            if ($page->id == $id) {
                $found_page = $page;
                break;
            }
        }

        return $found_page;
    }
250571
public function get_lastpageid() {
        global $DB;
        if ($this->lastpageid == null) {
            if (!$this->loadedallpages) {
                $lastpageid = $DB->get_field('lesson_pages', 'id', array('lessonid'=>$this->properties->id, 'nextpageid'=>0));
                if (!$lastpageid) {
                    print_error('cannotfindlastpage', 'lesson');
                }
                $this->lastpageid = $lastpageid;
            } else {
                $lastpageid = $this->get_lastpage();
                $this->lastpageid = $lastpageid->id;
            }
        }

        return $this->lastpageid;
    }
874558
public function status($id) 
    {
        $url = self::HOST . self::STATUS;

        $params = $this->get_default_params();
        $params['id'] = $id;
        $result = $this->request($url, $params);

        return $result;
    }
230146
public function getBookVariables($id)
    {
        if (empty($id)) {
            return $this->handleError('Empty book id');
        }

        $requestResult = $this->sendRequest('addressbooks/' . $id . '/variables');

        return $this->handleResult($requestResult);
    }
966283
public function getElementById($id)
    {
        foreach ($this->getRecursiveIterator() as $element) {
            if ($id == $element->getId()) {
                return $element;
            }
        }
        return null;
    }
600327
public function getByID($id)
    {
        $id = (int) $id;

        return $id > 0 ? $this->em->find(Geolocator::class, $id) : null;
    }