Obj
class Obj extends ObjectHelper
Class Obj alias of the ObjectHelper
Traits
Class ObjectPoolTrait
Methods
static mixed
init(mixed $object, array $options)
给对象设置属性值 - 会先尝试用 setter 方法设置属性 - 再尝试直接设置属性
from ObjectHelper
static array|bool
from ObjectHelper
static array
from ObjectHelper
static mixed
singleton(string $class)
No description
static mixed
factory(string $class)
No description
static bool
isArrayable($object)
No description
Details
in ObjectHelper at line 25
static mixed
smartConfigure(mixed $object, array $options)
in ObjectHelper at line 38
static mixed
init(mixed $object, array $options)
给对象设置属性值 - 会先尝试用 setter 方法设置属性 - 再尝试直接设置属性
in ObjectHelper at line 63
static
configure($object, array $options)
给对象设置属性值
in ObjectHelper at line 75
static
setAttrs($object, array $options)
给对象设置属性值
in ObjectHelper at line 85
static string
encode(mixed $obj)
定义一个用来序列化数据的函数
in ObjectHelper at line 96
static mixed
decode(string $txt, bool|array $allowedClasses = false)
反序列化
in ObjectHelper at line 107
static array|bool
toArray(iterable|array|Traversable $data, bool $recursive = false)
php对象转换成为数组
in ObjectHelper at line 138
static string
hash(mixed $object, bool $unique = true)
in ObjectHelper at line 162
static array
getMethodArgs(ReflectionMethod $method, array $extraArgs = [])
in ObjectHelper at line 211
static mixed
create(string $class)
从类名创建服务实例对象,会尽可能自动补完构造函数依赖