mirror of
https://framagit.org/tykayn/date-poll-api
synced 2023-08-25 08:23:11 +02:00
group date and slices in display of poll
This commit is contained in:
parent
723c774d51
commit
c0791d52ac
@ -61,12 +61,23 @@ class Choice {
|
||||
}
|
||||
|
||||
public function display( $kind = 'text' ): array {
|
||||
$fields = [
|
||||
'id' => $this->getId(),
|
||||
'created_at' => $this->getCreatedAtAsString(),
|
||||
'name' => $this->getName(),
|
||||
'url' => $this->getUrl(),
|
||||
];
|
||||
if($kind == 'text'){
|
||||
$fields = [
|
||||
'id' => $this->getId(),
|
||||
'created_at' => $this->getCreatedAtAsString(),
|
||||
'name' => $this->getName(),
|
||||
'url' => $this->getUrl(),
|
||||
];
|
||||
}
|
||||
elseif($kind=='date'){
|
||||
$fields = [
|
||||
'id' => $this->getId(),
|
||||
'created_at' => $this->getCreatedAtAsString(),
|
||||
'name' => $this->getName(),
|
||||
// 'url' => $this->getUrl(),
|
||||
];
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
|
1237
src/Entity/Poll.php
1237
src/Entity/Poll.php
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user