Пример #1
0
 public function addKey($name, $value)
 {
     if (!$this->keys->containsKey($name)) {
         $this->keys->set($name, $value);
     }
     return $this;
 }
Пример #2
0
 /**
  * Guestimate the title field of the model.
  *
  * @return mixed
  */
 function titleField()
 {
     $keys = ['title', 'name', 'host', 'url', 'email'];
     foreach ($keys as $key) {
         if ($this->fields->containsKey($key)) {
             return $key;
         }
     }
     return $this->fields->first()->name;
 }