Source of file CountryTranslation.php
Size: 2,413 Bytes - Last Modified: 2021-12-23T10:21:36+00:00
/var/www/docs.ssmods.com/process/src/src/Model/Customer/CountryTranslation.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 | <?php namespace SilverCart\Model\Customer; use SilverCart\Dev\Tools; use SilverCart\Model\Customer\Country; use SilverCart\Model\Product\Product; use SilverStripe\ORM\DataObject; /** * Translations for Country. * * @package SilverCart * @subpackage Model_Customer * @author Sebastian Diel <sdiel@pixeltricks.de> * @since 26.09.2017 * @copyright 2017 pixeltricks GmbH * @license see license file in modules root directory */ class CountryTranslation extends DataObject { /** * Attributes. * * @var array */ private static $db = array( 'Title' => 'Varchar(255)', ); /** * 1:1 or 1:n relationships. * * @var array */ private static $has_one = array( 'Country' => Country::class, ); /** * DB table name * * @var string */ private static $table_name = 'SilvercartCountryTranslation'; /** * Returns the translated singular name of the object. If no translation exists * the class name will be returned. * * @return string The objects singular name * * @author Roland Lehmann <rlehmann@pixeltricks.de> * @since 13.07.2012 */ public function singular_name() { return Tools::singular_name_for($this); } /** * Returns the translated plural name of the object. If no translation exists * the class name will be returned. * * @return string the objects plural name * * @author Roland Lehmann <rlehmann@pixeltricks.de> * @since 13.07.2012 */ public function plural_name() { return Tools::plural_name_for($this); } /** * Field labels for display in tables. * * @param boolean $includerelations A boolean value to indicate if the labels returned include relation fields * * @return array * * @author Sebastian Diel <sdiel@pixeltricks.de> * @since 26.04.2012 */ public function fieldLabels($includerelations = true) { $fieldLabels = array_merge( parent::fieldLabels($includerelations), array( 'Title' => Product::singleton()->fieldLabel('Title'), 'Country' => Country::singleton()->singular_name(), ) ); $this->extend('updateFieldLabels', $fieldLabels); return $fieldLabels; } } |