<?php
/**
* Inheritance: no
* Variants: no
*
* Fields Summary:
* - name [input]
* - active [checkbox]
* - location [input]
* - description [wysiwyg]
* - logo [image]
* - homepage [link]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\Sponsor\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\Sponsor\Listing|\Pimcore\Model\DataObject\Sponsor|null getByName($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Sponsor\Listing|\Pimcore\Model\DataObject\Sponsor|null getByActive($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Sponsor\Listing|\Pimcore\Model\DataObject\Sponsor|null getByLocation($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Sponsor\Listing|\Pimcore\Model\DataObject\Sponsor|null getByDescription($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Sponsor\Listing|\Pimcore\Model\DataObject\Sponsor|null getByLogo($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class Sponsor extends Concrete
{
protected $o_classId = "Sponsor";
protected $o_className = "Sponsor";
protected $name;
protected $active;
protected $location;
protected $description;
protected $logo;
protected $homepage;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\Sponsor
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get name - Name
* @return string|null
*/
public function getName(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("name");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->name;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set name - Name
* @param string|null $name
* @return \Pimcore\Model\DataObject\Sponsor
*/
public function setName(?string $name)
{
$this->name = $name;
return $this;
}
/**
* Get active - Active
* @return bool|null
*/
public function getActive(): ?bool
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("active");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->active;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set active - Active
* @param bool|null $active
* @return \Pimcore\Model\DataObject\Sponsor
*/
public function setActive(?bool $active)
{
$this->active = $active;
return $this;
}
/**
* Get location - Location
* @return string|null
*/
public function getLocation(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("location");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->location;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set location - Location
* @param string|null $location
* @return \Pimcore\Model\DataObject\Sponsor
*/
public function setLocation(?string $location)
{
$this->location = $location;
return $this;
}
/**
* Get description - Description
* @return string|null
*/
public function getDescription(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("description");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("description")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set description - Description
* @param string|null $description
* @return \Pimcore\Model\DataObject\Sponsor
*/
public function setDescription(?string $description)
{
$this->description = $description;
return $this;
}
/**
* Get logo - Logo
* @return \Pimcore\Model\Asset\Image|null
*/
public function getLogo(): ?\Pimcore\Model\Asset\Image
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("logo");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->logo;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set logo - Logo
* @param \Pimcore\Model\Asset\Image|null $logo
* @return \Pimcore\Model\DataObject\Sponsor
*/
public function setLogo(?\Pimcore\Model\Asset\Image $logo)
{
$this->logo = $logo;
return $this;
}
/**
* Get homepage - Homepage
* @return \Pimcore\Model\DataObject\Data\Link|null
*/
public function getHomepage(): ?\Pimcore\Model\DataObject\Data\Link
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("homepage");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->homepage;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set homepage - Homepage
* @param \Pimcore\Model\DataObject\Data\Link|null $homepage
* @return \Pimcore\Model\DataObject\Sponsor
*/
public function setHomepage(?\Pimcore\Model\DataObject\Data\Link $homepage)
{
$this->homepage = $homepage;
return $this;
}
}