seblucas /
cops
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | /** |
||
| 4 | * COPS (Calibre OPDS PHP Server) class file |
||
| 5 | * |
||
| 6 | * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) |
||
| 7 | * @author <[email protected]> |
||
| 8 | */ |
||
| 9 | require_once('base.php'); |
||
| 10 | |||
| 11 | class PublishdateYear extends Base { |
||
| 12 | |||
| 13 | const PUBLISHDATE_YEAR_ID = "cops:publishdatesyear"; |
||
| 14 | const PUBLISHDATE_YEAR_COLUMNS = "strftime('%Y-%m', pubdate) as name, count(*) as count"; |
||
| 15 | const SQL_PUBLISHDATE_YEAR = "select {0} from books where name LIKE :year group by name order by name ASC"; |
||
| 16 | const SQL_PUBLISHDATE_YEAR_COUNT = "select count(DISTINCT strftime('%Y-%m', pubdate)) from books"; |
||
| 17 | |||
| 18 | public $id; |
||
| 19 | public $name; |
||
| 20 | |||
| 21 | public function __construct($post) { |
||
| 22 | $this->id = $post->name; |
||
| 23 | $this->name = $post->name; |
||
| 24 | } |
||
| 25 | |||
| 26 | public function getUri() { |
||
| 27 | return "?page=" . parent::PAGE_PUBLISHDATE_MONTH . "&id=$this->id"; |
||
| 28 | } |
||
| 29 | |||
| 30 | public function getEntryId() { |
||
| 31 | return self::PUBLISHDATE_YEAR_ID . ":" . $this->id; |
||
| 32 | } |
||
| 33 | |||
| 34 | public static function getCount() { |
||
| 35 | return parent::getCountGeneric("pubdate", self::PUBLISHDATE_YEAR_ID, parent::PAGE_PUBLISHDATE_YEAR, "pubdate", self::SQL_PUBLISHDATE_YEAR_COUNT); |
||
|
0 ignored issues
–
show
|
|||
| 36 | } |
||
| 37 | |||
| 38 | public static function getAllPublishdateMonth($id) { |
||
| 39 | return Base::getEntryArrayWithBookNumber(self::SQL_PUBLISHDATE_YEAR, self::PUBLISHDATE_YEAR_COLUMNS, array('year' => $id."%"), "PublishdateYear"); |
||
| 40 | } |
||
| 41 | |||
| 42 | public static function getPublishdateMonth ($id) { |
||
| 43 | $post = array( |
||
| 44 | 'id' => $id, |
||
| 45 | 'name' => $id |
||
| 46 | ); |
||
| 47 | return new PublishdateYear ($post); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()method in theSoncalls the wrong method in the parent class.