BLUE
PHP 7.4.33
Path:
/var/www/multi-event-cfp.bitkit.dk/httpdocs/app/Support
Run
Logout
Edit File
Size: 7.71 KB
Close
/var/www/multi-event-cfp.bitkit.dk/httpdocs/app/Support/Entity.php
Text
Base64
<?php namespace App\Support; use Countable; use App\Support\Traits\GetArrayable; use ArrayAccess; use ArrayIterator; use CachingIterator; use IteratorAggregate; use JsonSerializable; use Illuminate\Support\Arr; use Illuminate\Support\Collection; use Illuminate\Support\Traits\Macroable; use Illuminate\Contracts\Support\Jsonable; use Illuminate\Contracts\Support\Arrayable; class Entity implements ArrayAccess, Arrayable, Countable, IteratorAggregate, Jsonable, JsonSerializable { use GetArrayable, Macroable; protected $attributes = []; public $properties; public function __construct($values = []) { $this->attributes = self::getArrayable($values); } public function __destruct() { $this->destroy(); } public function __get($key) { return $this->get($key); } public function __isset($key) { return $this->has($key); } public function __set($key, $value) { return $this->put($key, $value); } public function __toString() { return (string) $this->toJson(); } public function __unset($key) { $this->forget($key); } public function all() { return $this->attributes; } public function any($key, $values) { $has = $this->get($key); foreach ($values as $value) { if ($value === $has || (is_array($has) && in_array($value, $has, false))) { return true; } } return false; } public function append($key, $value) { $values = Arr::wrap($this->get($key)); return $this->put($key, array_merge($values, Arr::wrap($value))); } public function clear() { $this->attributes = []; return $this; } public function count() { return count($this->attributes); } public function decrement($key, $by = 1) { return $this->increment($key, $by * -1); } public function destroy() { $this->attributes = []; return null; } /** * @param $keys * @return \Illuminate\Support\Collection */ public function except($keys) { $keys = is_array($keys) ? $keys : func_get_args(); return new Collection(Arr::except($this->attributes, $keys)); } /** * @param string|array $keys * @return self */ public function forget($keys) { $keys = is_array($keys) ? $keys : [$keys]; foreach ($keys as $key) { Arr::forget($this->attributes, $key); } return $this; } public function get($key = null, $default = null) { if (null === $key) { return $this->all(); } if (is_array($key)) { return $this->many($key); } if ($value = Arr::get($this->attributes, $key, $default)) { return $value; } return $value !== '' ? $value : $default; } public function getCachingIterator($flags = CachingIterator::CALL_TOSTRING) { return new CachingIterator($this->getIterator(), $flags); } public function getIterator() { return new ArrayIterator($this->attributes); } public function has($key, $value = null) { $has = $this->get($key); if (null === $value) { return $has ? true : false; } if ($has === $value) { return true; } if (is_array($value)) { return $this->any($key, $value); } return is_array($has) ? in_array($value, $has, false) : false; } public function increment($key, $by = 1) { return $this->set($key, $this->get($key, 0) + $by); } public function isEmpty() { return empty($this->attributes); } public function isNotEmpty() { return !$this->isEmpty(); } public function jsonSerialize() { return self::mapArrayable($this->attributes); } /** * @return \Illuminate\Support\Collection */ public function keys() { return new Collection(array_keys($this->attributes)); } public function many(array $keys) { $values = []; foreach ($keys as $key => $value) { $key = is_string($key) ? $key : $value; $value = $this->get($key); if (null === $value) { $values[$key] = isset($keys[$key]) ? value($keys[$key]) : $value; } else { $values[$key] = $value; } } return new Collection($values); } public function merge($values) { $this->attributes = array_merge($this->attributes, self::getArrayable($values)); return $this; } public function not($key, $value = null) { return !$this->has($key, $value); } public function notAny($key, $values) { return !$this->any($key, $values); } public function offsetExists($key) { return $this->has($key); } public function offsetGet($key) { return $this->get($key); } public function offsetSet($key, $value) { $this->set($key, $value); } public function offsetUnset($key) { $this->forget($key); } public function only($keys) { $keys = is_array($keys) ? $keys : func_get_args(); return new Collection(Arr::only($this->attributes, $keys)); } public function pipe(callable $callback) { return $callback($this); } public function properties($key = null, $default = null) { if (null === $this->properties) { $properties = $this->get('properties') ?: []; $this->properties = new static($properties); } return null === $key ? $this->properties : $this->properties->get($key, $default); } public function pull($key, $default = null) { $value = Arr::pull($this->attributes, $key, $default); return $value !== '' ? $value : $default; } public function put($key, $value = null) { if (is_array($key) || $key instanceof IteratorAggregate) { $values = $key; } else { $values = [$key => $value]; } foreach ($values as $nestedKey => $nestedValue) { $this->attributes[$nestedKey] = $nestedValue; } return $this; } public function set($key, $value = null) { if (is_array($key) || $key instanceof IteratorAggregate) { $values = $key; } else { $values = [$key => $value]; } foreach ($values as $nestedKey => $nestedValue) { Arr::set($this->attributes, $nestedKey, $nestedValue); } return $this; } public function sortKeys() { $attributes = []; $keys = array_keys($this->attributes); natsort($keys); foreach ($keys as $key) { $attributes[$key] = $this->attributes[$key]; } $this->attributes = $attributes; return $this; } public function toArray() { return array_map(function ($value) { return $value instanceof Arrayable ? $value->toArray() : $value; }, $this->attributes); } public function toJson($options = 0) { return json_encode($this->jsonSerialize(), $options); } public function toSelf() { return new self($this); } /** * @return \Illuminate\Support\Collection */ public function values() { return new Collection(array_values($this->attributes)); } public function pluck($value, $key = null) { return new static(Arr::pluck($this->attributes, $value, $key)); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Traits
DIR
-
drwxr-xr-x
2024-02-09 12:37:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Collection.php
670 B
lrw-r--r--
2024-02-09 12:37:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Entity.php
7.71 KB
lrw-r--r--
2024-02-09 12:37:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
helpers.php
8.23 KB
lrw-r--r--
2026-04-07 05:01:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Query.php
3.65 KB
lrw-r--r--
2024-02-09 12:37:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).