Timber\Post::check_post_id PHP Метод

check_post_id() защищенный Метод

helps you find the post id regardless of whether you send a string or whatever
protected check_post_id ( integer $pid ) : integer
$pid integer ;
Результат integer ID number of a post
    protected function check_post_id($pid)
    {
        if (is_numeric($pid) && $pid === 0) {
            $pid = get_the_ID();
            return $pid;
        }
        if (!is_numeric($pid) && is_string($pid)) {
            $pid = self::get_post_id_by_name($pid);
            return $pid;
        }
        if (!$pid) {
            return null;
        }
        return $pid;
    }