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

BinaryFile/BinaryFileStorage/Gateway/DoctrineStorage.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\FieldType\BinaryFile\BinaryFileStorage\Gateway;
8
9 use Doctrine\DBAL\Query\QueryBuilder;
10 use eZ\Publish\SPI\Persistence\Content\VersionInfo;
11 use eZ\Publish\SPI\Persistence\Content\Field;
12 use eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage\Gateway\DoctrineStorage as BaseDoctrineStorage;
13 use PDO;
14
18 class DoctrineStorage extends BaseDoctrineStorage
19 {
23 protected function getStorageTable()
24 {
25 return 'ezbinaryfile';
26 }
27
31 protected function getPropertyMapping()
32 {
33 $propertyMap = parent::getPropertyMapping();
34 $propertyMap['download_count'] = [
35 'name' => 'downloadCount',
36 'cast' => 'intval',
37 ];
38
39 return $propertyMap;
40 }
41
45 protected function setFetchColumns(QueryBuilder $queryBuilder, $fieldId, $versionNo)
46 {
47 parent::setFetchColumns($queryBuilder, $fieldId, $versionNo);
48
49 $queryBuilder->addSelect(
50 $this->connection->quoteIdentifier('download_count')
51 );
52 }
53
57 protected function setInsertColumns(QueryBuilder $queryBuilder, VersionInfo $versionInfo, Field $field)
58 {
59 parent::setInsertColumns($queryBuilder, $versionInfo, $field);
60
61 $queryBuilder
62 ->setValue('download_count', ':downloadCount')
63 ->setParameter(
64 ':downloadCount',
65 $field->value->externalData['downloadCount'],
66 PDO::PARAM_INT
67 )
68 ;
69 }
70 }
eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage\Gateway\DoctrineStorage
Base class for binary files external storage DoctrineStorage gateways.
Definition: BinaryBase/BinaryBaseStorage/Gateway/DoctrineStorage.php:21
eZ\Publish\Core\FieldType\BinaryFile\BinaryFileStorage\Gateway\DoctrineStorage
Binary File Field Type external storage DoctrineStorage gateway.
Definition: BinaryFile/BinaryFileStorage/Gateway/DoctrineStorage.php:19
eZ\Publish\Core\FieldType\BinaryFile\BinaryFileStorage\Gateway\DoctrineStorage\getStorageTable
getStorageTable()
{Return the table name to store data in.string}
Definition: BinaryFile/BinaryFileStorage/Gateway/DoctrineStorage.php:23
eZ\Publish\Core\FieldType\BinaryFile\BinaryFileStorage\Gateway\DoctrineStorage\getPropertyMapping
getPropertyMapping()
{Return a column to property mapping for the storage table.array}
Definition: BinaryFile/BinaryFileStorage/Gateway/DoctrineStorage.php:31
eZ\Publish\Core\FieldType\BinaryFile\BinaryFileStorage\Gateway\DoctrineStorage\setFetchColumns
setFetchColumns(QueryBuilder $queryBuilder, $fieldId, $versionNo)
{Set columns to be fetched from the database.This method is intended to be overwritten by derived cla...
Definition: BinaryFile/BinaryFileStorage/Gateway/DoctrineStorage.php:45
eZ\Publish\Core\FieldType\BinaryFile\BinaryFileStorage\Gateway\DoctrineStorage\setInsertColumns
setInsertColumns(QueryBuilder $queryBuilder, VersionInfo $versionInfo, Field $field)
{Set the required insert columns to insert query builder.This method is intended to be overwritten by...
Definition: BinaryFile/BinaryFileStorage/Gateway/DoctrineStorage.php:57
eZ\Publish\SPI\Persistence\Content\Field
Definition: SPI/Persistence/Content/Field.php:12
eZ\Publish\SPI\Persistence\Content\VersionInfo
This class holds version information data.
Definition: SPI/Persistence/Content/VersionInfo.php:15
eZ\Publish\Core\FieldType\BinaryFile\BinaryFileStorage\Gateway
Definition: BinaryFile/BinaryFileStorage/Gateway/DoctrineStorage.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.