Model/Base.php
function getCategory($id)
    {
        $result = $this->db->query('SELECT * FROM category WHERE id = :id', [':id'=>(0+$id)]);
        if (isset($result[0])) {
            return ['name'=>$result[0]->get('name'),
                'description'=>$result[0]->get('description')];
        }
        return false;
    }
function getCategory($id)
    {
        $result = $this->db->query('SELECT * FROM category WHERE id = :id', [':id'=>(0+$id)]);
        if (isset($result[0])) {
            return ['name'=>$result[0]->get('name'),
                'description'=>$result[0]->get('description')];
        }
        return false;
    }
function getCategory ( $ id ) { $ result = $ this -> db -> query ( 'SELECT * FROM category WHERE id = :id' , [ ':id' => ( 0 + $ id ) ] ) ; if ( isset ( $ result [ 0 ] ) ) { return [ 'name' => $ result [ 0 ] -> get ( 'name' ) , 'description' => $ result [ 0 ] -> get ( 'description' ) ] ; } return false ; }
Get Category by id
@param  integer $id Id for category
@return bool|array     Array of the name and description or false
Get Category by id