<?php
	
declare(strict_types=1);

namespace D3\ManufacturerInformation\Modules\Application\Model;


use D3\ManufacturerInformation\Application\Model\Constants;
use OxidEsales\Eshop\Application\Model\Manufacturer;
use OxidEsales\Eshop\Core\Registry;

class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
{
	/**
	 * @param string $sValue
	 * @return void
	 */
	public function d3SetLongdesc(string $sValue) :bool
	{
		if ($this->getId() and $this->isLoaded()){
			try {
				$this->assign([Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME => $sValue]);
				$this->save();
			}catch (\Exception $exception){
				Registry::getLogger()->error($exception->getMessage());
			}
		}
		
		return true;
	}
	
	/**
	 * @return string
	 */
	public function d3GetLongdesc(): string
	{
		return $this->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
	}
	
	/**
	 * @return string
	 */
	public function getD3LongDescTableColumnName() :string
	{
		return $sParamName = $this->getViewName(true).'__'.Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME;
	}
}