Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

RichText/RichTextStorage/Gateway/DoctrineStorage.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\FieldType\RichText\RichTextStorage\Gateway;
8
9 use Doctrine\DBAL\Connection;
10 use eZ\Publish\Core\FieldType\RichText\RichTextStorage\Gateway;
11 use eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway as UrlGateway;
12
13 class DoctrineStorage extends Gateway
14 {
16 protected $connection;
17
18 public function __construct(UrlGateway $urlGateway, Connection $connection)
19 {
20 parent::__construct($urlGateway);
21 $this->connection = $connection;
22 }
23
33 public function getContentIds(array $remoteIds)
34 {
35 $objectRemoteIdMap = [];
36
37 if (!empty($remoteIds)) {
38 $query = $this->connection->createQueryBuilder();
39 $query
40 ->select(
41 $this->connection->quoteIdentifier('id'),
42 $this->connection->quoteIdentifier('remote_id')
43 )
44 ->from('ezcontentobject')
45 ->where($query->expr()->in('remote_id', ':remoteIds'))
46 ->setParameter(':remoteIds', $remoteIds, Connection::PARAM_STR_ARRAY)
47 ;
48
49 $statement = $query->execute();
50 foreach ($statement->fetchAll(\PDO::FETCH_ASSOC) as $row) {
51 $objectRemoteIdMap[$row['remote_id']] = $row['id'];
52 }
53 }
54
55 return $objectRemoteIdMap;
56 }
57 }
eZ\Publish\Core\FieldType\RichText\RichTextStorage\Gateway\DoctrineStorage
Definition: RichText/RichTextStorage/Gateway/DoctrineStorage.php:14
eZ\Publish\Core\FieldType\RichText\RichTextStorage\Gateway\DoctrineStorage\__construct
__construct(UrlGateway $urlGateway, Connection $connection)
Definition: RichText/RichTextStorage/Gateway/DoctrineStorage.php:18
eZ\Publish\Core\FieldType\RichText\RichTextStorage\Gateway\DoctrineStorage\getContentIds
getContentIds(array $remoteIds)
Return a list of Content ids for a list of remote ids.
Definition: RichText/RichTextStorage/Gateway/DoctrineStorage.php:33
eZ\Publish\Core\FieldType\RichText\RichTextStorage\Gateway\DoctrineStorage\$connection
$connection
Definition: RichText/RichTextStorage/Gateway/DoctrineStorage.php:16
eZ\Publish\Core\FieldType\RichText\RichTextStorage\Gateway
Abstract gateway class for RichText type.
Definition: FieldType/RichText/RichTextStorage/Gateway.php:19
eZ\Publish\Core\FieldType\RichText\RichTextStorage\Gateway\$urlGateway
$urlGateway
Definition: FieldType/RichText/RichTextStorage/Gateway.php:21
eZ\Publish\Core\FieldType\RichText\RichTextStorage\Gateway
Definition: RichText/RichTextStorage/Gateway/DoctrineStorage.php:7
eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway
Definition: Url/UrlStorage/Gateway/DoctrineStorage.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.