Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with doctrine/orm ^2.6 (#181) #182

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Content/Types/FormSelect.php
Expand Up @@ -135,7 +135,7 @@ public function getViewData(PropertyInterface $property)

$locale = $property->getStructure()->getLanguageCode();

$formEntity = $this->formRepository->findById($id, $locale);
$formEntity = $this->formRepository->loadById($id, $locale);

if (!$formEntity) {
return [];
Expand Down
2 changes: 1 addition & 1 deletion Controller/DynamicController.php
Expand Up @@ -177,6 +177,6 @@ protected function loadForm(Request $request)
throw new BadRequestHttpException('"form" is required parameter');
}

return $this->get('sulu_form.repository.form')->findById($formId);
return $this->get('sulu_form.repository.form')->loadById($formId);
}
}
2 changes: 1 addition & 1 deletion Form/Builder.php
Expand Up @@ -267,7 +267,7 @@ private function createForm($name, $type, $typeId, $locale, $formEntity, $webspa
*/
private function loadFormEntity($id, $locale)
{
$formEntity = $this->formRepository->findById($id, $locale);
$formEntity = $this->formRepository->loadById($id, $locale);

if (!$formEntity) {
return null;
Expand Down
6 changes: 3 additions & 3 deletions Manager/FormManager.php
Expand Up @@ -55,7 +55,7 @@ public function __construct(
*/
public function findById($id, $locale = null)
{
return $this->formRepository->findById($id, $locale);
return $this->formRepository->loadById($id, $locale);
}

/**
Expand All @@ -66,7 +66,7 @@ public function findById($id, $locale = null)
*/
public function findAll($locale = null, $filters = [])
{
return $this->formRepository->findAll($locale, $filters);
return $this->formRepository->loadAll($locale, $filters);
}

/**
Expand All @@ -77,7 +77,7 @@ public function findAll($locale = null, $filters = [])
*/
public function count($locale = null, $filters = [])
{
return $this->formRepository->count($locale, $filters);
return $this->formRepository->countByFilters($locale, $filters);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions Repository/FormRepository.php
Expand Up @@ -22,7 +22,7 @@ class FormRepository extends \Doctrine\ORM\EntityRepository
*
* @return Form|null
*/
public function findById($id, $locale = null)
public function loadById($id, $locale = null)
{
$queryBuilder = $this->createQueryBuilder('form')
->leftJoin('form.translations', 'translation')->addSelect('translation')
Expand All @@ -48,7 +48,7 @@ public function findById($id, $locale = null)
*
* @return Form[]
*/
public function findAll($locale = null, $filters = [])
public function loadAll($locale = null, $filters = [])
{
$queryBuilder = $this->createQueryBuilder('form')
->leftJoin('form.translations', 'translation')->addSelect('translation')
Expand All @@ -71,7 +71,7 @@ public function findAll($locale = null, $filters = [])
*
* @return int
*/
public function count($locale = null, $filters = [])
public function countByFilters($locale = null, $filters = [])
{
$queryBuilder = $this->createQueryBuilder('form');
$queryBuilder->select($queryBuilder->expr()->count('form.id'));
Expand Down
8 changes: 8 additions & 0 deletions UPGRADE.md
@@ -1,5 +1,13 @@
# Upgrade

## 1.0.0-RC6

For the compatibility with `doctrine/orm ^2.6` the function names of the FormRepository are rename to avoid inheritance issues.

- `findById` changed to `loadById`
- `findAll` changed to `loadAll`
- `count` changed to `countByFilters`

## 1.0.0-RC3

### Removed `dynamic_default_view` parameter
Expand Down