-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41cb22a
commit 4f15373
Showing
4 changed files
with
258 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,78 @@ | ||
<?php | ||
|
||
/** | ||
* PHP version 7.1 | ||
* | ||
* Tag entity | ||
* | ||
* @package RetailCrm\Mg\Bot\Model\Entity | ||
*/ | ||
|
||
namespace RetailCrm\Mg\Bot\Model\Entity; | ||
|
||
use JMS\Serializer\Annotation\Accessor; | ||
use JMS\Serializer\Annotation\SkipWhenEmpty; | ||
use JMS\Serializer\Annotation\Type; | ||
use RetailCrm\Mg\Bot\Model\ModelInterface; | ||
use Symfony\Component\Validator\Constraints as Assert; | ||
|
||
/** | ||
* Tag class | ||
* | ||
* @package RetailCrm\Mg\Bot\Model\Entity | ||
*/ | ||
class Tag implements ModelInterface | ||
{ | ||
/** | ||
* @var string $name | ||
* | ||
* @Type("string") | ||
* @Accessor(getter="getName",setter="setName") | ||
* | ||
* @Assert\NotBlank | ||
*/ | ||
private $name; | ||
|
||
/** | ||
* @var string $colorCode | ||
* | ||
* @Type("string") | ||
* @Accessor(getter="getColorCode",setter="setColorCode") | ||
* @SkipWhenEmpty() | ||
*/ | ||
private $colorCode; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getName(): string | ||
{ | ||
return $this->name; | ||
} | ||
|
||
/** | ||
* @param string $name | ||
* @return void | ||
*/ | ||
public function setName(string $name): void | ||
{ | ||
$this->name = $name; | ||
} | ||
|
||
/** | ||
* @return string|null | ||
*/ | ||
public function getColorCode(): ?string | ||
{ | ||
return $this->colorCode; | ||
} | ||
|
||
/** | ||
* @param string $colorCode | ||
* @return void | ||
*/ | ||
public function setColorCode(string $colorCode): void | ||
{ | ||
$this->colorCode = $colorCode; | ||
} | ||
} |
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,78 @@ | ||
<?php | ||
|
||
/** | ||
* PHP version 7.1 | ||
* | ||
* Dialog add or delete tag request | ||
* | ||
* @package RetailCrm\Mg\Bot\Model\Request | ||
*/ | ||
|
||
namespace RetailCrm\Mg\Bot\Model\Request; | ||
|
||
use JMS\Serializer\Annotation\Accessor; | ||
use JMS\Serializer\Annotation\SkipWhenEmpty; | ||
use JMS\Serializer\Annotation\Type; | ||
use RetailCrm\Mg\Bot\Model\Entity\Tag; | ||
use RetailCrm\Mg\Bot\Model\ModelInterface; | ||
|
||
/** | ||
* DialogTagRequest class | ||
* | ||
* @package RetailCrm\Mg\Bot\Model\Request | ||
*/ | ||
class DialogTagRequest implements ModelInterface | ||
{ | ||
/** | ||
* @var int $dialogId | ||
* | ||
* @Type("int") | ||
* @Accessor(getter="getDialogId", setter="setDialogId") | ||
* @SkipWhenEmpty() | ||
*/ | ||
private $dialogId; | ||
|
||
/** | ||
* @var Tag[] $tags | ||
* | ||
* @Type("array") | ||
* @Accessor(getter="getTags", setter="setTags") | ||
* @SkipWhenEmpty() | ||
*/ | ||
private $tags; | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getDialogId(): int | ||
{ | ||
return $this->dialogId; | ||
} | ||
|
||
/** | ||
* @param int $dialogId | ||
* @return void | ||
*/ | ||
public function setDialogId(int $dialogId): void | ||
{ | ||
$this->dialogId = $dialogId; | ||
} | ||
|
||
/** | ||
* @return Tag[] | ||
*/ | ||
public function getTags(): array | ||
{ | ||
return $this->tags; | ||
} | ||
|
||
/** | ||
* @param Tag[] $tags | ||
* @return void | ||
*/ | ||
public function setTags(array $tags): void | ||
{ | ||
$this->tags = $tags; | ||
} | ||
|
||
} |
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