Exemplo n.º 1
0
 /**
  * Add http:// if it's not present upon save.
  *
  * @param  Jam_Model $model
  * @param  string $value
  * @param  boolean $loaded
  * @return string the new url
  */
 public function set(Jam_Validated $model, $value, $is_changed)
 {
     if ($value and !preg_match('|^http(s)?://|i', $value)) {
         $value = "http://" . $value;
     }
     return parent::set($model, $value, $is_changed);
 }
Exemplo n.º 2
0
 /**
  * Sets the default for the field to the model.
  *
  * @param   string  $model
  * @param   string  $column
  * @return  void
  */
 public function initialize(Jam_Meta $meta, $name)
 {
     parent::initialize($meta, $name);
     $this->default = $this->model;
 }