| @@ 806-844 (lines=39) @@ | ||
| 803 | * |
|
| 804 | * @return array |
|
| 805 | */ |
|
| 806 | public function loadAutogeneratedEntry($action, $parentId = null) |
|
| 807 | { |
|
| 808 | /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */ |
|
| 809 | $query = $this->dbHandler->createSelectQuery(); |
|
| 810 | $query->select( |
|
| 811 | '*' |
|
| 812 | )->from( |
|
| 813 | $this->dbHandler->quoteTable($this->table) |
|
| 814 | )->where( |
|
| 815 | $query->expr->lAnd( |
|
| 816 | $query->expr->eq( |
|
| 817 | $this->dbHandler->quoteColumn('action'), |
|
| 818 | $query->bindValue($action, null, \PDO::PARAM_STR) |
|
| 819 | ), |
|
| 820 | $query->expr->eq( |
|
| 821 | $this->dbHandler->quoteColumn('is_original'), |
|
| 822 | $query->bindValue(1, null, \PDO::PARAM_INT) |
|
| 823 | ), |
|
| 824 | $query->expr->eq( |
|
| 825 | $this->dbHandler->quoteColumn('is_alias'), |
|
| 826 | $query->bindValue(0, null, \PDO::PARAM_INT) |
|
| 827 | ) |
|
| 828 | ) |
|
| 829 | ); |
|
| 830 | ||
| 831 | if (isset($parentId)) { |
|
| 832 | $query->where( |
|
| 833 | $query->expr->eq( |
|
| 834 | $this->dbHandler->quoteColumn('parent'), |
|
| 835 | $query->bindValue($parentId, null, \PDO::PARAM_INT) |
|
| 836 | ) |
|
| 837 | ); |
|
| 838 | } |
|
| 839 | ||
| 840 | $statement = $query->prepare(); |
|
| 841 | $statement->execute(); |
|
| 842 | ||
| 843 | return $statement->fetch(\PDO::FETCH_ASSOC); |
|
| 844 | } |
|
| 845 | ||
| 846 | /** |
|
| 847 | * Loads all data for the path identified by given $id. |
|
| @@ 1056-1094 (lines=39) @@ | ||
| 1053 | * |
|
| 1054 | * @return array |
|
| 1055 | */ |
|
| 1056 | public function loadAutogeneratedEntries($parentId, $includeHistory = false) |
|
| 1057 | { |
|
| 1058 | /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */ |
|
| 1059 | $query = $this->dbHandler->createSelectQuery(); |
|
| 1060 | $query->select( |
|
| 1061 | '*' |
|
| 1062 | )->from( |
|
| 1063 | $this->dbHandler->quoteTable($this->table) |
|
| 1064 | )->where( |
|
| 1065 | $query->expr->lAnd( |
|
| 1066 | $query->expr->eq( |
|
| 1067 | $this->dbHandler->quoteColumn('parent'), |
|
| 1068 | $query->bindValue($parentId, null, \PDO::PARAM_INT) |
|
| 1069 | ), |
|
| 1070 | $query->expr->eq( |
|
| 1071 | $this->dbHandler->quoteColumn('action_type'), |
|
| 1072 | $query->bindValue('eznode', null, \PDO::PARAM_STR) |
|
| 1073 | ), |
|
| 1074 | $query->expr->eq( |
|
| 1075 | $this->dbHandler->quoteColumn('is_alias'), |
|
| 1076 | $query->bindValue(0, null, \PDO::PARAM_INT) |
|
| 1077 | ) |
|
| 1078 | ) |
|
| 1079 | ); |
|
| 1080 | ||
| 1081 | if (!$includeHistory) { |
|
| 1082 | $query->where( |
|
| 1083 | $query->expr->eq( |
|
| 1084 | $this->dbHandler->quoteColumn('is_original'), |
|
| 1085 | $query->bindValue(1, null, \PDO::PARAM_INT) |
|
| 1086 | ) |
|
| 1087 | ); |
|
| 1088 | } |
|
| 1089 | ||
| 1090 | $statement = $query->prepare(); |
|
| 1091 | $statement->execute(); |
|
| 1092 | ||
| 1093 | return $statement->fetchAll(\PDO::FETCH_ASSOC); |
|
| 1094 | } |
|
| 1095 | ||
| 1096 | public function getLocationContentMainLanguageId($locationId) |
|
| 1097 | { |
|