public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $this->makeRecordViewer($fields, "Articles", $this->Articles());
     $this->makeRecordViewer($fields, "Images", $this->Images());
     return $fields;
 }
 protected function fetch()
 {
     if (!$this->Fetched || HailApiObject::isOutdated($this->Fetched)) {
         $this->fetchMethod();
         $this->Fetched = date("Y-m-d H:i:s");
         $this->write();
     }
 }
 /**
  * @param SS_HTTPRequest $request
  */
 public function run($request)
 {
     foreach (HailApiObject::fetchables() as $hailObjType) {
         echo "Fetching {$hailObjType}";
         $hailApiObject = singleton($hailObjType);
         $hailApiObject->fetch();
     }
 }
 public function process()
 {
     $times = $this->times;
     // needed due to quirks with __set
     $times[] = date('Y-m-d H:i:s');
     $this->times = $times;
     $hailObjTypes = HailApiObject::fetchables();
     $hailObjType = $hailObjTypes[$this->currentStep];
     $this->addMessage("Fetching {$hailObjType}");
     $hailApiObject = singleton($hailObjType);
     $hailApiObject->fetch();
     $this->currentStep++;
     if ($this->currentStep >= $this->totalSteps) {
         $this->isComplete = true;
     }
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // Show relations
     /*$this->makeRecordViewer($fields, "Tags", $this->Tags());
     		$this->makeRecordViewer($fields, "Images", $this->ImageGallery());
     		
     		// Display a thumbnail of the hero image
     		if ($this->HeroImage()) {
     			$heroField = new LiteralField (
     				"HeroImage",
     				$this->HeroImage()->getThumbnail()
     			);
     			$fields->replaceField('HeroImageID', $heroField);
     		} else {
     			$fields->removeByName('HeroImageID');
     		}*/
     return $fields;
 }
 protected function importHailData($data)
 {
     $originalUpdated = $this->Updated;
     $return = parent::importHailData($data);
     if ($originalUpdated != $this->Updated) {
         $this->refresh();
     }
     return $return;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // Display relations
     $this->makeRecordViewer($fields, "Tags", $this->Tags());
     $this->makeRecordViewer($fields, "Articles", $this->Articles());
     // Hide all those URL
     $fields->removeByName('Url150Square');
     $fields->removeByName('Url500');
     $fields->removeByName('Url500Square');
     $fields->removeByName('Url1000');
     $fields->removeByName('Url1000Square');
     $fields->removeByName('Url2000');
     $fields->removeByName('Urloriginal');
     $fields->removeByName('FaceCentreX');
     $fields->removeByName('FaceCentreY');
     // Display a thumbnail
     $heroField = new LiteralField("Thumbnail", $this->getThumbnail());
     $fields->addFieldToTab('Root.Main', $heroField);
     return $fields;
 }