Microweber\Providers\Database\Crud::get_by_id PHP Méthode

get_by_id() public méthode

public get_by_id ( $id, $field_name = 'id' )
    public function get_by_id($id = 0, $field_name = 'id')
    {
        $id = intval($id);
        if ($id == 0) {
            return false;
        }
        if ($field_name == false) {
            $field_name = 'id';
        }
        $table = $this->table;
        $params = array();
        $params[$field_name] = $id;
        $params['table'] = $table;
        $params['single'] = true;
        $data = $this->get($params);
        return $data;
    }