ScriptFUSION\Porter\Type\ObjectType::toArray PHP Метод

toArray() публичный статический Метод

Converts the specified object to an array, recursively converting any nested arrays of objects.
public static toArray ( mixed $mixed ) : array
$mixed mixed Object.
Результат array Converted object.
    public static function toArray($mixed)
    {
        if (is_object($mixed)) {
            $mixed = get_object_vars($mixed);
        }
        if (is_array($mixed)) {
            return array_map('self::' . __FUNCTION__, $mixed);
        }
        return $mixed;
    }

Usage Example

Пример #1
0
 public function fetchFreshData($source, EncapsulatedOptions $options = null)
 {
     if ($options && !$options instanceof SoapOptions) {
         throw new \InvalidArgumentException('Options must be an instance of SoapOptions.');
     }
     $params = array_merge($this->options->getParameters(), $options ? $options->getParameters() : []);
     return ObjectType::toArray(\ScriptFUSION\Retry\retry(5, function () use($source, $params) {
         return $this->getOrCreateClient()->{$source}($params);
     }, new ExponentialBackoffErrorHandler()));
 }
All Usage Examples Of ScriptFUSION\Porter\Type\ObjectType::toArray
ObjectType