Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SingleText extends BaseContentTypeEntity {
/**
* @ORM\Column(type="text", nullable=true)
*/
private ?string $text;
private ?string $text = null;

public function getText(): ?string {
return $this->text;
Expand Down
2 changes: 1 addition & 1 deletion backend/module/eCampApi/config/Rest/activity.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
'validators' => [],
],
5 => [
'name' => 'activityCategoryId',
'name' => 'categoryId',
'required' => false,
'filters' => [],
'validators' => [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

use eCampApi\ConfigFactory;

$config = ConfigFactory::createConfig('ActivityCategory', 'ActivityCategories');
$config = ConfigFactory::createConfig('Category', 'Categories');

array_push(
$config['api-tools-rest']['eCampApi\\V1\\Rest\\ActivityCategory\\Controller']['collection_query_whitelist'],
$config['api-tools-rest']['eCampApi\\V1\\Rest\\Category\\Controller']['collection_query_whitelist'],
'campId'
);

$config['api-tools-content-validation'] = [
'eCampApi\\V1\\Rest\\ActivityCategory\\Controller' => [
'input_filter' => 'eCampApi\\V1\\Rest\\ActivityCategory\\Validator',
'eCampApi\\V1\\Rest\\Category\\Controller' => [
'input_filter' => 'eCampApi\\V1\\Rest\\Category\\Validator',
],
];

$config['input_filter_specs'] = [
'eCampApi\\V1\\Rest\\ActivityCategory\\Validator' => [
'eCampApi\\V1\\Rest\\Category\\Validator' => [
0 => [
'name' => 'short',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wären Filter oder Validierungen nötig / sinnvoll für die neuen Felder?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ja - siehe #827, mach ich dann mit den ConfigFactories

'required' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use eCampApi\ConfigFactory;

$entity = 'ContentTypeConfig';
$entity = 'CategoryContent';
$config = ConfigFactory::createConfig($entity);

return $config;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use eCampApi\ConfigFactory;

$entity = 'ContentTypeConfigTemplate';
$entity = 'CategoryContentTemplate';
$config = ConfigFactory::createConfig($entity);

// read-only endpoint
Expand All @@ -11,7 +11,7 @@

array_push(
$config['api-tools-rest']["eCampApi\\V1\\Rest\\{$entity}\\Controller"]['collection_query_whitelist'],
'activityCategoryTemplateId'
'categoryTemplateId'
);

return $config;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use eCampApi\ConfigFactory;

$entity = 'CategoryContentType';
$config = ConfigFactory::createConfig($entity);

return $config;
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

use eCampApi\ConfigFactory;

$entity = 'CategoryContentTypeTemplate';
$config = ConfigFactory::createConfig($entity);

// read-only endpoint
$config['api-tools-rest']["eCampApi\\V1\\Rest\\{$entity}\\Controller"]['entity_http_methods'] = ['GET'];
$config['api-tools-rest']["eCampApi\\V1\\Rest\\{$entity}\\Controller"]['collection_http_methods'] = ['GET'];

array_push(
$config['api-tools-rest']["eCampApi\\V1\\Rest\\{$entity}\\Controller"]['collection_query_whitelist'],
'categoryTemplateId'
);

return $config;
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

use eCampApi\ConfigFactory;

$entity = 'ActivityCategoryTemplate';
$entity = 'CategoryTemplate';
$config = ConfigFactory::createConfig($entity);

// read-only endpoint
$config['api-tools-rest']["eCampApi\\V1\\Rest\\{$entity}\\Controller"]['entity_http_methods'] = ['GET'];
$config['api-tools-rest']["eCampApi\\V1\\Rest\\{$entity}\\Controller"]['collection_http_methods'] = ['GET'];

array_push(
$config['api-tools-rest']['eCampApi\\V1\\Rest\\ActivityCategoryTemplate\\Controller']['collection_query_whitelist'],
$config['api-tools-rest']['eCampApi\\V1\\Rest\\CategoryTemplate\\Controller']['collection_query_whitelist'],
'campTemplateId'
);

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace eCampApi\V1\Rest\Category;

use eCamp\Lib\Entity\BaseCollection;

class CategoryCollection extends BaseCollection {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace eCampApi\V1\Rest\Category;

use Laminas\ApiTools\Doctrine\Server\Resource\DoctrineResource;

class CategoryResource extends DoctrineResource {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace eCampApi\V1\Rest\CategoryContent;

use eCamp\Lib\Entity\BaseCollection;

class CategoryContentCollection extends BaseCollection {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace eCampApi\V1\Rest\CategoryContent;

use Laminas\ApiTools\Doctrine\Server\Resource\DoctrineResource;

class CategoryContentResource extends DoctrineResource {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace eCampApi\V1\Rest\CategoryContentTemplate;

use eCamp\Lib\Entity\BaseCollection;

class CategoryContentTemplateCollection extends BaseCollection {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace eCampApi\V1\Rest\CategoryContentTemplate;

use Laminas\ApiTools\Doctrine\Server\Resource\DoctrineResource;

class CategoryContentTemplateResource extends DoctrineResource {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace eCampApi\V1\Rest\CategoryContentType;

use eCamp\Lib\Entity\BaseCollection;

class CategoryContentTypeCollection extends BaseCollection {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace eCampApi\V1\Rest\CategoryContentType;

use Laminas\ApiTools\Doctrine\Server\Resource\DoctrineResource;

class CategoryContentTypeResource extends DoctrineResource {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace eCampApi\V1\Rest\CategoryContentTypeTemplate;

use eCamp\Lib\Entity\BaseCollection;

class CategoryContentTypeTemplateCollection extends BaseCollection {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace eCampApi\V1\Rest\CategoryContentTypeTemplate;

use Laminas\ApiTools\Doctrine\Server\Resource\DoctrineResource;

class CategoryContentTypeTemplateResource extends DoctrineResource {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace eCampApi\V1\Rest\CategoryTemplate;

use eCamp\Lib\Entity\BaseCollection;

class CategoryTemplateCollection extends BaseCollection {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace eCampApi\V1\Rest\CategoryTemplate;

use Laminas\ApiTools\Doctrine\Server\Resource\DoctrineResource;

class CategoryTemplateResource extends DoctrineResource {
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function testCreateSuccess() {
$activity = new Activity();
$activity->setCamp($this->activityResponsible->getCamp());
$activity->setTitle('Activity1');
$activity->setActivityCategory($this->activityResponsible->getActivity()->getActivityCategory());
$activity->setCategory($this->activityResponsible->getActivity()->getCategory());

$this->getEntityManager()->persist($activity);
$this->getEntityManager()->flush();
Expand Down
Loading