本文整理汇总了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);
}
}
示例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'));
}
示例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'));
}
示例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());
}
示例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', [])));
}
示例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', [])));
}
示例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'));
}
示例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'));
}
示例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', [])));
}
}
示例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();
}
}
}
示例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'));
}
示例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);
}
示例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();
}
示例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));
}
示例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;
}