@param Args         $args
@param ClassBinding $bindingToUpdate

@return ClassBinding
18106
private function getUpdatedClassBinding(Args $args, ClassBinding $bindingToUpdate)
    {
        $className = $bindingToUpdate->getClassName();
        $typeName = $bindingToUpdate->getTypeName();
        $bindingParams = $bindingToUpdate->getParameterValues();

        if ($args->isOptionSet('class')) {
            $className = $args->getOption('class');
        }

        if ($args->isOptionSet('type')) {
            $typeName = $args->getOption('type');
        }

        $this->parseParams($args, $bindingParams);
        $this->unsetParams($args, $bindingParams);

        return new ClassBinding(
            $className,
            $typeName,
            $bindingParams,
            $bindingToUpdate->getUuid()
        );
    }
173578
public function bind()
    {
        if (func_num_args()) {
            $bindings = new Bindings(func_get_args(), $this->rules);
            $this->rules = $bindings->rules();
        }

        return $this;
    }
1321363
public function loadClassMetadata(LoadClassMetadataEventArgs $args)
    {
        if (empty($this->prefix)) {
            return;
        }

        /** @var ClassMetadata $classMetadata */
        $classMetadata = $args->getClassMetadata();

        if (false === strpos($classMetadata->getTableName(), $this->prefix)) {
            $tableName = $this->prefix . $classMetadata->getTableName();
            $classMetadata->setPrimaryTable(['name' => $tableName]);
        }

        foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {
            if ($mapping['type'] == ClassMetadataInfo::MANY_TO_MANY && $mapping['isOwningSide'] === true) {
                $mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name'];

                if (false !== strpos($mappedTableName, $this->prefix)) {
                    continue;
                }

                $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix . $mappedTableName;
            }
        }
    }
1209853
function (args, propertyName) {
                if (this._cfg) {
                    this.onbind(propertyName, this._transform(this._cfg.bind[propertyName].transform, args.newValue, "toWidget"), args.oldValue);
                }
            }
989755
private void _buildLogicalBinding(
                    final LogicalBinding binding,
                    final StringBuilder stmt,
                    final List<Object> params
                    )
    {
        final int  size = binding.size();

        if (size < 2) {
            throw new IllegalArgumentException(
                            "LogicalBinding with less than two element bindings" );
        }

        final String  logic = (binding instanceof AndBinding) ? _AND_ : _OR_;
        stmt.append( " (" );
        for (int  i = 0; i < size; i++) {
            if (i > 0) {
                stmt.append( logic );
            }
            _buildBinding( binding.getElementAt( i ), stmt, params );
        }
        stmt.append( ")" );
    }
451643
protected function compileImplementationBinding(Binding $binding)
	{
		$code = "return \$this->createObject(";
		$code .= var_export($binding->getTarget(), true) . ', [';
		$rpos = 0;
		
		foreach((array)$binding->getResolvers() as $para => $resolver)
		{
			if($rpos++ > 0)
			{
				$code .= ', ';
			}
				
			if($resolver instanceof \Closure)
			{
				$num = count($this->methods);
		
				$ref = new \ReflectionFunction($resolver);
				$sig = $this->generateReplacementMethodSignature($ref, $num);
				$body = $this->extractClosureCode($ref);
		
				$this->methods[] = "\t\t" . $sig . " {\n" . $body . "\n\t\t}";
		
				$call = $this->generateCallCode($binding->getTypeName(), $ref, $num);
		
				$code .= var_export($para, true) . ' => function(InjectionPointInterface $point = NULL) { return ' . $call . '; }';
			}
			else
			{
				$code .= var_export($para, true) . ' => ' . var_export($resolver, true);
			}
		}
		
		$code .= "], [";
		$rpos = 0;
		
		foreach((array)$binding->getInitializers() as $initializer)
		{
			if($rpos++ > 0)
			{
				$code .= ', ';
			}
				
			$num = count($this->methods);
				
			$ref = new \ReflectionFunction($initializer);
			$sig = $this->generateReplacementMethodSignature($ref, $num);
			$body = $this->extractClosureCode($ref);
				
			$code .= '[$this, ' . var_export('call_' . $num, true) . ']';
				
			$this->methods[] = "\t\t" . $sig . " {\n" . $body . "\n\t\t}";
		}
		
		$code .= "], " . $this->compileSetterInjector($binding) . ");\n";
		$code .= ";\n";
		
		return $code;
	}
99058
public function prePersist(EventArgs $args)
    {
        $em = $args->getEntityManager();
        $object = $args->getObject();
        $class = get_class($object);
        $meta = $em->getClassMetadata($class);

        $reflectionClass = $meta->getReflectionClass();

        if (!$reflectionClass || !$this->hasTrait($reflectionClass, 'Blast\BaseEntitiesBundle\Entity\Traits\Sortable')) {
            return;
        } // return if current entity doesn't use Sortable trait

        if ($object->getSortRank()) {
            return;
        }

        $maxPos = $this->getMaxPosition($em, $meta);
        $maxPos = $maxPos ? $maxPos + 1000 : 65536;

        $object->setSortRank($maxPos);
        $this->maxPositions[$class] = $maxPos;
    }
812458
public function setBindings(array $bindings)
    {
        foreach ($bindings as $key => $binding) {
            if (!$binding instanceof BoundArgument) {
                $bindings[$key] = new BoundArgument($binding);
            }
        }

        $this->bindings = $bindings;

        return $this;
    }
974659
protected function prepareArguments( $cpt, array $args ) {
		$defaults = $this->getConfigKey( static::DEFAULTS );

		return ( new ArgumentCollection(
			array_replace_recursive( $defaults, $this->getConfigKey( $cpt ),
				$args )
		) )->prepareLabels();
	}
927646
public function genUnionBindValues (&$query, $args)
	{
		
		foreach ($args as $key => $arg)
		{

			if (isset ($arg['where']) && is_array ($arg['where']))
			{
				$this->genBindValues ($query, $arg['where']);
			}
			
			if (isset ($arg['having']) && is_array ($arg['having']))
			{
				$this->genBindValues ($query, $arg['having']);
			}

		}
	}
867594
public function executeProcedure($procedureName, array $bindings = [])
    {
        $stmt = $this->createStatementFromProcedure($procedureName, $bindings);

        $stmt = $this->addBindingsToStatement($stmt, $bindings);

        return $stmt->execute();
    }
782821
public function doBind( PDOStatement $stmt )
    {
        foreach ( $this->boundValues as $key => $value )
        {
            try
            {
                $stmt->bindValue( $key, $value, $this->boundValuesType[$key] );
            }
            catch ( PDOException $e )
            {
                // see comment below
            }
        }
        foreach ( $this->boundParameters as $key => &$value )
        {
            try
            {
                $stmt->bindParam( $key, $value, $this->boundParametersType[$key] );
            }
            catch ( PDOException $e )
            {
                // we are ignoring this exception since it may only occur when
                // a bound parameter is not found in the query anymore.
                // this can happen if either drop an expression with a bound value
                // created with this query or if you remove a bind in a query by
                // replacing it with another one.
                // the only other way to avoid this problem is parse the string for the
                // bound variables. Note that a simple search will not do since the variable
                // name may occur in a string.
            }
        }
    }
12307
public function handleDisable(Args $args)
    {
        $bindingToDisable = $this->getBindingByUuidPrefix($args->getArgument('uuid'));

        if ($bindingToDisable->getContainingModule() instanceof RootModule) {
            throw new RuntimeException(sprintf(
                'Cannot disable bindings in the module "%s".',
                $bindingToDisable->getContainingModule()->getName()
            ));
        }

        $this->discoveryManager->disableBindingDescriptor($bindingToDisable->getUuid());

        return 0;
    }
1352508
public static function createBoundValidator($methodName, ...$boundArgs)
    {
        return function (...$args) use ($methodName, $boundArgs) {
            return call_user_func_array("self::$methodName", array_merge($boundArgs, $args));
        };
    }
97060
public function onClassMetadataNotFound(OnClassMetadataNotFoundEventArgs $args)
    {
        if (array_key_exists($args->getClassName(), $this->resolveTargetEntities)) {
            $args->setFoundMetadata(
                $args
                    ->getObjectManager()
                    ->getClassMetadata($this->resolveTargetEntities[$args->getClassname()]['targetEntity'])
            );
        }
    }
555558
public DataBinder load(String[] args, int offset) {
        for (int i = offset; i < args.length; ++i) {
            int equal = args[i].indexOf('=');
            if (equal > 0) {
                put(args[i].substring(0, equal), args[i].substring(equal + 1));
            } else {
                throw new RuntimeException("***InvalidParameter{" + args[i] + '}');
            }
        }
        return this;
    }
1099234
public static function bindInstance($instance, $methodName, $args = null)
    {
        $helper = new self();
        return $helper->createClosure($methodName, $args)->bindTo($instance, get_class($instance));
    }