init
This commit is contained in:
@@ -0,0 +1,224 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stemcell\Webinar\Model;
|
||||
|
||||
use Magento\Customer\Model\Session;
|
||||
use Magento\Framework\Data\Collection\AbstractDb;
|
||||
use Magento\Framework\Model\AbstractModel;
|
||||
use Magento\Framework\Model\Context;
|
||||
use Magento\Framework\Model\ResourceModel\AbstractResource;
|
||||
use Magento\Framework\Registry;
|
||||
use Stemcell\Webinar\Api\Data\WebinarInterface;
|
||||
|
||||
class Webinar extends AbstractModel implements WebinarInterface
|
||||
{
|
||||
protected Session $customerSession;
|
||||
|
||||
public function __construct(
|
||||
Context $context,
|
||||
Registry $registry,
|
||||
Session $customerSession,
|
||||
AbstractResource $resource = null,
|
||||
AbstractDb $resourceCollection = null,
|
||||
array $data = []
|
||||
) {
|
||||
$this->customerSession = $customerSession;
|
||||
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function _construct(): void
|
||||
{
|
||||
$this->_init(\Stemcell\Webinar\Model\ResourceModel\Webinar::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->getData(self::EMAIL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setEmail($email)
|
||||
{
|
||||
return $this->setData(self::EMAIL, $email);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setCustomerId(int $customerId)
|
||||
{
|
||||
return $this->setData(self::CUSTOMER_ID, $this->customerSession->getCustomerId());
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getCustomerId(): ?int
|
||||
{
|
||||
return $this->getData(self::CUSTOMER_ID);
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setName(string $name)
|
||||
{
|
||||
return $this->setData(self::NAME, $name);
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->getData(self::NAME);
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setMobile(string $mobile)
|
||||
{
|
||||
return $this->setData(self::MOBILE, $mobile);
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getMobile()
|
||||
{
|
||||
return $this->getData(self::MOBILE);
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setCompany(string $company)
|
||||
{
|
||||
return $this->setData(self::COMPANY, $company);
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getCompany()
|
||||
{
|
||||
return $this->getData(self::COMPANY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setTitle(string $title)
|
||||
{
|
||||
return $this->setData(self::TITLE, $title);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->getData(self::TITLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setState(string $state)
|
||||
{
|
||||
return $this->setData(self::STATE, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->getData(self::STATE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setCity(string $city)
|
||||
{
|
||||
return $this->setData(self::CITY, $city);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getCity()
|
||||
{
|
||||
return $this->getData(self::CITY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setStreet(string $street)
|
||||
{
|
||||
return $this->setData(self::STREET, $street);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getStreet()
|
||||
{
|
||||
return $this->getData(self::STREET);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setZip(string $zip)
|
||||
{
|
||||
return $this->setData(self::ZIP, $zip);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getZip()
|
||||
{
|
||||
return $this->getData(self::ZIP);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setFrom(string $from)
|
||||
{
|
||||
return $this->setData(self::FROM, $from);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getFrom()
|
||||
{
|
||||
return $this->getData(self::FROM);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setRemark(string $remark)
|
||||
{
|
||||
return $this->setData(self::REMARK, $remark);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getRemark()
|
||||
{
|
||||
return $this->getData(self::REMARK);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user