This commit is contained in:
2018-07-08 17:34:50 +02:00
commit d2d098006c
112 changed files with 40655 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace MightyPork\Utils;
use MightyPork\Exceptions\NotExistException;
use Illuminate\Support\Collection;
/**
* Improved collection with object access to fields
*/
class ObjCollection extends Collection
{
public function __get($name)
{
if (isset($this[$name])) return $this[$name];
throw new NotExistException("No '$name' in collection.");
}
public function __isset($name)
{
return isset($this[$name]);
}
public function __set($name, $value)
{
$this[$name] = $value;
}
}