2015-12-30
@override
@see \Df\Core\O::_construct()
199404
protected function _construct() {
		parent::_construct();
		$this
			->_prop(self::$P__ITEM_CLASS, DF_V_STRING_NE)
			->_prop(self::$P__ITEMS_A, DF_V_ARRAY)
		;
	}
34697
public function build(): GetComputedStyleForNodeRequest
	{
		$instance = new GetComputedStyleForNodeRequest();
		if ($this->nodeId === null) {
			throw new BuilderException('Property [nodeId] is required.');
		}
		$instance->nodeId = $this->nodeId;
		return $instance;
	}
902181
private function addConstructor()
    {
        $targetDirs = $this->exportTargetDirs();
        $arguments = $this->container->getParameterBag()->all() ? 'new ParameterBag($this->getDefaultParameters())' : null;

        $code = <<<EOF

    /*{$this->docStar}
     * Constructor.
     */
    public function __construct()
    {{$targetDirs}
        parent::__construct($arguments);

EOF;

        $code .= $this->addMethodMap();
        $code .= $this->addPrivateServices();
        $code .= $this->addAliases();

        $code .= <<<'EOF'
    }

EOF;

        return $code;
    }
385362
function _constructor () {
    converterOptions = converterOptions || {};

    for (var gOpt in globalOptions) {
      if (globalOptions.hasOwnProperty(gOpt)) {
        options[gOpt] = globalOptions[gOpt];
      }
    }

    // Merge options
    if (typeof converterOptions === 'object') {
      for (var opt in converterOptions) {
        if (converterOptions.hasOwnProperty(opt)) {
          options[opt] = converterOptions[opt];
        }
      }
    } else {
      throw Error('Converter expects the passed parameter to be an object, but ' + typeof converterOptions +
      ' was passed instead.');
    }

    if (options.extensions) {
      showdown.helper.forEach(options.extensions, _parseExtension);
    }
  }
223123
public function _construct()
    {
        $this->defaultOptions = $this->rulesType->defaultOptions();

        $this->conditionMap         = [
            'eq' => 'neq',
            'neq' => 'eq',
            'gteq' => 'lteq',
            'lteq' => 'gteq',
            'gt' => 'lt',
            'lt' => 'gt',
            'like' => 'nlike',
            'nlike' => 'like',
        ];
        $this->attributeMapForQuote = [
            'method' => 'method',
            'shipping_method' => 'shipping_method',
            'country_id' => 'country_id',
            'city' => 'city',
            'region_id' => 'region_id',
            'customer_group_id' => 'main_table.customer_group_id',
            'coupon_code' => 'main_table.coupon_code',
            'subtotal' => 'main_table.subtotal',
            'grand_total' => 'main_table.grand_total',
            'items_qty' => 'main_table.items_qty',
            'customer_email' => 'main_table.customer_email',
        ];
        $this->attributeMapForOrder = [
            'method' => 'method',
            'shipping_method' => 'main_table.shipping_method',
            'country_id' => 'country_id',
            'city' => 'city',
            'region_id' => 'region_id',
            'customer_group_id' => 'main_table.customer_group_id',
            'coupon_code' => 'main_table.coupon_code',
            'subtotal' => 'main_table.subtotal',
            'grand_total' => 'main_table.grand_total',
            'items_qty' => 'items_qty',
            'customer_email' => 'main_table.customer_email',
        ];
        parent::_construct();
        $this->_init(\Dotdigitalgroup\Email\Model\ResourceModel\Rules::class);
    }
1159604
protected function build()
    {
        $sql = "SELECT\n\t"
            . $this->columns . "\n"
            . $this->from . "\n"
            . ($this->join    ? $this->join           : null)
            . ($this->where   ? $this->where . "\n"   : null)
            . ($this->groupby ? $this->groupby . "\n" : null)
            . ($this->orderby ? $this->orderby . "\n" : null)
            . ($this->limit   ? $this->limit . "\n"   : null)
            . ($this->offset  ? $this->offset . "\n"  : null)
            . ";";

        return $sql;
    }
144799
final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return
		!($id = $this->o()->getCustomerId()) ? null : df_customer($id)
	;});}
591895
public function _construct()
    {
        $this->_init(
            \Dotdigitalgroup\Email\Model\Importer::class,
            \Dotdigitalgroup\Email\Model\ResourceModel\Importer::class
        );
    }
983352
public function _construct()
    {
        $this->_init(
            \Dotdigitalgroup\Email\Model\Consent::class,
            \Dotdigitalgroup\Email\Model\ResourceModel\Consent::class
        );
    }
1014471
protected function construct():parent
	{
		$name= $this->line->pregGet('/(?<=^~)[\w-]*/');
		$this->name=$name;

		$this->loadConfig($name,$this->htsl);

		$this->param= $this->line->pregGet('/^~[\w-]*\( (.*) \)/',1);

		$this->structureName=$this->config['name']??$name;

		$this->id=strtoupper(uniqid());

		return $this;
	}
100785
protected function _construct()
    {
        $idField = $this->metadataPool->getMetadata(CategoryInterface::class)->getIdentifierField();
        $this->_init('smile_elasticsuitecatalog_category_filterable_attribute', $idField);
    }
207722
public function build()
    {
        $options           = $this->suppliedOptions;
        $this->tablePrefix = $this->db->getTablePrefix();
        $nested            = $this->getNestedRelationships($options['relationship']);

        $relevantName      = $nested['pieces'][sizeof($nested['pieces']) - 1];
        $relevantModel     = $nested['models'][sizeof($nested['models']) - 2];
        $options['nested'] = $nested;

        $relationship = $relevantModel->{$relevantName}();
        $selectTable  = $options['column_name'].'_'.$this->tablePrefix.$relationship->getRelated()->getTable();

        //set the relationship object so we can use it later
        $this->relationshipObject = $relationship;

        //replace the (:table) with the generated $selectTable
        $options['select'] = str_replace('(:table)', $selectTable, $options['select']);

        $this->suppliedOptions = $options;
    }
1347002
protected function _construct()
    {
        parent::_construct();

        $this->setUseConfirm(true);
        $this->setUseAjax(true);

        $this->setShowManageStoresLink(0);

        if (!$this->hasData('switch_containers')) {
            $this->setSwitchContainers(false);
        }
        if (!$this->hasData('switch_store_views')) {
            $this->setSwitchStoreViews(true);
        }

        $this->setDefaultSelectionName(__('All Store Views'));
    }
216719
abstract public function __construct();

    /**
     * Over-write this method to emulate a public constructor as it will be called
     * by the static construction fetching its arguments.
     *
     * @param   $args
     * @return  void
     */
//    abstract public function init( $args );

    /**
     * This is the static constructor/getter of the singleton instance
     *
     * If the instance does not exist yet, it will create it fetching
     * received arguments to the constructor if it is public, or to
     * an `init()` method if it exists and is callable.
     *
     * If this method receives arguments but can not fetch them to
     * the constructor or an `init` method, a E_USER_WARNING is triggered
     * to inform user about the arguments loss.
     *
     * @return self
     */
    public static function getInstance()
    {
        if (is_null(self::$_instance)) {
            $_class     = get_called_class();
            $reflection = new ReflectionClass($_class);
            if ($reflection->isInstantiable()) {
                self::$_instance = $reflection->newInstanceArgs(func_get_args());
            } else {
                self::$_instance = new $_class();
                if (func_num_args()>0) {
                    if ($reflection->hasMethod('init') && $reflection->getMethod('init')->isPublic()) {
                        call_user_func_array(array(self::$_instance, 'init'), func_get_args());
                    } else {
                        trigger_error(
                            sprintf('The singleton type "%s" has no public constructor or "init()" method, the arguments will not be passed to the instance!', $_class),
                            E_USER_WARNING
                        );
                    }
                }
            }
        }
        return self::$_instance;
    }
776730
private function _constructSql() {
        if($this->sql) {
            return [$this->sql,$this->params];
        }
        $distinct = $this->distinct ? 'DISTINCT' : '';
        $groupby = '';
        if (!empty($this->group)) {
            $groupby = 'GROUP BY ' . $this->group;
        }
        if (!empty($this->having)) {
            $groupby .= ' ' . $this->having;
        }
        $order = !empty($this->order) ? "ORDER BY $this->order" : '';

        $this->fields = $this->fields?$this->fields:'*';
        $sql = "SELECT $distinct $this->fields FROM `$this->table` $this->alias $this->join $this->where $groupby $order $this->limit";
        $sql = str_replace('table.',$this->alias.'.',$sql);
        return [$sql,$this->params];
    }
1148215
private function prepareConstructor()
    {
        $table_descriptor = $this->getStorageDescriptor();

        $fragment = new CNabuPHPConstructorBuilder($this);
        $fragment->addComment(
                "Instantiates the class. If you fill enough parameters to identify an instance "
              . "serialized in the storage, then the instance is deserialized from the storage.");
        if ($table_descriptor->hasPrimaryConstraint()) {
            foreach ($table_descriptor->getPrimaryConstraintFieldNames() as $field_name) {
                if (nb_strEndsWith($field_name, '_id')) {
                    $var_name = substr($field_name, 0, strlen($field_name) - 3);
                } else {
                    $var_name = $field_name;
                }
                $fragment->addParam(
                        $var_name, null, true, false, 'mixed',
                        "An instance of $this->class_name or another object descending from "
                      . "\\nabu\\data\\CNabuDataObject which contains a field named $field_name,"
                      . " or a valid ID.");
                $fragment->addFragment(
                        array(
                            "if (\$$var_name) {",
                            "    \$this->transferMixedValue(\$$var_name, '$field_name');",
                            "}",
                            ''
                        )
                );
            }
        }
        $fragment->addFragment('parent::__construct();');

        if ($this->is_translated) {
            $list_name = preg_replace('/Base$/', 'LanguageList', $this->class_name);
            $list_ns = preg_replace('/\\\\base/', '', $this->class_namespace);
            $fragment->addFragment('$this->__translatedConstruct();');
            $fragment->addFragment("\$this->translations_list = new $list_name();");
            $this->getDocument()->addUse("\\$list_ns\\$list_name");
        }

        $this->addFragment($fragment);
    }
64773
public function build()
    {
        $value = sprintf("'%s'", $this->value);

        $where = sprintf('WHERE %s %s %s', $this->column, $this->operator, $value);

        $keyword = $this->keyword;

        if (!is_null($keyword)) {
            $where = sprintf(' %s %s', $keyword, $where);
        }

        return $where;
    }