Skip to content

Commit

Permalink
add page
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Jul 10, 2021
1 parent 8c856c3 commit 53b36bf
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/consumer.json
Expand Up @@ -272,6 +272,29 @@
"T": "Grant"
}
},
"Page": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"title": {
"type": "string"
},
"slug": {
"type": "string"
},
"content": {
"type": "string"
}
}
},
"Page_Collection": {
"$ref": "common:Collection",
"$template": {
"T": "Page"
}
},
"Plan": {
"type": "object",
"properties": {
Expand Down
88 changes: 88 additions & 0 deletions src/Consumer/Page.php
@@ -0,0 +1,88 @@
<?php

declare(strict_types = 1);

namespace Fusio\Model\Consumer;


class Page implements \JsonSerializable
{
/**
* @var int|null
*/
protected $id;
/**
* @var string|null
*/
protected $title;
/**
* @var string|null
*/
protected $slug;
/**
* @var string|null
*/
protected $content;
/**
* @param int|null $id
*/
public function setId(?int $id) : void
{
$this->id = $id;
}
/**
* @return int|null
*/
public function getId() : ?int
{
return $this->id;
}
/**
* @param string|null $title
*/
public function setTitle(?string $title) : void
{
$this->title = $title;
}
/**
* @return string|null
*/
public function getTitle() : ?string
{
return $this->title;
}
/**
* @param string|null $slug
*/
public function setSlug(?string $slug) : void
{
$this->slug = $slug;
}
/**
* @return string|null
*/
public function getSlug() : ?string
{
return $this->slug;
}
/**
* @param string|null $content
*/
public function setContent(?string $content) : void
{
$this->content = $content;
}
/**
* @return string|null
*/
public function getContent() : ?string
{
return $this->content;
}
public function jsonSerialize()
{
return (object) array_filter(array('id' => $this->id, 'title' => $this->title, 'slug' => $this->slug, 'content' => $this->content), static function ($value) : bool {
return $value !== null;
});
}
}
12 changes: 12 additions & 0 deletions src/Consumer/Page_Collection.php
@@ -0,0 +1,12 @@
<?php

declare(strict_types = 1);

namespace Fusio\Model\Consumer;

/**
* @extends \Fusio\Model\Collection<Page>
*/
class Page_Collection extends \Fusio\Model\Collection
{
}

0 comments on commit 53b36bf

Please sign in to comment.