public function Save() {
    if (!$this->Validate()) {
      throw new \Exception("Validation failed");
    }

    $file = self::File($this->id);
    if (!is_dir(dirname($file))) {
      mkdir(dirname($file), 0755, true);
    }

    file_put_contents($file, serialize($this), LOCK_EX);
    return $this;
  }
public function Save() {
    if (!$this->Validate()) {
      throw new \Exception("Validation failed");
    }

    $file = self::File($this->id);
    if (!is_dir(dirname($file))) {
      mkdir(dirname($file), 0755, true);
    }

    file_put_contents($file, serialize($this), LOCK_EX);
    return $this;
  }
public function Save ( ) { if ( ! $ this -> Validate ( ) ) { throw new \ Exception ( "Validation failed" ) ; } $ file = self :: File ( $ this -> id ) ; if ( ! is_dir ( dirname ( $ file ) ) ) { mkdir ( dirname ( $ file ) , 0755 , true ) ; } file_put_contents ( $ file , serialize ( $ this ) , LOCK_EX ) ; return $ this ; }
Save this object.
@return boolean true on success
Save this object .