public function numCustomPages($published = null) : int { if ($published === null) { return (int) $this->db->cell('SELECT count(pageid) FROM airship_custom_page'); } if ($published) { return (int) $this->db->cell('SELECT count(pageid) FROM airship_custom_page WHERE active'); } return (int) $this->db->cell('SELECT count(pageid) FROM airship_custom_page WHERE NOT active'); }