Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/bundle/Command/MigrateLegacyMatrixCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
use Exception;
use Ibexa\Contracts\Core\Persistence\Content\FieldValue;
use Ibexa\Contracts\Core\Persistence\Content\Type\FieldDefinition;
use Ibexa\Core\Persistence\Legacy\Content\Gateway;
use Ibexa\Core\Persistence\Legacy\Content\StorageFieldDefinition;
use Ibexa\Core\Persistence\Legacy\Content\StorageFieldValue;
use Ibexa\Core\Persistence\Legacy\Content\Type\Gateway as ContentTypeGateway;
use Ibexa\FieldTypeMatrix\FieldType\Converter\MatrixConverter;
use SimpleXMLElement;
use Symfony\Component\Console\Attribute\AsCommand;
Expand Down Expand Up @@ -244,8 +246,8 @@ private function getContentClassAttributes(): array
'attr.data_text5 as columns',
'class.identifier as contenttype_identifier',
])
->from('ezcontentclass_attribute', 'attr')
->join('attr', 'ezcontentclass', 'class', 'class.id = attr.contentclass_id')
->from(ContentTypeGateway::FIELD_DEFINITION_TABLE, 'attr')
->join('attr', ContentTypeGateway::CONTENT_TYPE_TABLE, 'class', 'class.id = attr.contentclass_id')
->where('attr.data_type_string = :identifier')
->setParameter('identifier', self::EZMATRIX_IDENTIFIER);

Expand All @@ -261,7 +263,7 @@ private function updateContentClassAttribute(int $id, int $minimumRows, string $
{
$query = $this->connection->createQueryBuilder();
$query
->update('ezcontentclass_attribute', 'attr')
->update(ContentTypeGateway::FIELD_DEFINITION_TABLE, 'attr')
->set('attr.data_int1', ':minimum_rows')
->set('attr.data_text5', ':columns')
->where('attr.id = :id')
Expand All @@ -282,7 +284,7 @@ private function getContentObjectAttributesCount(int $id): int
$query = $this->connection->createQueryBuilder();
$query
->select('count(1)')
->from('ezcontentobject_attribute', 'attr')
->from(Gateway::CONTENT_FIELD_TABLE, 'attr')
->where('attr.contentclassattribute_id = :class_attr_id')
->setParameter('class_attr_id', $id);

Expand All @@ -301,7 +303,7 @@ private function getContentObjectAttributes(int $id, int $offset, int $iteration
$query = $this->connection->createQueryBuilder();
$query
->select(['id', 'data_text'])
->from('ezcontentobject_attribute', 'attr')
->from(Gateway::CONTENT_FIELD_TABLE, 'attr')
->where('attr.contentclassattribute_id = :class_attr_id')
->setParameter('class_attr_id', $id)
->setFirstResult($offset)
Expand All @@ -318,7 +320,7 @@ private function updateContentObjectAttribute(int $id, string $rows): void
{
$query = $this->connection->createQueryBuilder();
$query
->update('ezcontentobject_attribute', 'attr')
->update(Gateway::CONTENT_FIELD_TABLE, 'attr')
->set('attr.data_text', ':rows')
->where('attr.id = :id')
->setParameter('id', $id)
Expand Down
Loading