<?php
/**
* Inheritance: no
* Variants: no
Fields Summary:
- localizedfields [localizedfields]
-- title [input]
-- contract [input]
-- description [wysiwyg]
- email [email]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\Job\Listing getList()
* @method static \Pimcore\Model\DataObject\Job\Listing|\Pimcore\Model\DataObject\Job|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Job\Listing|\Pimcore\Model\DataObject\Job|null getByTitle($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Job\Listing|\Pimcore\Model\DataObject\Job|null getByContract($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Job\Listing|\Pimcore\Model\DataObject\Job|null getByDescription($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Job\Listing|\Pimcore\Model\DataObject\Job|null getByEmail($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class Job extends Concrete
{
protected $o_classId = "5";
protected $o_className = "Job";
protected $localizedfields;
protected $email;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\Job
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get localizedfields -
* @return \Pimcore\Model\DataObject\Localizedfield|null
*/
public function getLocalizedfields(): ?\Pimcore\Model\DataObject\Localizedfield
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("localizedfields");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get title - title
* @return string|null
*/
public function getTitle($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("title", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("title");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get contract - contract
* @return string|null
*/
public function getContract($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("contract", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("contract");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get description - description
* @return string|null
*/
public function getDescription($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("description", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("description");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set localizedfields -
* @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
* @return \Pimcore\Model\DataObject\Job
*/
public function setLocalizedfields(?\Pimcore\Model\DataObject\Localizedfield $localizedfields)
{
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getLocalizedfields();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$this->markFieldDirty("localizedfields", true);
$this->localizedfields = $localizedfields;
return $this;
}
/**
* Set title - title
* @param string|null $title
* @return \Pimcore\Model\DataObject\Job
*/
public function setTitle (?string $title, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("title", $title, $language, !$isEqual);
return $this;
}
/**
* Set contract - contract
* @param string|null $contract
* @return \Pimcore\Model\DataObject\Job
*/
public function setContract (?string $contract, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("contract", $contract, $language, !$isEqual);
return $this;
}
/**
* Set description - description
* @param string|null $description
* @return \Pimcore\Model\DataObject\Job
*/
public function setDescription (?string $description, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("description", $description, $language, !$isEqual);
return $this;
}
/**
* Get email - Email
* @return string|null
*/
public function getEmail(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("email");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->email;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set email - Email
* @param string|null $email
* @return \Pimcore\Model\DataObject\Job
*/
public function setEmail(?string $email)
{
$this->email = $email;
return $this;
}
}