當前位置: 首頁>>代碼示例>>PHP>>正文


PHP static::delete方法代碼示例

本文整理匯總了PHP中static::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP static::delete方法的具體用法?PHP static::delete怎麽用?PHP static::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在static的用法示例。


在下文中一共展示了static::delete方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createFolder

 public static function createFolder(array $attributes = [])
 {
     $dir = new static();
     $dir->is_dir = 1;
     $dir->user_id = isset($attributes['user_id']) ? $attributes['user_id'] : 0;
     $dir->project_id = isset($attributes['project_id']) ? $attributes['project_id'] : 0;
     $dir->parent_id = isset($attributes['parent_id']) ? $attributes['parent_id'] : 0;
     $dir->name = isset($attributes['name']) ? $attributes['name'] : '新建文件夾';
     $dir->type = isset($attributes['type']) ? $attributes['type'] : 'dir';
     $dir->path = isset($attributes['path']) ? $attributes['path'] : '/';
     $dir->save();
     $status = true;
     if (isset($attributes['path']) || $dir->parent_id == 0) {
         $dir->path .= $dir->id . '/';
     } else {
         $path = $dir->parent()->where('project_id', $dir->project_id)->where('is_dir', 1)->pluck('path');
         if (!$path || $path->count() == 0) {
             $dir->delete();
             $status = false;
         } else {
             if (!is_string($path)) {
                 $path = $path[0];
             }
             $dir->path = $path . $dir->id . '/';
         }
     }
     if ($status) {
         $dir->save();
         return static::find($dir->id);
     }
 }
開發者ID:xiewnet,項目名稱:archimore,代碼行數:31,代碼來源:ProjectFile.php

示例2: request

 public static function request()
 {
     $class = new static();
     !Input::has('deleteShippingMethod') ?: $class->delete(Input::get('deleteShippingMethod'));
     !Input::has('updateShippingMethod') ?: $class->update(Input::get('updateShippingMethod'))->with(Input::get('shipping.fill'));
     !Input::has('addShippingMethod') ?: $class->add()->with(Input::get('shipping.fill'));
 }
開發者ID:artemsk,項目名稱:veer-core,代碼行數:7,代碼來源:Shipping.php

示例3: request

 public static function request()
 {
     $class = new static();
     $class->acton = Input::get('action');
     !Input::has('deleteSearch') ?: $class->delete(Input::get('deleteSearch'));
     $class->action != 'addSearch' ?: $class->add(Input::get('search'), Input::get('users'));
 }
開發者ID:artemsk,項目名稱:veer-core,代碼行數:7,代碼來源:Search.php

示例4: request

 public static function request()
 {
     $class = new static();
     $class->action = Input::get('action');
     !Input::has('deleteList') ?: $class->delete(Input::get('deleteList'));
     $class->action != 'addList' ?: $class->addList(Input::all());
 }
開發者ID:artemsk,項目名稱:veer-core,代碼行數:7,代碼來源:UserList.php

示例5: request

 public static function request()
 {
     $class = new static();
     Input::get('action') != 'addComment' ?: $class->add(Input::all());
     !Input::has('hideComment') ?: $class->hide(head(Input::get('hideComment', [])));
     !Input::has('unhideComment') ?: $class->unhide(head(Input::get('unhideComment', [])));
     !Input::has('deleteComment') ?: $class->delete(head(Input::get('deleteComment', [])));
 }
開發者ID:artemsk,項目名稱:veer-core,代碼行數:8,代碼來源:Comment.php

示例6: request

 public static function request()
 {
     $class = new static();
     Input::get('action') != 'addMessage' ?: $class->add(Input::get('communication'));
     !Input::has('hideMessage') ?: $class->hide(head(Input::get('hideMessage', [])));
     !Input::has('unhideMessage') ?: $class->unhide(head(Input::get('unhideMessage', [])));
     !Input::has('deleteMessage') ?: $class->delete(head(Input::get('deleteMessage', [])));
 }
開發者ID:artemsk,項目名稱:veer-core,代碼行數:8,代碼來源:Communication.php

示例7: request

 public static function request()
 {
     $class = new static();
     $class->action = Input::get('action');
     $class->sites_id = Input::get('InSite');
     $class->action != 'updateRoles' ?: $class->update(Input::get('role'));
     !starts_with($class->action, 'deleteRole') ?: $class->delete(substr($class->action, 11));
     !Input::has('InUsers') ?: $class->attachUsers(Input::get('InUsers'));
 }
開發者ID:artemsk,項目名稱:veer-core,代碼行數:9,代碼來源:Role.php

示例8: request

 public static function request()
 {
     $class = new static();
     $class->action = Input::get('action');
     !starts_with($class->action, "deleteTag") ?: $class->delete(substr($class->action, 10));
     !Input::has('renameTag') ?: $class->renameTags(Input::get('renameTag'));
     !Input::has('newTag') ?: $class->newTags(Input::get('newTag'));
     event('veer.message.center', trans('veeradmin.tag.update'));
 }
開發者ID:artemsk,項目名稱:veer-core,代碼行數:9,代碼來源:Tag.php

示例9: request

 public static function request()
 {
     $class = new static();
     $class->action = Input::get('action');
     !Input::has('deleteUserbook') ?: $class->delete(Input::get('deleteUserbook'));
     if ($class->action == 'addUserbook' || $class->action == 'updateUserbook') {
         $class->update(head(Input::get('userbook', [])));
     }
 }
開發者ID:artemsk,項目名稱:veer-core,代碼行數:9,代碼來源:UserBook.php

示例10: deleteMany

 public static function deleteMany(array $hashes)
 {
     foreach ($hashes as $hash) {
         if (array_key_exists("id", $hash)) {
             $Hash = new static();
             $Hash->id = $hash['id'];
             $Hash->delete();
         }
     }
 }
開發者ID:MichaelJ2324,項目名稱:SugarDataManager,代碼行數:10,代碼來源:dm_DedupeHashes.php

示例11: request

 /**
  * Actions for attributes based on Request.
  * @return void
  */
 public static function request()
 {
     $class = new static();
     $class->action = Input::get('action');
     $newValue = Input::get('newValue');
     $newName = Input::get('newName');
     $renameAttrName = Input::get('renameAttrName');
     !starts_with($class->action, "deleteAttrValue") ?: $class->delete(substr($class->action, 16));
     $class->action != 'newAttribute' ?: $class->add($newName, $newValue);
     $class->rename($renameAttrName)->update(Input::all());
     event('veer.message.center', trans('veeradmin.attribute.update'));
 }
開發者ID:artemsk,項目名稱:veer-core,代碼行數:16,代碼來源:Attribute.php

示例12: request

 /**
  * 
  * @return void
  */
 public static function request()
 {
     //\Event::fire('router.filter: csrf');
     $class = new static();
     $class->action = Input::get('action');
     if (Input::has('id')) {
         return $class->one();
     }
     $class->updateRestrictions(Input::get('changeRestrictUser'));
     $class->updateBan(Input::get('changeStatusUser'));
     $class->delete(Input::get('deleteUser'));
     $class->add($class->action == 'Add' ? Input::all() : null);
 }
開發者ID:artemsk,項目名稱:veer-core,代碼行數:17,代碼來源:User.php

示例13: request

 /**
  * Actions for categories based on Request. Triggers are hardcoded.
  * 
  * @return void
  */
 public static function request()
 {
     $class = new static();
     $class->action = Input::get('action');
     $class->action != 'delete' ?: $class->delete(Input::get('deletecategoryid'));
     if (Input::has('category')) {
         return $class->one();
     }
     $addCategory = $class->action == 'add' ? Input::all() : null;
     $sortCategory = $class->action == 'sort' ? Input::all() : null;
     $class->sort($sortCategory)->addCategory($addCategory);
     //return $class->isAjaxRequest();
 }
開發者ID:artemsk,項目名稱:veer-core,代碼行數:18,代碼來源:Category.php

示例14: request

 public static function request()
 {
     $class = new static();
     $class->action = Input::get('action');
     foreach (array_keys(Input::all()) as $k) {
         if (Input::hasFile($k)) {
             // @todo attention
             $class->uploadedIds = array_merge($class->uploadedIds, $class->upload('image', $k, null, null, '', null, true));
             event('veer.message.center', trans('veeradmin.image.upload'));
         }
     }
     !Input::has('attachImages') ?: $class->attachImages(Input::get('attachImages'));
     !starts_with($class->action, 'deleteImage') ?: $class->delete(substr($class->action, 12));
 }
開發者ID:artemsk,項目名稱:veer-core,代碼行數:14,代碼來源:Image.php

示例15: tempFile

 /**
  * Get a unique temporary file.
  * 
  * @param string $filename
  * @param string $extension
  * @return File 
  */
 public static function tempFile($filename = '', $extension = '')
 {
     $folder = \GO::config()->getTempFolder();
     if (!empty($filename)) {
         $p = $folder->path() . '/' . $filename;
     } else {
         $p = $folder->path() . '/' . uniqid(time());
     }
     if (!empty($extension)) {
         $p .= '.' . $extension;
     }
     $file = new static($p);
     $file->delete();
     return $file;
 }
開發者ID:ajaboa,項目名稱:crmpuan,代碼行數:22,代碼來源:File.php


注:本文中的static::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。