Validates that all the array elements are unique within the supplied
set of object properties.

@param IObjectSet $objects
@param string     $propertyName the property member expression

@return static
775696
public function allUniqueIn(IObjectSet $objects, string $propertyName)
    {
        $this->customProcessorCallbacks[] = function (IType $currentType, IFieldType $fieldType, $initialValue) use ($objects, $propertyName) {
            return new AllUniquePropertyValidator($currentType, $objects, $propertyName, $initialValue);
        };

        return $this;
    }
1288114
public function setProperty($propertyName, $value)
    {
        if (!is_object($this->contentObjectProxy)) {
            switch ($this->getNodeType()->getPropertyType($propertyName)) {
                case 'references':
                    $nodeIdentifiers = [];
                    if (is_array($value)) {
                        foreach ($value as $nodeIdentifier) {
                            if ($nodeIdentifier instanceof NodeInterface || $nodeIdentifier instanceof AbstractNodeData) {
                                $nodeIdentifiers[] = $nodeIdentifier->getIdentifier();
                            } elseif (preg_match(NodeIdentifierValidator::PATTERN_MATCH_NODE_IDENTIFIER, $nodeIdentifier) !== 0) {
                                $nodeIdentifiers[] = $nodeIdentifier;
                            }
                        }
                    }
                    $value = $nodeIdentifiers;
                    break;
                case 'reference':
                    $nodeIdentifier = null;
                    if ($value instanceof NodeInterface || $value instanceof AbstractNodeData) {
                        $nodeIdentifier = $value->getIdentifier();
                    } elseif (preg_match(NodeIdentifierValidator::PATTERN_MATCH_NODE_IDENTIFIER, $value) !== 0) {
                        $nodeIdentifier = $value;
                    }
                    $value = $nodeIdentifier;
                    break;
            }

            $this->persistRelatedEntities($value);

            if (array_key_exists($propertyName, $this->properties) && $this->properties[$propertyName] === $value) {
                return;
            }

            $this->properties[$propertyName] = $value;

            $this->addOrUpdate();
        } elseif (ObjectAccess::isPropertySettable($this->contentObjectProxy->getObject(), $propertyName)) {
            $contentObject = $this->contentObjectProxy->getObject();
            ObjectAccess::setProperty($contentObject, $propertyName, $value);
            $this->updateContentObject($contentObject);
        }
    }
245420
public static function collect(string $className, $objectAnnotation = null, string $propertyName = '', string $methodName = '', $propertyValue = null)
    {
        if ($objectAnnotation instanceof Connection) {
            $type   = $objectAnnotation->getType();
            $driver = $objectAnnotation->getDriver();
            self::$connects[$driver][$type] = $className;
        }
    }
343898
private function propertyExists($object, $fieldName)
    {
        if (property_exists($object, $fieldName)) {
            return true;
        }

        foreach (explode('.', $fieldName) as $field) {
            if (property_exists($object, $field)) {
                $object = $object->{$field};
                if (!is_object($object)) {
                    break;
                }
                continue;
            } else {
                return false;
            }
        }
        return true;
    }
536304
public function anyMatch($propertyName, $propertyValues) {
		if ($propertyValues === null || empty($propertyValues) || $propertyValues[0] === null) {
			return $this;
		}

		$queryString = null;
		$lastElemtentKey = count($propertyValues) - 1;
		foreach($propertyValues as $key => $propertyValue) {
			$parameterName = ':' . md5($propertyName . '#' . count($this->where) . $key);
			$this->parameterMap[$parameterName] = $propertyValue;

			if ($key === 0) {
				$queryString .= '(';
			}
			if ($key !== $lastElemtentKey) {
				$queryString .= sprintf("(`%s`) = %s OR ", $propertyName, $parameterName);
			} else {
				$queryString .= sprintf("(`%s`) = %s )", $propertyName, $parameterName);
			}
		}

		$this->where[] = $queryString;

		return $this;
	}
1176223
public function joinColumnName($propertyName)
    {
        return $this->str->snake($this->str->singular($propertyName)) . '_' . $this->referenceColumnName();
    }
100423
public function isMultiValuedProperty($propertyName)
    {
        return ($this->properties[$propertyName]['type'] === 'array' || $this->properties[$propertyName]['type'] === 'SplObjectStorage' || $this->properties[$propertyName]['type'] === 'Doctrine\Common\Collections\Collection' || $this->properties[$propertyName]['type'] === 'Doctrine\Common\Collections\ArrayCollection');
    }
536769
public static function collect(
        string $className,
        $objectAnnotation = null,
        string $propertyName = '',
        string $methodName = '',
        $propertyValue = null
    ) {
        if ($objectAnnotation instanceof Command) {
            self::collectCommand($className, $objectAnnotation);
        } elseif ($objectAnnotation instanceof Mapping) {
            self::collectMapping($className, $objectAnnotation, $methodName);
        } elseif ($objectAnnotation === null && isset(self::$commandMapping[$className])) {
            self::collectWithoutAnnotation($className, $methodName);
        }
    }
1265438
public function entityIdsFrom(IEntitySet $entities) : ObjectArrayFieldBuilder
    {
        return (new ObjectArrayFieldBuilder($this
            ->type(new ArrayOfObjectIdsType(
                $entities,
                Field::element()->entityIdFrom($entities)->required()->build()
            ))
        ))->containsNoDuplicates();
    }
1029319
public static function collect(string $className, $objectAnnotation = null, string $propertyName = "", string $methodName = "", $propertyValue = null)
    {
        if ($objectAnnotation instanceof Process) {

            $num       = $objectAnnotation->getNum();
            $name      = $objectAnnotation->getName();
            $boot      = $objectAnnotation->isBoot();
            $inout     = $objectAnnotation->isInout();
            $pipe      = $objectAnnotation->isPipe();
            $coroutine = $objectAnnotation->isCoroutine();
            $name      = empty($name) ? $className : $name;

            self::$processes[$name] = [
                'name'  => $name,
                'num'   => $num,
                'boot'  => $boot,
                'pipe'  => $pipe,
                'inout' => $inout,
                'co'    => $coroutine,
                'class' => $className,
            ];

            return;
        }
    }
443729
public static function invalidCascadeOption(array $cascades, $className, $propertyName)
    {
        $cascades = implode(', ', array_map(static function ($e) {
            return "'" . $e . "'";
        }, $cascades));

        return new self(sprintf(
            "You have specified invalid cascade options for %s::$%s: %s; available options: 'remove', 'persist', and 'refresh'",
            $className,
            $propertyName,
            $cascades
        ));
    }
303402
public function getStaticPropertyValue($object, $propertyName) {
        $className = $object;

        if(is_object($className)) {
            $className = get_class($object);
        }

        $reflector = new ReflectionClass($className);
        $properties = $reflector->getStaticProperties();

        return (isset($properties[$propertyName])) ? $properties[$propertyName] : NULL;
    }
794817
protected function getSelectorInstance(ICollection $objectsCollection, IObjectSet $objectSet)
    {
        /**
         * @var ISelector $selector
         */
        $selector = $this->getPrototype(
            $this->selectorClass,
            ['umi\orm\selector\ISelector']
        )
        ->createInstance([$objectsCollection, $objectSet, $this]);
        $objectSet->setSelector($selector);

        return $selector;
    }
1309319
public function allowAllPropertiesExcept(string ...$propertyNames)
    {
        $this->mapUnknownProperties = true;

        foreach ($propertyNames as $propertyName) {
            $this->propertiesNotToBeMapped[$propertyName] = $propertyName;
        }
        return $this;
    }
488703
public static function collect(string $className, $objectAnnotation = null, string $propertyName = '', string $methodName = '', $propertyValue = null)
    {
        if ($objectAnnotation instanceof Reference) {
            // phpdoc解析
            $phpReader     = new PhpDocReader();
            $property      = new \ReflectionProperty($className, $propertyName);
            $propertyClass = $phpReader->getPropertyClass($property);
            $name          = $objectAnnotation->getName();
            $pool          = $objectAnnotation->getPool();
            $version       = $objectAnnotation->getVersion();
            $breaker       = $objectAnnotation->getBreaker();
            $packer        = $objectAnnotation->getPacker();
            $fallback      = $objectAnnotation->getFallback();

            $className      = sprintf("%s.%s.%s.%s.%s.%s", $name, $propertyClass, $version, $pool, $breaker, $packer);
            $className      = md5($className);
            $proxyClassName = str_replace("\\", '_', $propertyClass);
            $className      = $proxyClassName . '_' . $className;

            if (empty($name)) {
                throw new RpcClientException('@Reference must be define name! ');
            }
            if (isset(self::$references[$className])) {
                return $className;
            }

            self::$references[$className] = [
                $name,
                $propertyClass,
                $version,
                $pool,
                $breaker,
                $packer,
                $fallback
            ];

            return $className;
        }

        return null;
    }
204198
protected function isPropertyGettable($object, $propertyName)
    {
        $flag = false;

        if (ObjectAccess::isPropertyGettable($object, $propertyName)) {
            $flag = true;
            $getterMethodName = 'get' . ucfirst($propertyName);

            if (false === method_exists($object, $getterMethodName)
                && is_callable([$object, $getterMethodName])
            ) {
                try {
                    $object->$getterMethodName();
                } catch (\Exception $e) {
                    if ($e instanceof MethodNotFoundException
                        || false === $e instanceof SilentExceptionInterface
                    ) {
                        $flag = false;
                    }
                }
            }
        }

        return $flag;
    }
544450
protected function initPropertyArray( $propertyName, $propertyClass){
        if( property_exists( static::class, $propertyName) && is_array( $this->$propertyName)){
            $newProperty = [];
            foreach( $this->$propertyName as $PropertyItem){
                if( is_array( $PropertyItem)){
                    $newProperty[] = new $propertyClass( $PropertyItem);
                }
            }
            $this->$propertyName = $newProperty;
        }
    }