Source of file Affiliation.php
Size: 1,761 Bytes - Last Modified: 2021-12-23T10:38:48+00:00
/var/www/docs.ssmods.com/process/src/code/model/Affiliation.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 | <?php class Affiliation extends DataObject { public static $db = array( "Title" => "Varchar(100)", "Code" => "Varchar(100)", "Link" => "Varchar(100)", "Sort" => "Int" ); public static $has_one = array( "Parent" => "SiteTree", "Logo" => "Image" ); public static function get_has_many_complex_table_field($controller, $name) { return new HasManyComplexTableField( $controller, $name, "Affiliation", $fieldList = self::$summary_fields, $detailFormFields = null, $sourceFilter = "ParentID = ".$controller->ID, $sourceSort = "Sort ASC, Title ASC", $sourceJoin = "" ); } public function getCode() { if (!$this->getField("Code")) { return _t('Affiliation.GETCMSAFFLIATIONIDPREFIX', 'Affiliation').$this->ID; } return $this->getField("Code"); } public static $searchable_fields = array( "Title" => "PartialMatchFilter", "Code" => "PartialMatchFilter", "Link" => "PartialMatchFilter" ); public static $summary_fields = array( "Title" => "Title", "Code" => "Code", "Link" => "Link" ); public static $field_labels = array( "Sort" => "Sorting Index Number (lower numbers show first)" ); public static $singular_name = "Affiliation"; public static $plural_name = "Affiliations"; //CRUD settings public static $default_sort = "Sort ASC, Title ASC"; public static $defaults = array( "Sort" => 100 ); public function populateDefaults() { $this->Sort = 100; parent::populateDefaults(); } } |