获取当前模型关联字段名数组
@param string|object $object
@return string[]
423310
public static function getRelationFieldNames($object)
    {
        $class = BeanFactory::getObjectClass($object);
        if(!isset(static::$relationFieldsNames[$class]))
        {
            $relations = AnnotationManager::getPropertiesAnnotations($class, RelationBase::class);
            $result = array_keys($relations);
            foreach($relations as $annotations)
            {
                $annotation = $annotations[0];
                if(($annotation instanceof ManyToMany || $annotation instanceof PolymorphicManyToMany) && $annotation->rightMany)
                {
                    $result[] = $annotation->rightMany;
                }
            }
            static::$relationFieldsNames[$class] = $result;
        }
        return static::$relationFieldsNames[$class];
    }
173886
public function methods($object)
    {
        $methods = (new ReflectionClass($object))->getMethods(ReflectionMethod::IS_PUBLIC);

        $iterator = function(ReflectionMethod $method)
        {
            return $method->getName();
        };

        return array_map($iterator, $methods);
    }
1107428
protected function extractObjectProperties($object): array
    {
        $properties = [];

        $reflection = new \ReflectionObject($object);

        // obtain public, protected and private properties of the class itself:

        foreach ($reflection->getProperties() as $property) {
            if ($property->isStatic()) {
                continue; // omit static properties
            }

            $property->setAccessible(true);

            $properties["\${$property->name}"] = $property->getValue($object);
        }

        // obtain any inherited private properties from parent classes:

        while ($reflection = $reflection->getParentClass()) {
            foreach ($reflection->getProperties(\ReflectionProperty::IS_PRIVATE) as $property) {
                $property->setAccessible(true);

                $properties["{$reflection->name}::\${$property->name}"] = $property->getValue($object);
            }
        }

        return $properties;
    }
1306409
private function normalizeObject($object)
    {
        if ($this->objectToIndex->contains($object)) {
            return [$this->classAnnotation => '@' . $this->objectToIndex[$object]];
        }
        $this->objectToIndex->attach($object, $this->objectIndex++);

        $normalizedObject = [$this->classAnnotation => get_class($object)];
        $normalizedObject += array_map([$this, 'normalizeValue'], $this->extractObjectProperties($object));

        return $normalizedObject;
    }
1037621
public static function keys($object)
    {
        if ($object instanceof \stdClass)
            $object = (array)$object;

        if (is_array($object))
            return array_keys($object);

        $result = [];
        static::each($object, function ($item, $key) use (& $result) {
            $result[] = $key;
        });

        return $result;
    }
753929
public function extract($object)
    {
        $data = [
            'group_id' => $object->getGroup()->getId(),
            'name' => $object->getName(),
        ];
        if ($object->getId()) {
            $data['id'] = $object->getId();
        }
        return $data;
    }
741892
public static function functions($object)
    {
        return (is_array($object) || $object instanceOf \stdClass)
            ? static::keys(static::filter($object, function ($item) {
                return static::isFunction($item);
            }))
            : static::sortBy(get_class_methods($object), function($name) {
                return $name;
            });
    }
1130061
public static function getLabels($object)
    {
        $labels    = null;
        $labelsRaw = $object->getDataValue('stitky');

        if (strlen($labelsRaw)) {
            $labels = is_array($labelsRaw) ? $labelsRaw : self::listToArray($labelsRaw);
        }
        return $labels;
    }
1204218
protected function getIndexablePropertiesAndValuesFromObject($object)
    {
        $className = TypeHandling::getTypeForValue($object);
        $data = [];
        foreach ($this->indexInformer->getClassProperties($className) as $propertyName) {
            if (ObjectAccess::isPropertyGettable($object, $propertyName) === false) {
                continue;
            }

            $value = ObjectAccess::getProperty($object, $propertyName);
            if (($transformAnnotation = $this->reflectionService->getPropertyAnnotation($className, $propertyName, TransformAnnotation::class)) !== null) {
                $value = $this->transformerFactory->create($transformAnnotation->type)->transformByAnnotation($value, $transformAnnotation);
            }

            $data[$propertyName] = $value;
        }

        return $data;
    }
1277971
public static function toArray( $object )
    {
        if ( is_object( $object ) )
        {
            return get_object_vars( $object );
        }

        if ( is_array( $object ) )
        {
            return array_map(
                array(
                    __CLASS__,
                    'toArray'
                ),
                $object
            );
        }

        // Return array
        return $object;
    }
509410
public function items($object = null)
    {
        if (!$this->_items) {
            $this->_initItems();
        }
        
        $items = array();
        
        foreach ($this->_items as $item) {
            if ($object !== null && !$item->isApplicable($object)) {
                continue;
            }
            
            $items[] = $item;
        }
        
        return $items;
    }
1028541
private function _recursiveGetObjectVars($object)
    {
        $vars = $object;
        if ( is_object($object) ) {
            $vars = get_object_vars($object);
            foreach ($vars as $key => $value) {
                $vars[$key] = $this->_recursiveGetObjectVars($value);
            }
        }

        return $vars;
    }
332563
public static function getTable($object)
    {
        $tableAnnotation = static::getAnnotation($object, Table::class);
        if(null !== $tableAnnotation)
        {
            return $tableAnnotation->name;
        }
        else
        {
            return null;
        }
    }
908168
public function extract($object)
    {
        return [
            'name' => $object->getFileName(),
            'type' => $object->getType(),
            'size' => $object->getSize(),
            'tmp_name' => $object->getTempName(),
            'error' => $object->getError(),
            'size' => [
                0 => $object->getWidth(),
                1 => $object->getHeight(),
                2 => $object->getMimeType(),
            ],
        ];
    }
1328962
public function extract($object): array
    {
        if (!is_object($object)) {
            throw new RuntimeException(
                sprintf('%s expects the provided $object to be a PHP object', __METHOD__)
            );
        }

        return (function (): array {
            return get_object_vars($this);
        })->call($object);
    }
260183
public function serialize($object)
    {
        if (!$this->canHandle(get_class($object))) {
            throw new \InvalidArgumentException();
        }

        return [ $object->getTimestamp(), $object->getTimezone() ];
    }
716694
protected function parseToArray($object): array
    {
        if (!is_array($object)) {
            $attributes = method_exists($object, 'getAttributes')
                ? $object->getAttributes()
                : get_object_vars($object);

            return $attributes;
        }

        return $object;
    }