Where for different attributes.

@param string $propertyName
@param $find
@param Closure $finderClosure
@return static
13179
private function arrayFinder(string $propertyName, $find, Closure $finderClosure)
    {
        return $this->filter(function ($data) use ($find, $propertyName, $finderClosure) {
            try {
                $attributeValue = $data->{$propertyName};
            } catch (\Exception $e) {
                $attributeValue = null;
            }

            return is_null($attributeValue)
                ? null
                : $finderClosure($find, $attributeValue, $data);
        });
    }
1222323
public static function find($find, $value = null)
    {
        if ($value === null) {
            $value = $find;
            $find = static::$_primaryKey;
        }

        return static::select()->where("{$find} = ?", $value)->fetch();
    }
1113834
final static public function getMappedField($propertyName) {
		
		$binds = static::getBinds();
		return isset($binds[$propertyName]) ? $binds[$propertyName] : NULL;
		
	}
188017
public function newVirtualProperty(string $propertyName, ?Closure $getter, ?Closure $setter): void
    {
        if ($this->propertyExists($propertyName)) {
            throw new DuplicatePropertyException($propertyName);
        }
        if (is_null($getter) && is_null($setter)) {
            throw new InvalidPropertyException($propertyName);
        }
        $this->properties[$propertyName] = self::PROPERTY_VIRTUAL;
        $this->virtualGetters[$propertyName] = $getter;
        $this->virtualSetters[$propertyName] = $setter;
        $this->setterHooks[$propertyName] = [];
        $this->getterHooks[$propertyName] = [];
    }
30910
public function find($documentName, $identifier, $lockMode = LockMode::NONE, $lockVersion = null) : ?object
    {
        $repository = $this->getRepository($documentName);
        if ($repository instanceof DocumentRepository) {
            return $repository->find($identifier, $lockMode, $lockVersion);
        }

        return $repository->find($identifier);
    }
17753
public function find($finder, array $options = [])
    {
        /** @var \Cake\ORM\Table $table */
        $table = $this->getRepository();

        return $table->callFinder($finder, $this, $options);
    }
542475
public static function collect(string $className, $objectAnnotation = null, string $propertyName = '', string $methodName = '', $propertyValue = null)
    {
        if ($objectAnnotation instanceof Bootstrap) {

            $name = $objectAnnotation->getName();
            $order = $objectAnnotation->getOrder();

            self::$bootstraps[$className]['name'] = $name;
            self::$bootstraps[$className]['order'] = $order;
        }
    }
443741
public static function getPropertyValue($object,$propertyName)
    {
        $getter = "get" . ucfirst($propertyName);
        if (method_exists($object, $getter)) {
            return $object->$getter();
        }
        return null;
    }
830758
public static function collect(string $className, $objectAnnotation = null, string $propertyName = '', string $methodName = '', $propertyValue = null)
    {
        // collect service
        if ($objectAnnotation instanceof Service) {

            $rc = new \ReflectionClass($className);
            $interfaces = $rc->getInterfaceNames();
            $methods = $rc->getMethods(\ReflectionMethod::IS_PUBLIC);
            $version = $objectAnnotation->getVersion();

            foreach ($interfaces as $interfaceClass){
                foreach ($methods as $method){
                    $methodName = $method->getName();
                    self::$serviceMapping[$interfaceClass][$version][$methodName] = [$className, $methodName];
                }
            }

            return;
        }
    }
248231
public static function parseByPolymorphicOneToMany($model, $propertyName, $annotation)
    {
        $className = BeanFactory::getObjectClass($model);

        $struct = new PolymorphicOneToMany($className, $propertyName, $annotation);
        $leftField = $struct->getLeftField();
        $rightField = $struct->getRightField();
        $rightModel = $struct->getRightModel();

        foreach($model->$propertyName as $index => $row)
        {
            if(!$row instanceof $rightModel)
            {
                $row = $rightModel::newInstance($row);
                $model->$propertyName[$index] = $row;
            }
            $row[$rightField] = $model->$leftField;
            $row[$annotation->type] = $annotation->typeValue;
            $row->insert();
        }
    }
914167
public function parser(string $className, $objectAnnotation = null, string $propertyName = "", string $methodName = "", $propertyValue = null)
    {
        $scope    = Scope::PROTOTYPE;
        $name     = $objectAnnotation->getName();
        $beanName = empty($name) ? $className : $name;

        ProcessCollector::collect($className, $objectAnnotation, $propertyName, $methodName, $propertyValue);

        return [$beanName, $scope, ""];
    }
467884
public function like($propertyName, $propertyValue) {
		$parameterName = ':' . md5($propertyName . '#' . count($this->where));
		$this->where[] = '(`' . $propertyName . '` LIKE ' . $parameterName . ')';
		$this->parameterMap[$parameterName] = '%' . $propertyValue . '%';

		return $this;
	}
1293138
public function findReplace(string $find, string $replace)
    {
        $contents = $this->file->getContents();
        $contents = \str_replace($find, $replace, $contents);
        $this->file->setContents($contents);

        return $this;
    }
79460
public function getProperty($source, $propertyName) {
        foreach ($this->getPropertyAccessors() as $accessor) {
            if ($accessor->supports($source, $propertyName)) {
                return $accessor->getProperty($source, $propertyName);
            }
        }

        return null;
    }
79466
public function setCustomProperty($propertyName, $propertyValue = '', $propertyType = null)
    {
        if (($propertyType === null) || (!in_array($propertyType, array(self::PROPERTY_TYPE_INTEGER,
                                                                        self::PROPERTY_TYPE_FLOAT,
                                                                        self::PROPERTY_TYPE_STRING,
                                                                        self::PROPERTY_TYPE_DATE,
                                                                        self::PROPERTY_TYPE_BOOLEAN)))) {
            if ($propertyValue === null) {
                $propertyType = self::PROPERTY_TYPE_STRING;
            } elseif (is_float($propertyValue)) {
                $propertyType = self::PROPERTY_TYPE_FLOAT;
            } elseif (is_int($propertyValue)) {
                $propertyType = self::PROPERTY_TYPE_INTEGER;
            } elseif (is_bool($propertyValue)) {
                $propertyType = self::PROPERTY_TYPE_BOOLEAN;
            } else {
                $propertyType = self::PROPERTY_TYPE_STRING;
            }
        }

        $this->customProperties[$propertyName] = array(
            'value' => $propertyValue,
            'type' => $propertyType
        );
        return $this;
    }
972287
public function applyContainFilter(CollectionFinderInterface $finder, $fieldName)
    {
        $filterValue = $this->state->get("filter." . $fieldName, null);
        if (!empty($filterValue)) {
            $finder = $finder->with($fieldName, Operator::CONTAINS, $filterValue);
        }

        return $finder;
    }
152489
protected function map(
        $propertyName,
        $columnName = null,
        \Closure $fromArrayCallback = null,
        \Closure $toArrayCallback = null
    ) {
        if (!$columnName) {
            $columnName = $propertyName;
        }

        if ($columnName instanceof \Closure) {
            $fromArrayCallback = $columnName;
            $columnName        = null;
        }

        if ($columnName) {
            $this->columnsToProperties[$columnName] = $propertyName;
            $this->columns[]                        = $columnName;
        }
        $this->properties[] = $propertyName;

        if ($fromArrayCallback) {
            $this->propertiesFromArrayCallbacks[$propertyName] = $fromArrayCallback;
        }

        if ($toArrayCallback) {
            $this->propertiesToArrayCallbacks[$propertyName] = $toArrayCallback;
        }

        return $this;
    }