-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Update] Add tags and supertags (groups/super_groups)
- Loading branch information
Showing
5 changed files
with
166 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Oveleon\ContaoPropstackApiBundle\Controller\Options; | ||
|
||
final class SuperTagOptions extends Options | ||
{ | ||
protected function configure(): void | ||
{ | ||
$this->set(Options::MODE_READ, [ | ||
'entity', | ||
'include' | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Oveleon\ContaoPropstackApiBundle\Controller\Options; | ||
|
||
final class TagOptions extends Options | ||
{ | ||
protected function configure(): void | ||
{ | ||
$this->set(Options::MODE_READ, [ | ||
'super_group', | ||
'entity' | ||
]); | ||
|
||
$this->set(Options::MODE_CREATE, [ | ||
'super_group_id', | ||
'entity', | ||
'name', | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Oveleon\ContaoPropstackApiBundle\Controller\Tag; | ||
|
||
use Oveleon\ContaoPropstackApiBundle\Controller\Options\Options; | ||
use Oveleon\ContaoPropstackApiBundle\Controller\Options\SuperTagOptions; | ||
use Oveleon\ContaoPropstackApiBundle\Controller\PropstackController; | ||
|
||
/** | ||
* Handle super tag calls | ||
* | ||
* @link https://docs.propstack.de/reference/merkmale | ||
* | ||
* @author Sebastian Zoglowek <https://github.com/zoglo> | ||
*/ | ||
class SuperTagController extends PropstackController | ||
{ | ||
protected string $route = 'super_groups'; | ||
|
||
/** | ||
* Read super tags | ||
*/ | ||
public function read(array $parameters) | ||
{ | ||
$this->call( | ||
(new SuperTagOptions(Options::MODE_READ)) | ||
->validate($parameters), | ||
self::METHOD_READ | ||
); | ||
|
||
return $this->getResponse(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace Oveleon\ContaoPropstackApiBundle\Controller\Tag; | ||
|
||
use Oveleon\ContaoPropstackApiBundle\Controller\Options\Options; | ||
use Oveleon\ContaoPropstackApiBundle\Controller\Options\TagOptions; | ||
use Oveleon\ContaoPropstackApiBundle\Controller\PropstackController; | ||
|
||
/** | ||
* Handle tag calls | ||
* | ||
* @link https://docs.propstack.de/reference/merkmale | ||
* | ||
* @author Sebastian Zoglowek <https://github.com/zoglo> | ||
*/ | ||
class TagController extends PropstackController | ||
{ | ||
protected string $route = 'groups'; | ||
|
||
/** | ||
* Read tags | ||
*/ | ||
public function read(array $parameters) | ||
{ | ||
$this->call( | ||
(new TagOptions(Options::MODE_READ)) | ||
->validate($parameters), | ||
self::METHOD_READ | ||
); | ||
|
||
return $this->getResponse(); | ||
} | ||
|
||
/** | ||
* Create tags | ||
*/ | ||
public function create(array $parameters) | ||
{ | ||
$this->call( | ||
(new TagOptions(Options::MODE_CREATE)) | ||
->validate($parameters), | ||
self::METHOD_CREATE | ||
); | ||
|
||
return $this->getResponse(); | ||
} | ||
} |