| @@ 926-945 (lines=20) @@ | ||
| 923 | * |
|
| 924 | * @return array(int=>array(string=>mixed)) Data rows. |
|
| 925 | */ |
|
| 926 | public function loadTypeDataByIdentifier($identifier, $status) |
|
| 927 | { |
|
| 928 | $q = $this->getLoadTypeQuery(); |
|
| 929 | $q->where( |
|
| 930 | $q->expr->lAnd( |
|
| 931 | $q->expr->eq( |
|
| 932 | $this->dbHandler->quoteColumn('identifier', 'ezcontentclass'), |
|
| 933 | $q->bindValue($identifier) |
|
| 934 | ), |
|
| 935 | $q->expr->eq( |
|
| 936 | $this->dbHandler->quoteColumn('version', 'ezcontentclass'), |
|
| 937 | $q->bindValue($status) |
|
| 938 | ) |
|
| 939 | ) |
|
| 940 | ); |
|
| 941 | $stmt = $q->prepare(); |
|
| 942 | $stmt->execute(); |
|
| 943 | ||
| 944 | return $stmt->fetchAll(\PDO::FETCH_ASSOC); |
|
| 945 | } |
|
| 946 | ||
| 947 | /** |
|
| 948 | * Loads an array with data about the type referred to by $remoteId in |
|
| @@ 956-975 (lines=20) @@ | ||
| 953 | * |
|
| 954 | * @return array(int=>array(string=>mixed)) Data rows. |
|
| 955 | */ |
|
| 956 | public function loadTypeDataByRemoteId($remoteId, $status) |
|
| 957 | { |
|
| 958 | $q = $this->getLoadTypeQuery(); |
|
| 959 | $q->where( |
|
| 960 | $q->expr->lAnd( |
|
| 961 | $q->expr->eq( |
|
| 962 | $this->dbHandler->quoteColumn('remote_id', 'ezcontentclass'), |
|
| 963 | $q->bindValue($remoteId) |
|
| 964 | ), |
|
| 965 | $q->expr->eq( |
|
| 966 | $this->dbHandler->quoteColumn('version', 'ezcontentclass'), |
|
| 967 | $q->bindValue($status) |
|
| 968 | ) |
|
| 969 | ) |
|
| 970 | ); |
|
| 971 | $stmt = $q->prepare(); |
|
| 972 | $stmt->execute(); |
|
| 973 | ||
| 974 | return $stmt->fetchAll(\PDO::FETCH_ASSOC); |
|
| 975 | } |
|
| 976 | ||
| 977 | /** |
|
| 978 | * Returns a basic query to retrieve Type data. |
|
| @@ 1225-1245 (lines=21) @@ | ||
| 1222 | * |
|
| 1223 | * @return array |
|
| 1224 | */ |
|
| 1225 | public function loadTrashByLocation($locationId) |
|
| 1226 | { |
|
| 1227 | $query = $this->handler->createSelectQuery(); |
|
| 1228 | $query |
|
| 1229 | ->select('*') |
|
| 1230 | ->from($this->handler->quoteTable('ezcontentobject_trash')) |
|
| 1231 | ->where( |
|
| 1232 | $query->expr->eq( |
|
| 1233 | $this->handler->quoteColumn('node_id'), |
|
| 1234 | $query->bindValue($locationId) |
|
| 1235 | ) |
|
| 1236 | ); |
|
| 1237 | $statement = $query->prepare(); |
|
| 1238 | $statement->execute(); |
|
| 1239 | ||
| 1240 | if ($row = $statement->fetch(\PDO::FETCH_ASSOC)) { |
|
| 1241 | return $row; |
|
| 1242 | } |
|
| 1243 | ||
| 1244 | throw new NotFound('trash', $locationId); |
|
| 1245 | } |
|
| 1246 | ||
| 1247 | /** |
|
| 1248 | * List trashed items. |
|