コード例 #1
0
ファイル: Source.php プロジェクト: Monori/imgservice
 public function update()
 {
     // Check if subdomain exists
     if (self::scalar('SELECT `id` FROM {table} WHERE `id` != %s && `subdomain` = %s', $this->id, $this->subdomain)) {
         throw new SourceException('Subdomain already exist');
     }
     parent::update();
     // Save cloudflare ids
     if (count($this->cloudflareIds)) {
         SourceCloudflare::clear($this->id);
         foreach ($this->cloudflareIds as $id) {
             $cloudflareRelation = new SourceCloudflare();
             $cloudflareRelation->source_id = $this->id;
             $cloudflareRelation->cloudflare_identifier = $id;
             $cloudflareRelation->save();
         }
     }
 }
コード例 #2
0
ファイル: ModelSettings.php プロジェクト: Monori/imgservice
 public function update()
 {
     self::clear();
     parent::update();
 }