/** * Add the default for the Date being the current day. */ public function populateDefaults() { parent::populateDefaults(); if (!isset($this->Date) || $this->Date === null) { $this->Date = SS_Datetime::now()->Format('Y-m-d H:i:s'); } }
/** * standard SS method * */ public function populateDefaults() { parent::populateDefaults(); $continuePage = DataObject::get_one("ProductGroup", "ParentID = 0"); if ($continuePage || ($continuePage = DataObject::get_one("ProductGroup"))) { $this->ContinuePageID = $continuePage->ID; } }
public function populateDefaults() { parent::populateDefaults(); $this->Title = "Search"; $this->MenuTitle = "Search"; $this->ShowInMenus = 0; $this->ShowInSearch = 0; $this->URLSegment = "search"; }
/** * Sets the ShowInMenus field to false. */ public function populateDefaults() { $this->ShowInMenus = 0; parent::populateDefaults(); }
/** * Sets the Date field to the current date. */ public function populateDefaults() { $this->StartDate = date('Y-m-d 07:00:00'); $this->EndDate = date('Y-m-d 07:00:00'); parent::populateDefaults(); }
/** * Overload so that the default date is today. */ public function populateDefaults(){ parent::populateDefaults(); $this->setField('Date', date('Y-m-d H:i:s', strtotime('now'))); }
public function onAfterWrite() { if ($this->isChanged('ID')) { $section = new MemberProfileFieldsSection(); $section->ParentID = $this->ID; $section->write(); } parent::populateDefaults(); }
public function populateDefaults() { parent::populateDefaults(); }
public function populateDefaults() { $this->Date = date('Y-m-d'); parent::populateDefaults(); }