1
0
mirror of synced 2024-11-25 13:16:01 +03:00

Removed CommonFields from models, MessageOrderPaymentStatus getter fix

This commit is contained in:
Pavel 2019-06-26 11:17:49 +03:00
parent 0bb750afa9
commit 34812dd1bd
12 changed files with 649 additions and 128 deletions

View File

@ -29,7 +29,31 @@ use JMS\Serializer\Annotation\Type;
*/ */
class Bot class Bot
{ {
use CommonFields; /**
* @var string $id
*
* @Type("string")
* @Accessor(getter="getId",setter="setId")
*/
private $id;
/**
* @var \DateTime $createdAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
* @SkipWhenEmpty()
*/
private $createdAt;
/**
* @var \DateTime $updatedAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
* @SkipWhenEmpty()
*/
private $updatedAt;
/** /**
* @var string $name * @var string $name
@ -112,6 +136,54 @@ class Bot
*/ */
private $isSystem; private $isSystem;
/**
* @return string
*/
public function getId(): string
{
return $this->id;
}
/**
* @param string $id
*/
public function setId(string $id): void
{
$this->id = $id;
}
/**
* @return \DateTime
*/
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
/**
* @param \DateTime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt): void
{
$this->createdAt = $createdAt;
}
/**
* @return \DateTime
*/
public function getUpdatedAt(): \DateTime
{
return $this->updatedAt;
}
/**
* @param \DateTime $updatedAt
*/
public function setUpdatedAt(\DateTime $updatedAt): void
{
$this->updatedAt = $updatedAt;
}
/** /**
* @return string * @return string
*/ */

View File

@ -13,7 +13,7 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Channel; namespace RetailCrm\Mg\Bot\Model\Entity\Channel;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields; use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Accessor; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\Type; use JMS\Serializer\Annotation\Type;
@ -29,7 +29,29 @@ use JMS\Serializer\Annotation\Type;
*/ */
class Channel class Channel
{ {
use CommonFields; /**
* @var string $id
*
* @Type("string")
* @Accessor(getter="getId",setter="setId")
*/
private $id;
/**
* @var \DateTime $createdAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
*/
private $createdAt;
/**
* @var \DateTime $updatedAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
*/
private $updatedAt;
/** /**
* @var \DateTime $activatedAt * @var \DateTime $activatedAt
@ -79,6 +101,54 @@ class Channel
*/ */
private $name; private $name;
/**
* @return string
*/
public function getId(): string
{
return $this->id;
}
/**
* @param string $id
*/
public function setId(string $id): void
{
$this->id = $id;
}
/**
* @return \DateTime
*/
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
/**
* @param \DateTime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt): void
{
$this->createdAt = $createdAt;
}
/**
* @return \DateTime
*/
public function getUpdatedAt(): \DateTime
{
return $this->updatedAt;
}
/**
* @param \DateTime $updatedAt
*/
public function setUpdatedAt(\DateTime $updatedAt): void
{
$this->updatedAt = $updatedAt;
}
/** /**
* @return \DateTime * @return \DateTime
*/ */

View File

@ -13,9 +13,7 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Chat; namespace RetailCrm\Mg\Bot\Model\Entity\Chat;
use JMS\Serializer\Annotation as Serializer;
use RetailCrm\Mg\Bot\Model\Entity\Channel\Channel; use RetailCrm\Mg\Bot\Model\Entity\Channel\Channel;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields;
use JMS\Serializer\Annotation\Accessor; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty; use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type; use JMS\Serializer\Annotation\Type;
@ -33,7 +31,29 @@ use RetailCrm\Mg\Bot\Model\Entity\Customer;
*/ */
class Chat class Chat
{ {
use CommonFields; /**
* @var string $id
*
* @Type("string")
* @Accessor(getter="getId",setter="setId")
*/
private $id;
/**
* @var \DateTime $createdAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
*/
private $createdAt;
/**
* @var \DateTime $updatedAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
*/
private $updatedAt;
/** /**
* @var string $avatar * @var string $avatar
@ -100,6 +120,54 @@ class Chat
*/ */
private $lastActivity; private $lastActivity;
/**
* @return string
*/
public function getId(): string
{
return $this->id;
}
/**
* @param string $id
*/
public function setId(string $id): void
{
$this->id = $id;
}
/**
* @return \DateTime
*/
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
/**
* @param \DateTime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt): void
{
$this->createdAt = $createdAt;
}
/**
* @return \DateTime
*/
public function getUpdatedAt(): \DateTime
{
return $this->updatedAt;
}
/**
* @param \DateTime $updatedAt
*/
public function setUpdatedAt(\DateTime $updatedAt): void
{
$this->updatedAt = $updatedAt;
}
/** /**
* @return string * @return string
*/ */

View File

@ -16,7 +16,6 @@ namespace RetailCrm\Mg\Bot\Model\Entity\Chat;
use JMS\Serializer\Annotation\Accessor; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty; use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type; use JMS\Serializer\Annotation\Type;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields;
/** /**
* PHP version 7.0 * PHP version 7.0
@ -30,7 +29,30 @@ use RetailCrm\Mg\Bot\Model\Entity\CommonFields;
*/ */
class ChatMember class ChatMember
{ {
use CommonFields; /**
* @var string $id
*
* @Type("string")
* @Accessor(getter="getId",setter="setId")
*/
private $id;
/**
* @var \DateTime $createdAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
*/
private $createdAt;
/**
* @var \DateTime $updatedAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
* @SkipWhenEmpty()
*/
private $updatedAt;
/** /**
* @var int $chatId * @var int $chatId
@ -68,6 +90,54 @@ class ChatMember
*/ */
private $state; private $state;
/**
* @return string
*/
public function getId(): string
{
return $this->id;
}
/**
* @param string $id
*/
public function setId(string $id): void
{
$this->id = $id;
}
/**
* @return \DateTime
*/
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
/**
* @param \DateTime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt): void
{
$this->createdAt = $createdAt;
}
/**
* @return \DateTime
*/
public function getUpdatedAt(): \DateTime
{
return $this->updatedAt;
}
/**
* @param \DateTime $updatedAt
*/
public function setUpdatedAt(\DateTime $updatedAt): void
{
$this->updatedAt = $updatedAt;
}
/** /**
* @return int * @return int
*/ */

View File

@ -29,7 +29,30 @@ use JMS\Serializer\Annotation\Type;
*/ */
class Command class Command
{ {
use CommonFields; /**
* @var string $id
*
* @Type("string")
* @Accessor(getter="getId",setter="setId")
*/
private $id;
/**
* @var \DateTime $createdAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
*/
private $createdAt;
/**
* @var \DateTime $updatedAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
* @SkipWhenEmpty()
*/
private $updatedAt;
/** /**
* @var string $name * @var string $name
@ -49,6 +72,54 @@ class Command
*/ */
private $description; private $description;
/**
* @return string
*/
public function getId(): string
{
return $this->id;
}
/**
* @param string $id
*/
public function setId(string $id): void
{
$this->id = $id;
}
/**
* @return \DateTime
*/
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
/**
* @param \DateTime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt): void
{
$this->createdAt = $createdAt;
}
/**
* @return \DateTime
*/
public function getUpdatedAt(): \DateTime
{
return $this->updatedAt;
}
/**
* @param \DateTime $updatedAt
*/
public function setUpdatedAt(\DateTime $updatedAt): void
{
$this->updatedAt = $updatedAt;
}
/** /**
* @return string * @return string
*/ */

View File

@ -1,107 +0,0 @@
<?php
/**
* PHP version 7.0
*
* CommonFields trait
*
* @package RetailCrm\Mg\Bot\Model\Entity
* @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers
*/
namespace RetailCrm\Mg\Bot\Model\Entity;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
use Symfony\Component\Validator\Constraints\Date;
/**
* PHP version 7.0
*
* CommonFields trait
*
* @package RetailCrm\Mg\Bot\Model\Entity
* @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers
*/
trait CommonFields
{
/**
* @var string $id
*
* @Type("string")
* @Accessor(getter="getId",setter="setId")
* @SkipWhenEmpty()
*/
private $id;
/**
* @var \DateTime $createdAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
* @SkipWhenEmpty()
*/
private $createdAt;
/**
* @var \DateTime $updatedAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
* @SkipWhenEmpty()
*/
private $updatedAt;
/**
* @return string
*/
public function getId(): string
{
return $this->id;
}
/**
* @param string $id
*/
public function setId(string $id)
{
$this->id = $id;
}
/**
* @return \DateTime
*/
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
/**
* @param \DateTime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
}
/**
* @return \DateTime
*/
public function getUpdatedAt(): \DateTime
{
return $this->updatedAt;
}
/**
* @param \DateTime $updatedAt
*/
public function setUpdatedAt(\DateTime $updatedAt)
{
$this->updatedAt = $updatedAt;
}
}

View File

@ -31,7 +31,30 @@ use JMS\Serializer\Annotation\Type;
*/ */
class Customer class Customer
{ {
use CommonFields; /**
* @var string $id
*
* @Type("string")
* @Accessor(getter="getId",setter="setId")
*/
private $id;
/**
* @var \DateTime $createdAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
*/
private $createdAt;
/**
* @var \DateTime $updatedAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
* @SkipWhenEmpty()
*/
private $updatedAt;
/** /**
* @var string $externalId * @var string $externalId
@ -152,6 +175,54 @@ class Customer
*/ */
private $email; private $email;
/**
* @return string
*/
public function getId(): string
{
return $this->id;
}
/**
* @param string $id
*/
public function setId(string $id): void
{
$this->id = $id;
}
/**
* @return \DateTime
*/
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
/**
* @param \DateTime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt): void
{
$this->createdAt = $createdAt;
}
/**
* @return \DateTime
*/
public function getUpdatedAt(): \DateTime
{
return $this->updatedAt;
}
/**
* @param \DateTime $updatedAt
*/
public function setUpdatedAt(\DateTime $updatedAt): void
{
$this->updatedAt = $updatedAt;
}
/** /**
* @return string * @return string
*/ */

View File

@ -29,7 +29,30 @@ use JMS\Serializer\Annotation\Type;
*/ */
class Dialog class Dialog
{ {
use CommonFields; /**
* @var string $id
*
* @Type("string")
* @Accessor(getter="getId",setter="setId")
*/
private $id;
/**
* @var \DateTime $createdAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
*/
private $createdAt;
/**
* @var \DateTime $updatedAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
* @SkipWhenEmpty()
*/
private $updatedAt;
/** /**
* @var int $botId * @var int $botId
@ -103,6 +126,54 @@ class Dialog
*/ */
private $isActive; private $isActive;
/**
* @return string
*/
public function getId(): string
{
return $this->id;
}
/**
* @param string $id
*/
public function setId(string $id): void
{
$this->id = $id;
}
/**
* @return \DateTime
*/
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
/**
* @param \DateTime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt): void
{
$this->createdAt = $createdAt;
}
/**
* @return \DateTime
*/
public function getUpdatedAt(): \DateTime
{
return $this->updatedAt;
}
/**
* @param \DateTime $updatedAt
*/
public function setUpdatedAt(\DateTime $updatedAt): void
{
$this->updatedAt = $updatedAt;
}
/** /**
* @return int * @return int
*/ */

View File

@ -13,7 +13,6 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Message; namespace RetailCrm\Mg\Bot\Model\Entity\Message;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields;
use RetailCrm\Mg\Bot\Model\Entity\Dialog; use RetailCrm\Mg\Bot\Model\Entity\Dialog;
use RetailCrm\Mg\Bot\Model\Entity\User; use RetailCrm\Mg\Bot\Model\Entity\User;
use JMS\Serializer\Annotation\Accessor; use JMS\Serializer\Annotation\Accessor;
@ -32,7 +31,30 @@ use JMS\Serializer\Annotation\Type;
*/ */
class Message class Message
{ {
use CommonFields; /**
* @var string $id
*
* @Type("string")
* @Accessor(getter="getId",setter="setId")
*/
private $id;
/**
* @var \DateTime $createdAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
*/
private $createdAt;
/**
* @var \DateTime $updatedAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
* @SkipWhenEmpty()
*/
private $updatedAt;
/** /**
* @var string $actions * @var string $actions
@ -187,6 +209,54 @@ class Message
*/ */
private $product; private $product;
/**
* @return string
*/
public function getId(): string
{
return $this->id;
}
/**
* @param string $id
*/
public function setId(string $id): void
{
$this->id = $id;
}
/**
* @return \DateTime
*/
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
/**
* @param \DateTime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt): void
{
$this->createdAt = $createdAt;
}
/**
* @return \DateTime
*/
public function getUpdatedAt(): \DateTime
{
return $this->updatedAt;
}
/**
* @param \DateTime $updatedAt
*/
public function setUpdatedAt(\DateTime $updatedAt): void
{
$this->updatedAt = $updatedAt;
}
/** /**
* @return string * @return string
*/ */

View File

@ -16,7 +16,6 @@ namespace RetailCrm\Mg\Bot\Model\Entity\Message;
use JMS\Serializer\Annotation\Accessor; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty; use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type; use JMS\Serializer\Annotation\Type;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields;
/** /**
* PHP version 7.0 * PHP version 7.0
@ -30,8 +29,6 @@ use RetailCrm\Mg\Bot\Model\Entity\CommonFields;
*/ */
class MessageOrderPaymentStatus class MessageOrderPaymentStatus
{ {
use CommonFields;
/** /**
* @var string $name * @var string $name
* *
@ -69,7 +66,7 @@ class MessageOrderPaymentStatus
/** /**
* @return bool * @return bool
*/ */
public function isPayed(): bool public function getPayed(): bool
{ {
return $this->payed; return $this->payed;
} }

View File

@ -13,7 +13,6 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Message; namespace RetailCrm\Mg\Bot\Model\Entity\Message;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields;
use JMS\Serializer\Annotation\Accessor; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty; use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type; use JMS\Serializer\Annotation\Type;
@ -30,8 +29,6 @@ use JMS\Serializer\Annotation\Type;
*/ */
class MessageQuantity class MessageQuantity
{ {
use CommonFields;
/** /**
* @var float $value * @var float $value
* *

View File

@ -30,7 +30,30 @@ use JMS\Serializer\Annotation\Type;
*/ */
class User class User
{ {
use CommonFields; /**
* @var string $id
*
* @Type("string")
* @Accessor(getter="getId",setter="setId")
*/
private $id;
/**
* @var \DateTime $createdAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
*/
private $createdAt;
/**
* @var \DateTime $updatedAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
* @SkipWhenEmpty()
*/
private $updatedAt;
/** /**
* @var string $externalId * @var string $externalId
@ -126,6 +149,54 @@ class User
*/ */
private $revokedAt; private $revokedAt;
/**
* @return string
*/
public function getId(): string
{
return $this->id;
}
/**
* @param string $id
*/
public function setId(string $id): void
{
$this->id = $id;
}
/**
* @return \DateTime
*/
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
/**
* @param \DateTime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt): void
{
$this->createdAt = $createdAt;
}
/**
* @return \DateTime
*/
public function getUpdatedAt(): \DateTime
{
return $this->updatedAt;
}
/**
* @param \DateTime $updatedAt
*/
public function setUpdatedAt(\DateTime $updatedAt): void
{
$this->updatedAt = $updatedAt;
}
/** /**
* @return string * @return string
*/ */