protected function getOwningSideAssociation($model,
$property) { $metaData =
$this->
getManager()->
getClassMetadata($model);
/** @var array{targetEntity: class-string<ModelEntity>, mappedBy: string, isOwningSide: bool} $mapping */
$mapping =
$metaData->
getAssociationMapping($property);
if ($mapping['isOwningSide'
]) { return $mapping;
} $associationMetaData =
$this->
getManager()->
getClassMetadata($mapping['targetEntity'
]);
return $associationMetaData->
getAssociationMapping($mapping['mappedBy'
]);
} /**
* Helper function which adds the listing sort conditions to the passed query builder object.
*
* @example
* The backend listing store of shopware creates a following sort array:
* $sort = array(
* array('property' => 'name', 'direction' => 'DESC'),
* array('property' => 'id', 'direction' => 'ASC')
* );
*
* Important: Doctrine requires the query builder field alias for each field.
* You can get a field mapping over the {@link #getModelFields} function.
* This function creates an associated array with the model field name as array key
* and as value an array with the query builder field alias under $field['alias'].
*
* Shopware resolves the passed Ext JS name over this function and use the alias of the field
* to sort the query builder.
*
* @param array<array{property: string, direction: string}> $sort
* @param class-string<ModelEntity> $model
* @param string $alias
* @param array<string> $whiteList
*
* @return array<array{property: string, direction: string}>
*/