获取当前模型类的表名
@param string|object $object
@return string
332563
public static function getTable($object)
    {
        $tableAnnotation = static::getAnnotation($object, Table::class);
        if(null !== $tableAnnotation)
        {
            return $tableAnnotation->name;
        }
        else
        {
            return null;
        }
    }
868379
public static function attrToArray($object){
        if(is_array($object) || is_object($object)) {
            $result = [];
            foreach ($object as $key => $value) {
                $result[$key] = self::attrToArray($value);
            }
            return $result;
        }
        return $object;
    }
1088260
public function getObjectIdentity($object)
    {
        foreach ($this->configurations as $config) {
            if ($config->isRelevant($object)) {
                return $config->getObjectIdentity();
            }
        }

        return null;
    }
1026201
public function getIdentifier($object)
    {
        $identifier = $this->getMethod($object);

        if (!$identifier) {
            return false;
        }

        return \call_user_func([$object, $identifier]);
    }
683193
public static function getKeyRule($object)
    {
        $class = BeanFactory::getObjectClass($object);
        if(!isset(static::$keyRules[$class]))
        {
            $key = static::getAnnotation($object, RedisEntity::class)->key;
            preg_match_all('/{([^}]+)}/', $key, $matches);
            static::$keyRules[$class] = new KeyRule($key, $matches[1]);
        }
        return static::$keyRules[$class];
    }
497554
public function getGettablePropertiesOfObject($object)
    {
        $className = get_class($object);

        if (false === isset($this->gettablePropertiesOfObjects[$className])) {
            $this->gettablePropertiesOfObjects[$className] = [];
            $properties = $this->getReflectionService()->getClassPropertyNames($className);

            foreach ($properties as $propertyName) {
                if (true === $this->isPropertyGettable($object, $propertyName)) {
                    $this->gettablePropertiesOfObjects[$className][] = $propertyName;
                }
            }
        }

        return $this->gettablePropertiesOfObjects[$className];
    }
139738
public function prepareObject($object)
    {
        $tokenList = $this->getMethodTokenList();

        for ($i = 0, $c = count($tokenList); $i < $c; $i++) {
            if ($this->reflection->hasMethod(self::SETTER_PREFIX . ucfirst($tokenList[$i]['property']))) {
                $m = self::SETTER_PREFIX . ucfirst($tokenList[$i]['property']);
                if ($tokenList[$i]['type'] == RouteMethodAnnotaionParser::TYPE_CLASS) {
                    $value = new $tokenList[$i]['value']();
                } else {
                    $value = $tokenList[$i]['value'];
                }
                $object->$m($value);
            }
        }

        return $object;
    }
151673
private function readAppDescription($object): string
    {
        $annotations = annotationsOf($object);
        if (!$annotations->contain('AppDescription')) {
            return '';
        }

        return $annotations->firstNamed('AppDescription')->getValue() . "\n";
    }
823158
public static function formatName($object, $name)
    {
        return $object instanceof OrganizationalInterface
            ? static::formatNameWithOrg($name, $object->getOrganization())
            : $name;
    }
1215964
public function objectName($objectName = null)
    {
        if ($objectName === null)
        {
            return $this->_objectName;
        }
        $this->_objectName = $objectName;

        return $this;
    }
1131626
public function query($object) {
		$conditions = (array) $this->constraints();

		foreach ($this->key() as $from => $to) {
			if (!isset($object->{$from})) {
				return null;
			}
			$conditions[$to] = $object->{$from};

			if (is_object($conditions[$to]) && $conditions[$to] instanceof Countable) {
				$conditions[$to] = iterator_to_array($conditions[$to]);
			}
		}
		$fields = $this->fields();
		$fields = $fields === true ? null : $fields;
		return compact('conditions', 'fields');
	}
1240668
public function getObjectValue($object, $name)
    {
        if (is_object($object) && isset($object->$name) && !method_exists($object, $name)) {
            return $object->$name;
        }

        // If its a nested value like meta[user[phone]]
        if (strpos($name, '[') > 0) {
            $nested = explode('[', str_replace(']', '', $name));
            $final = $object;
            foreach ($nested as $property) {
                if (!empty($property) && isset($final->{$property})) {
                    $final = $final->{$property};
                } elseif (is_object($final) && is_null($final->{$property})) {
                    $final = '';
                }
            }

            return $final;
        }

        return '';
    }
853113
public static function get_by_object($object) {
		$db = Database::Get();
		$class = get_class($object);
		$data = $db->get_all('SELECT * FROM object_text WHERE classname=? AND object_id=?', [ $class, $object->id ]);
		$object_texts = [];
		foreach ($data as $details) {
			$object_text = new self();
			$object_text->id = $details['id'];
			$object_text->details = $details;

			$object_texts[] = $object_text;
		}

		return $object_texts;
	}
129541
protected static function readObject($object): string
    {
        if ($object instanceof Closure) {
            return 'Function';
        }

        if ($object instanceof DateTime) {
            return sprintf('DateTime(%s)', $object->format('Y-m-d\TH:i:sP'));
        }

        if (method_exists($object, 'toString')) {
            return (string) $object->toString();
        }

        if (method_exists($object, '__toString')) {
            return (string) $object;
        }

        return sprintf('Object(%s)', get_class($object));
    }
867778
protected function getQualifiedForeignKeyName($object)
    {
        if (method_exists($object, 'getQualifiedForeignKeyName')) {
            return $object->getQualifiedForeignKeyName();
        }

        if (method_exists($object, 'getQualifiedForeignPivotKeyName')) {
            return $object->getQualifiedForeignPivotKeyName();
        }

        return $object->getForeignKey();
    }
962059
private function getObjectState($object)
    {
        $class = new \ReflectionClass($object);
        $visibility = \ReflectionProperty::IS_PRIVATE | \ReflectionProperty::IS_PROTECTED;
        $values = [];

        do {
            foreach ($class->getProperties($visibility) as $property) {
                $property->setAccessible(true);
                $values[$property->getName()] = $property->getValue($object);
            }

            $class = $class->getParentClass();
            $visibility = \ReflectionProperty::IS_PRIVATE;
        } while ($class);

        return get_object_vars($object) + $values;
    }
1185804
public function convert($object)
    {
        $className = \get_class($object);
        if (isset($this->convertersMap[$className])) {
            $converter = $this->convertersMap[$className];
        } else {
            $converter = $this->genericConverter;
        }

        return $converter->convert($object);
    }