1 | <?php |
||
11 | class Publisher extends Base { |
||
12 | const ALL_PUBLISHERS_ID = "cops:publishers"; |
||
13 | const SQL_ALL_PUBLISHERS = |
||
14 | "select publishers.id as id, publishers.name as name, count(*) as count |
||
15 | from publishers |
||
16 | inner join books_publishers_link as link on publishers.id = link.publisher |
||
17 | inner join ({0}) as filter on filter.id = link.book |
||
18 | group by publishers.id, publishers.name |
||
19 | order by publishers.name"; |
||
20 | const SQL_PUBLISHERS_FOR_SEARCH = |
||
21 | 11 | "select publishers.id as id, publishers.name as name, count(*) as count |
|
22 | 11 | from publishers |
|
23 | 11 | inner join books_publishers_link as link on publishers.id = link.publisher |
|
24 | 11 | inner join ({0}) as filter on filter.id = link.book |
|
25 | where upper (publishers.name) like ? |
||
26 | 9 | group by publishers.id, publishers.name |
|
27 | 9 | order by publishers.name"; |
|
28 | |||
29 | |||
30 | 7 | public $id; |
|
31 | 7 | public $name; |
|
32 | |||
33 | public function __construct($post) { |
||
37 | |||
38 | public function getUri () { |
||
41 | |||
42 | 4 | public function getEntryId () { |
|
45 | 4 | ||
46 | public static function getCount() { |
||
50 | 1 | ||
51 | 1 | public static function getPublisherByBookId ($bookId) { |
|
52 | 1 | $result = parent::getDb ()->prepare('select publishers.id as id, name |
|
53 | 1 | from books_publishers_link, publishers |
|
54 | 1 | where publishers.id = publisher and book = ?'); |
|
55 | 1 | $result->execute (array ($bookId)); |
|
56 | if ($post = $result->fetchObject ()) { |
||
57 | return new Publisher ($post); |
||
58 | } |
||
59 | return NULL; |
||
60 | 2 | } |
|
61 | 2 | ||
62 | public static function getPublisherById ($publisherId) { |
||
63 | $result = parent::getDb ()->prepare('select id, name |
||
64 | 23 | from publishers where id = ?'); |
|
65 | 23 | $result->execute (array ($publisherId)); |
|
66 | if ($post = $result->fetchObject ()) { |
||
67 | return new Publisher ($post); |
||
68 | } |
||
69 | return NULL; |
||
70 | } |
||
71 | |||
72 | public static function getAllPublishers() { |
||
75 | |||
76 | public static function getAllPublishersByQuery($query) { |
||
79 | } |
||
80 |
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 theSon
calls the wrong method in the parent class.