查询多条记录
@return static[]
551604
public static function select()
    {
        $memoryTableAnnotation = ModelManager::getAnnotation(static::class, MemoryTable::class);
        if(null === $memoryTableAnnotation)
        {
            return null;
        }
        $instance = MemoryTableManager::getInstance($memoryTableAnnotation->name);
        return \iterator_to_array($instance);
    }
210503
public function getItems()
    {
        if (is_array($this->items)) {
            $this->items = new static($this->items, $this->serviceDescription);
            $this->items->setParent($this);
        }

        return $this->items;
    }
18117
final public static function getMembers(): array
    {
        if (!isset(self::$constants[static::class])) {
            $reflection = new ReflectionClass(static::class);
            $constants = self::sortConstants($reflection);
            self::guardConstants($constants);
            self::$constants[static::class] = $constants;
        }

        return self::$constants[static::class];
    }
486288
public function get()
    {
        $parameters = [];
        foreach ($this->parameters as $parameter) {
            $parameters[] = $parameter->get();
        }

        return [
            'type' => 'new',
            'class' => $this->className,
            'parameters' => $parameters,
            'dynamic' => $this->dynamic,
            'file' => $this->file,
            'line' => $this->line,
            'char' => $this->char,
        ];
    }
1255469
public function toArray()
    {
        $object = [];

        if (static::$type) {
            $object['type'] = static::$type;
        }

        $attributes = array_merge(
            static::getTypeAttributes(),
            static::$commonAttributes
        );

        foreach ($attributes as $attribute) {
            $value = $this->{$attribute};

            if ($value !== null) {
                $toCopy = $value;

                //Clone object to prevent original object to be changed
                if (is_object($value)) {
                    $toCopy = clone $value;
                }

                $object[$attribute] = $toCopy;
            }

            if (static::$type == 'object' && $attribute == 'properties') {
                foreach ($object[$attribute] as $key => $property) {
                    if ($property instanceof BaseValidator) {
                        $object[$attribute]->{$key} = $property->toArray();
                    }
                }
                //fix type to array
                $object[$attribute] = (array)$object[$attribute];
            } elseif (in_array($attribute, ['allOf', 'anyOf', 'oneOf'])) {
                if (isset($object[$attribute]) && $object[$attribute] !== null) {
                    foreach ($object[$attribute] as $key => $property) {
                        if ($property instanceof BaseValidator) {
                            $object[$attribute][$key] = $property->toArray();
                        }
                    }
                }
            } elseif (in_array($attribute, ['items', 'not'])) {
                if (isset($object[$attribute])
                    && $object[$attribute]
                    && $object[$attribute] instanceof BaseValidator
                ) {
                    $object[$attribute] = $object[$attribute]->toArray();
                }
            }
        }

        return $object;
    }
1283637
public function getValue()
    {
        $values = [];
        foreach($this->values as $key => $value) {
            $values[$key] = $value->getValue();
        }
        return $values;
    }
515081
public static function __static()
	{
		Aspect::$aspectTests = array(
			ASPECT_LOCATION => Aspect::$locationTest,
			ASPECT_CONCEPT => Aspect::$conceptTest,
			ASPECT_COMPLETE_SCENARIO => Aspect::$completeScenarioTest,
			ASPECT_COMPLETE_SEGMENT => Aspect::$completeSegmentTest,
			ASPECT_ENTITY_IDENTIFIER => Aspect::$entityIdentifierTest,
			ASPECT_PERIOD => Aspect::$periodTest,
			ASPECT_NON_XDT_SCENARIO => Aspect::$nonXDTScenarioTest,
			ASPECT_NON_XDT_SEGMENT => Aspect::$nonXDTSegmentTest,
			ASPECT_UNIT => Aspect::$unitTest,
		);
	}
895256
public function fetchAll()
    {
        if (static::$languages === null) {
            static::$languages = $this->driver()->fetchAll();

            static::$languages = array_map(function ($language) {
                return new Locale($language);
            }, static::$languages);
        }

        return static::$languages;
    }
1369270
public static function get()
    {
        return [
            self::$equals,
            self::$lessThan,
            self::$lessThanEqualTo,
            self::$greaterThan,
            self::$greaterThanEqualTo,
            self::$doesNotEqual,
            self::$doesNotEqualAlt,
            self::$is,
            self::$isA,
            self::$isNot,
            self::$like,
        ];
    }
1227874
public static function getList()
    {
        /** @var Model $model */
        $model = new static();
        $fields = [
            trim($model->getPrimaryKey(), '_'),
            trim($model->getDisplayField(), '_')
        ];
        $rows = Sql::createSql($model->getAdapter())
            ->select($model->getTableName(), $fields)
            ->limit(null)
            ->all();
        $list = [];
        list($id, $value) = $fields;
        if (!empty($rows)) {
            foreach ($rows as $row) {
                $list[$row[$id]] = $row[$value];
            }
        }
        return $list;
    }
600531
public static function getConstants() : array
    {
        if (self::$constCacheArray == null) {
            self::$constCacheArray = [];
        }
        $calledClass = get_called_class();
        if (!array_key_exists($calledClass, self::$constCacheArray)) {
            $reflect = new ReflectionClass($calledClass);
            self::$constCacheArray[$calledClass] = $reflect->getConstants();
        }
        return self::$constCacheArray[$calledClass];
    }
1328715
public function reverse()
    {
        $result = [];

        foreach ($this->components as $i => $component) {
            $result[$i] = $component * -1;
        }

        return new static($result);
    }
455191
public function select(): array
    {
        //生成请求游标
        $cursor = call_user_func_array([
            $this->collection,
            'find'
        ], func_get_args());

        //逐条取出结果,构造数组
        $result = [];
        while ($cursor->hasNext()) {
            $result[] = $cursor->getNext();
        }

        return $result;
    }
532713
public function toArray()
        {
            $class = $this->get();
            $class = (array)$class;
            foreach ($class as $key => $value) {
                if (is_object($value)) {
                    $class[$key] = (new static($value))->toArray();
                }
            }
            return $class;
        }
726835
protected function getStaticFields()
	{
		$splHash = spl_object_hash($this);
		$fields  = [
			$splHash => [],
		];
		foreach ($this->staticFields as $field => $data)
		{
			if( !isset($this->info[$field]) )
				continue;
			$fieldValue = $this->info[$field];
			if ( ! isset($fields[$splHash][$data]))
			{
				$fields[$splHash][$data] = [];
			}
			$fields[$splHash][$data][] = $fieldValue;
		}

		$fields += parent::getStaticFields();

		return $fields;
	}
830833
public static function getValues(): array
    {
        $values = [];
        foreach (self::TYPES as $type) {
            $values[$type] = self::getValue($type);
        }

        return $values;
    }
1045142
public static function getClasses() : array
    {
        return [
            self::CLASS_0 => self::CLASS_0,
            self::CLASS_1 => self::CLASS_1,
            self::CLASS_2 => self::CLASS_2,
            self::CLASS_3 => self::CLASS_3
        ];
    }