当前位置: 首页>>代码示例>>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;未经允许,请勿转载。