コード例 #1
0
ファイル: WebsiteUser.php プロジェクト: hyn/webserver
 /**
  * @return bool
  */
 public function onUpdate()
 {
     if (!$this->exists()) {
         return $this->onCreate();
     } elseif ($this->name() && $this->website->isDirty('identifier')) {
         return $this->onRename($this->website->getOriginal('identifier'), $this->website->name());
     }
 }
コード例 #2
0
 /**
  * Writes the contents to disk on Update.
  *
  * @uses onCreate
  *
  * @return int
  */
 public function onUpdate()
 {
     if ($this->website->isDirty('identifier')) {
         $new = $this->website->identifier;
         $this->website->identifier = $this->website->getOriginal('identifier');
         $this->onDelete();
         $this->website->identifier = $new;
     }
     return $this->onCreate();
 }
コード例 #3
0
ファイル: Directory.php プロジェクト: Mobytes/multi-tenant
 public function __construct(Website $website)
 {
     $this->website = $website;
     if ($this->website->isDirty('identifier')) {
         $this->old_path = sprintf('%s/%d-%s/', Config::get('multi-tenant.tenant-directory') ? Config::get('multi-tenant.tenant-directory') : storage_path('multi-tenant'), $this->website->id, $this->website->getOriginal('identifier'));
         if (!File::isDirectory($this->old_path)) {
             $this->old_path = null;
         }
     }
     $this->base_path = sprintf('%s/%d-%s/', Config::get('multi-tenant.tenant-directory') ? Config::get('multi-tenant.tenant-directory') : storage_path('multi-tenant'), $this->website->id, $this->website->identifier);
 }