You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
812 B
39 lines
812 B
<?php
|
|
|
|
namespace SuperGear\Directus\Repositories;
|
|
|
|
use SuperGear\Directus\Collections\ItemCollection;
|
|
|
|
/**
|
|
* Abstract Repository to wrap ItemCollection
|
|
*
|
|
*
|
|
* @author Björn Hase
|
|
* @license http://opensource.org/licenses/MIT The MIT License
|
|
* @link https://gitlab.tentakelfabrik.de/super-gear/super-gear-directus GitHub Repository
|
|
*/
|
|
abstract class RepositoryAbstract
|
|
{
|
|
/** name of the collection */
|
|
protected $name;
|
|
|
|
/** client for itemCollection */
|
|
protected $itemCollection;
|
|
|
|
/**
|
|
*
|
|
*
|
|
*/
|
|
public function __construct()
|
|
{
|
|
if (!$this->name) {
|
|
throw new \Exception('$name is not set!');
|
|
};
|
|
|
|
$this->itemCollection = new ItemCollection(
|
|
env('DIRECTUS_API_URL'),
|
|
env('DIRECTUS_API_TOKEN')
|
|
);
|
|
}
|
|
}
|