| @@ 830-868 (lines=39) @@ | ||
| 827 | * |
|
| 828 | * @return array |
|
| 829 | */ |
|
| 830 | public function loadAutogeneratedEntry($action, $parentId = null) |
|
| 831 | { |
|
| 832 | /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */ |
|
| 833 | $query = $this->dbHandler->createSelectQuery(); |
|
| 834 | $query->select( |
|
| 835 | '*' |
|
| 836 | )->from( |
|
| 837 | $this->dbHandler->quoteTable($this->table) |
|
| 838 | )->where( |
|
| 839 | $query->expr->lAnd( |
|
| 840 | $query->expr->eq( |
|
| 841 | $this->dbHandler->quoteColumn('action'), |
|
| 842 | $query->bindValue($action, null, \PDO::PARAM_STR) |
|
| 843 | ), |
|
| 844 | $query->expr->eq( |
|
| 845 | $this->dbHandler->quoteColumn('is_original'), |
|
| 846 | $query->bindValue(1, null, \PDO::PARAM_INT) |
|
| 847 | ), |
|
| 848 | $query->expr->eq( |
|
| 849 | $this->dbHandler->quoteColumn('is_alias'), |
|
| 850 | $query->bindValue(0, null, \PDO::PARAM_INT) |
|
| 851 | ) |
|
| 852 | ) |
|
| 853 | ); |
|
| 854 | ||
| 855 | if (isset($parentId)) { |
|
| 856 | $query->where( |
|
| 857 | $query->expr->eq( |
|
| 858 | $this->dbHandler->quoteColumn('parent'), |
|
| 859 | $query->bindValue($parentId, null, \PDO::PARAM_INT) |
|
| 860 | ) |
|
| 861 | ); |
|
| 862 | } |
|
| 863 | ||
| 864 | $statement = $query->prepare(); |
|
| 865 | $statement->execute(); |
|
| 866 | ||
| 867 | return $statement->fetch(\PDO::FETCH_ASSOC); |
|
| 868 | } |
|
| 869 | ||
| 870 | /** |
|
| 871 | * Loads all data for the path identified by given $id. |
|
| @@ 1092-1130 (lines=39) @@ | ||
| 1089 | * |
|
| 1090 | * @return array |
|
| 1091 | */ |
|
| 1092 | public function loadAutogeneratedEntries($parentId, $includeHistory = false) |
|
| 1093 | { |
|
| 1094 | /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */ |
|
| 1095 | $query = $this->dbHandler->createSelectQuery(); |
|
| 1096 | $query->select( |
|
| 1097 | '*' |
|
| 1098 | )->from( |
|
| 1099 | $this->dbHandler->quoteTable($this->table) |
|
| 1100 | )->where( |
|
| 1101 | $query->expr->lAnd( |
|
| 1102 | $query->expr->eq( |
|
| 1103 | $this->dbHandler->quoteColumn('parent'), |
|
| 1104 | $query->bindValue($parentId, null, \PDO::PARAM_INT) |
|
| 1105 | ), |
|
| 1106 | $query->expr->eq( |
|
| 1107 | $this->dbHandler->quoteColumn('action_type'), |
|
| 1108 | $query->bindValue('eznode', null, \PDO::PARAM_STR) |
|
| 1109 | ), |
|
| 1110 | $query->expr->eq( |
|
| 1111 | $this->dbHandler->quoteColumn('is_alias'), |
|
| 1112 | $query->bindValue(0, null, \PDO::PARAM_INT) |
|
| 1113 | ) |
|
| 1114 | ) |
|
| 1115 | ); |
|
| 1116 | ||
| 1117 | if (!$includeHistory) { |
|
| 1118 | $query->where( |
|
| 1119 | $query->expr->eq( |
|
| 1120 | $this->dbHandler->quoteColumn('is_original'), |
|
| 1121 | $query->bindValue(1, null, \PDO::PARAM_INT) |
|
| 1122 | ) |
|
| 1123 | ); |
|
| 1124 | } |
|
| 1125 | ||
| 1126 | $statement = $query->prepare(); |
|
| 1127 | $statement->execute(); |
|
| 1128 | ||
| 1129 | return $statement->fetchAll(\PDO::FETCH_ASSOC); |
|
| 1130 | } |
|
| 1131 | ||
| 1132 | public function getLocationContentMainLanguageId($locationId) |
|
| 1133 | { |
|