Builds the addJoin method
@return void
@throws \Exception
344484
private function buildAddJoin() {
        $aliases = array();
        foreach($this->getRelationships() as $relationship) {
            $aliases[] = $relationship->getAlias();
        }
        $content = 'switch($alias) {
';
        foreach($this->getRelationships() as $relationship) {
            $method = new Object\Method();
            $method->setAccess('private');
            $method->setName('addJoin' . $relationship->getAlias());
            $method->setDescription('This adds a join for the specific relationship');
            $method->setReturnType('string - The name of the model we just joined on');
            $method->setContent(
                '//Check if join already added
				$joins = $criteriaHelper->getJoins();
				foreach($joins as $join) {
					if($join[2]==\'' . $relationship->getAlias() . '\') {
						return \'' . $relationship->getRemoteModel() . '\';
					}
				}
				$criteriaHelper->getCriteria()->leftJoin(
					\'' . $relationship->getRemoteModel() . '\',
					$currentModelAlias.\'.' . $this->getField($relationship->getLocalColumn())->getShortName()
                . '=' . $relationship->getAlias()
                . '.' . $relationship->getRemoteShortColumn() . '\',
					\'' . $relationship->getAlias() . '\'
				);
				return \'' . $relationship->getRemoteModel() . '\';'
            );
            $parameter = new Object\Parameter();
            $parameter->setName('criteriaHelper');
            $parameter->setDescription('The criteria we are adding the join on to');
            $parameter->setType('CriteriaHelper');
            $parameter->setStrictType(true);
            $method->addParameter($parameter);
            $parameter = new Object\Parameter();
            $parameter->setName('currentModelAlias');
            $parameter->setDescription('The current model\'s alias');
            $parameter->setType('string');
            $method->addParameter($parameter);
            $this->getAbstractClass()->addMethod($method);

            $content .= '			case \'' . $relationship->getAlias() . '\':
				return $this->addJoin' . $relationship->getAlias() . '($criteriaHelper, $currentModelAlias);
				break;
';
        }
        $content .= '		}
		return null;';

        $method = new Object\Method();
        $method->setAccess('private');
        $method->setName('addJoinFromAlias');
        $method->setDescription('This adds a join based off of the aliases to an existing criteria, you can do nested joins, using a ., such as User.BranchSharing');
        $method->setReturnType('string - The name of the model we just joined on');
        $method->setContent($content);
        $parameter = new Object\Parameter();
        $parameter->setName('criteriaHelper');
        $parameter->setDescription('The criteria we are adding the join on to');
        $parameter->setType('CriteriaHelper');
        $parameter->setStrictType(true);
        $method->addParameter($parameter);
        $parameter = new Object\Parameter();
        $parameter->setName('alias');
        $parameter->setDescription('The alias of the relationship');
        $parameter->setType('string');
        $method->addParameter($parameter);
        $parameter = new Object\Parameter();
        $parameter->setName('currentModelAlias');
        $parameter->setDescription('The current model\'s alias');
        $parameter->setType('string');
        $method->addParameter($parameter);

        $this->getAbstractClass()->addMethod($method);

        $this->getAbstractClass()->addUse('Bullhorn\FastRest\Api\Services\Database\CriteriaHelper');
        $method = new Object\Method();
        $method->setAccess('public');
        $method->setName('addJoin');
        $method->setDescription('This adds a join based off of the aliases to an existing criteria, you can do nested joins, using a ., such as User.BranchSharing');
        $method->setReturnType('string - The name of the model we just joined on');
        $method->setContent(
            'if(is_null($currentModelAlias)) {
			$currentModelAlias = \'' . str_replace('\Generated', '', $this->getAbstractClass()->getNamespace()) . '\\' . $this->getAbstractClass()->getName() . '\';
		}
		if(strpos($alias, \'.\')!==false) {
			$parts = explode(\'.\', $alias);
			$part = array_shift($parts);
			$modelName = $this->addJoin($criteriaHelper, $part, $currentModelAlias);
			/** @type GeneratedInterface $model */
			$model = new $modelName();
			return $model->addJoin($criteriaHelper, implode(\'.\', $parts), $part);
		}
		$allowedAliases = [
			\'' . implode("',\n\t\t\t'", $aliases) . '\'
		];
		if(!in_array($alias, $allowedAliases)) {
			throw new \InvalidArgumentException(\'The alias "\'.$alias.\'" is not in the allowed list of: \'.implode(\', \', $allowedAliases));
		}
		return $this->addJoinFromAlias($criteriaHelper, $alias, $currentModelAlias);
'
        );
        $parameter = new Object\Parameter();
        $parameter->setName('criteriaHelper');
        $parameter->setDescription('The criteria we are adding the join on to');
        $parameter->setType('CriteriaHelper');
        $parameter->setStrictType(true);
        $method->addParameter($parameter);

        $parameter = new Object\Parameter();
        $parameter->setName('alias');
        $parameter->setDescription('The alias of the relationship');
        $parameter->setType('string');
        $method->addParameter($parameter);
        $parameter = new Object\Parameter();
        $parameter->setName('currentModelAlias');
        $parameter->setDescription('The current model\'s alias');
        $parameter->setType('string');
        $parameter->setDefaultValue('null');
        $method->addParameter($parameter);

        $this->getAbstractClass()->addMethod($method);
    }
33387
public function build()
    {
        if ($this->builded) {
            return;
        }

        $collection = $this->processFilter(false);

        $data = $collection->toArray();

        $this->prependRowSelectorColumn();
        $this->appendActionsColumn();

        Column::setOriginalGridModels($collection);

        $this->columns->map(function (Column $column) use (&$data) {
            $data = $column->fill($data);

            $this->columnNames[] = $column->getName();
        });

        $this->buildRows($data);

        $this->builded = true;
    }
7926
protected function build()
    {
        $operation = $this->buildOperation('DeleteProfile');

        $merchantID = $this->document->createElement(
            'merchantID',
            $this->merchantId
        );
        $operation->appendChild($merchantID);

        $customerId = $this->document->createElement(
            'customerID',
            $this->customerId
        );
        $operation->appendChild($customerId);

        if ($this->profileId) {
            $profileId = $this->document->createElement(
                'profileID',
                $this->profileId
            );
            $operation->appendChild($profileId);
        }
    }
937017
public function createJoinTable()
    {
        if ($this->joinTableExists() === true) {
            return;
        }

        $q = 'CREATE TABLE \''.$this->joinTable().'\' (
            target_type VARCHAR(255),
            target_id VARCHAR(255),
            target_property VARCHAR(255),
            attachment_type VARCHAR(255),
            attachment_id VARCHAR(255),
            created DATETIME
        )';
        $this->logger->debug($q);
        $this->source()->db()->query($q);
    }
952114
public function append()
    {
        if (!$this->hasMultiHandle()) {
            $this->setMultiHandle(curl_multi_init());
        }

        // init
        $this
            ->initOption()
            ->buildBody();

        $curl = curl_init();
        curl_setopt_array($curl, $this->getOptions());
        curl_multi_add_handle($this->getMultiHandle(), $curl);

        $this->curls[] = $curl;
    }
1076677
protected function connect() : void
    {
        if (! $this->isLaravel()) {
            throw new Exception('This migrator must be ran from inside a Laravel application.');
        }

        $this->manager = app('db');
        $this->database = $this->manager->connection();
        $this->schema = $this->database->getSchemaBuilder();
    }
593411
public function build()
    {
        $this->classMetadata->addExtension($this->getExtensionName(), [
            'softDeleteable' => true,
            'fieldName'      => $this->fieldName,
            'timeAware'      => $this->timeAware,
        ]);
    }
1069123
public function add()
	{
		// Get the hook we're setting
		$trigger = $this->arguments->getOpt(3);
		$hook    = $this->arguments->getOpt(4);

		// Delete the primary args so they aren't added as top level config values
		$this->arguments->deleteOpt(3);
		$this->arguments->deleteOpt(4);

		// Set the new hooks argument
		$this->arguments->setOpt('hooks', array($trigger => array($hook)));

		// Redirect back to the basic configuration set method
		App::get('client')->call('configuration', 'set', $this->arguments, $this->output);
	}
573268
public function addJoinObject(Join $join)
    {
        if (!in_array($join, $this->joins)) { // compare equality, NOT identity
            $this->joins[] = $join;
        }

        return $this;
    }
927912
private function processJoinDefinition()
    {
        if (isset($this->definition['join']) && is_array($this->definition['join'])) {
            
            foreach ($this->definition['join'] as $join) {
                
                $array = new IsAssoc($join);
                
                if ($array->isAssoc()) {
                    $this->join[] = [
                        'table' => $join['table'],
                        'as' => $join['as'],
                        'by' => $join['by'],
                        'cond' => $join['condition']
                    ];
                } else {
                    $this->join[] = [
                        'table' => $join[0],
                        'as' => $join[1],
                        'by' => $join[2],
                        'cond' => $join[3]
                    ];
                }
            }
        }
    }
391391
protected function build()
    {
        $operation = $this->buildOperation('ListProfiles');

        $merchantID = $this->document->createElement('merchantID', $this->merchantId);
        $operation->appendChild($merchantID);

        if ($this->customerId) {
            $xmlMPayTid = $this->document->createElement('customerID', $this->customerId);
            $operation->appendChild($xmlMPayTid);
        }

        if ($this->expiredBy) {
            $xmlMPayTid = $this->document->createElement('expiredBy', $this->expiredBy);
            $operation->appendChild($xmlMPayTid);
        }

        if ($this->begin) {
            $xmlMPayTid = $this->document->createElement('begin', $this->begin);
            $operation->appendChild($xmlMPayTid);
        }

        if ($this->size) {
            $xmlMPayTid = $this->document->createElement('size', $this->size);
            $operation->appendChild($xmlMPayTid);
        }
    }
1373477
protected function loadRelationship()
    {
        $field_parameters = $this->getFieldParameters();

        $query = $this->buildRelationshipQuery($field_parameters);

        if (! $query) {
            throw new Exception('Could not build query from field parameters');
        }

        if (method_exists($this, 'amendRelationshipQuery')) {
            $query = $this->amendRelationshipQuery($query);
        }

        return $this->getRelationshipArray($query, $field_parameters);
    }
694715
public function add()
    {
        $result = HighloadBlockTable::add($this->getFieldsWithDefault());

        if (!$result->isSuccess()) {
            throw new \Exception(join(', ', $result->getErrorMessages()));
        }

        foreach ($this->lang as $lid => $name) {
            HighloadBlockLangTable::add([
                "ID" => $result->getId(),
                "LID" => $lid,
                "NAME" => $name
            ]);
        }

        Logger::log("Добавлен HL {$this->fields['NAME']}", Logger::COLOR_GREEN);

        return $result->getId();
    }
352671
public function add()
	{
		$args = func_get_args();
		
		$component = array_shift( $args );
		
		$method = 'build_'.strtolower( $component );
		
		if ( !method_exists( $this, $method ) )
		{
			throw new CCException( 'CCShipyard_Class invalid component builder "'.$component.'".' );
		}
		
		$this->output .= call_user_func_array( array( $this, $method ), $args );
	}
1256865
public function build()
    {
        // load filter
        // 1. App/Controller/filter.yml
        // 2. App/Controller/foo.filter.yml
        $filters = $this->controller->getFilters();
        for ($i = 0; $i < count($filters); $i++) {
            $this->loadFilter($filters[$i], $i !== count($filters) - 1);
        }

        // action filter is already last.
        if (! $this->has_action_filter) {
            $this->addFilter('Action');
        } else {
            $action = null;
            $names = array();
            foreach ($this->filter_names as $name) {
                if (strtolower($name) === 'action') {
                    $action = $name;
                } else {
                    $names[] = $name;
                }
            }
            $names[] = $action;
            $this->filter_names = $names;
        }
    }
155305
private function _checkJoinArray()
	{
		$defaultJoinArray = array('way' => null, 'tables' => null, 'conditionType' => null, 'condition' => null);
		if($this->joinArray === $defaultJoinArray)
		{
			throw new \Exception('one of the methods: inner(), natural(), left[Outer](), right[Outer] must called before!');
		}
	}
741789
protected function buildDataJoins()
    {
        $joins    = array('one' => array(), 'many' => array());
        $joinsUse = array();

        foreach ($this->config->getAllJoin() as $name => $join) {

            $config = $join['class'];

            if (!($config instanceof ConfigInterface)) {
                throw new \LogicException('Joined class is not an instance of ConfigInterface!');
            }

            $class = $config->getClassname();

            if ('one' === $join['type']) {
                $joinMethod = $this->buildDataJoinsOne($config, $join['keys']);
            } else {
                $joinMethod = $this->buildDataJoinsMany($config, $join['keys']);
            }
            $joins[$join['type']][] = $joinMethod;

            $joinsUse[$class] = 'use ' . $this->baseNamespace . 'Data\\' . $config->getNamespace() . '\\' . $class . ';';
            $joinsUse[$class . 'Mapper'] = 'use ' . $this->baseNamespace . 'Mapper\\' . $config->getNamespace() . '\\' . $class . 'Mapper;';

        }

        $this->vars['joins_use'] = implode("\n", $joinsUse);
        $this->vars['joins']     = implode("\n", $joins['one']) . "\n" . implode("\n", $joins['many']);
    }