{@inheritDoc}
@see \rocket\ei\manage\draft\DraftProperty::createDraftValueSelection()
166525
public function createDraftValueSelection(FetchDraftStmtBuilder $selectDraftStmtBuilder, DraftManager $dm, 
			N2nContext $n2nContext): DraftValueSelection {
				
		return new SimpleToOneDraftValueSelection($selectDraftStmtBuilder->requestColumn(EiPropPath::from($this)),
				$dm->getEntityManager(), $this->eiPropRelation->getTargetEiType()->getEntityModel());
	}
933525
public function supplyPersistDraftStmtBuilder($targetDraft, $oldTargetDraft, 
			PersistDraftStmtBuilder $persistDraftStmtBuilder, PersistDraftAction $persistDraftAction) {
		ArgUtils::assertTrue($targetDraft === null || $targetDraft instanceof Draft);
		ArgUtils::assertTrue($oldTargetDraft === null || $oldTargetDraft instanceof Draft);
		
		if ($oldTargetDraft !== null && $oldTargetDraft !== $targetDraft) {
			$persistDraftAction->getQueue()->remove($oldTargetDraft);
		}
		
		if ($targetDraft === null) {
			$persistDraftStmtBuilder->registerColumnRawValue(EiPropPath::from($this), null);
			return;
		}

		$targetDraftAction = $persistDraftAction->getQueue()->persist($targetDraft, $this->eiPropRelation->getTargetEiMask()
				->getDraftDefinition());
		
		if (!$targetDraft->isNew()) {
			$persistDraftStmtBuilder->registerColumnRawValue(EiPropPath::from($this), $targetDraft->getId());
			return;
		}
		
		$persistDraftAction->addDependent($targetDraftAction);
		$targetDraftAction->executeAtEnd(function () use ($persistDraftStmtBuilder, $targetDraft) {
			$persistDraftStmtBuilder->registerColumnRawValue(EiPropPath::from($this), $targetDraft->getId());
		});
	}
1227805
protected function _initSelect()
    {
        $request = $this->_objectManager->get('Magento\Framework\App\RequestInterface');
        $this->getSelect()->from(['main_table' => $this->getMainTable()]);

        if(!empty($customerId = $request->getParam('id'))) {
            $this->getSelect()->where('customer_id = ?', $customerId);
        }

        return $this;
    }
187886
private function addSelectionMethod(QueryBuilderResult $query, $methodName)
    {
        $findMethod = function () use ($query, $methodName) {

            $sth = $this->pdo->prepare($query->getSql());
            /** @noinspection PhpMethodParametersCountMismatchInspection */
            $sth->setFetchMode(\PDO::FETCH_CLASS, $this->entityClass->getName());
            try {
                $sth->execute(func_get_args());
            } catch (PDOException $e) {
                throw new DslSyntaxException('Failed to run query [' . $methodName . '] with parameters ' . print_r(func_get_args(), true));
            }

            switch ($query->getResultMode()) {
                case QueryBuilderResult::RESULT_SELECT_SINGLE:
                    return $sth->fetch();
                case QueryBuilderResult::RESULT_SELECT_MULTIPLE:
                    return $sth->fetchAll();
            }

            throw new DslSyntaxException('Result Mode ' . $query->getResultMode() . ' is not implemented', DATADO_ILLEGAL_RESULT_MODE);

        };

        $this->methods[$methodName] = \Closure::bind($findMethod, $this, get_class());
    }
1082687
private function addAjaxPropertyForEditAll()
    {
        $inputProvider = $this->getEnvironment()->getInputProvider();

        if (('select' !== $inputProvider->getParameter('act'))
            && ('edit' !== $inputProvider->getParameter('select'))
            && ('edit' !== $inputProvider->getParameter('mode'))
        ) {
            return;
        }

        $originalProperty = $this->findOriginalPropertyByModelId($inputProvider->getValue('name'));
        if (null === $originalProperty) {
            return;
        }

        $propertiesDefinition = $this->getEnvironment()->getDataDefinition()->getPropertiesDefinition();

        $propertyClass = \get_class($originalProperty);

        $property = new $propertyClass($inputProvider->getValue('name'));
        $property->setLabel($originalProperty->getLabel());
        $property->setDescription($originalProperty->getDescription());
        $property->setDefaultValue($originalProperty->getDefaultValue());
        $property->setExcluded($originalProperty->isExcluded());
        $property->setSearchable($originalProperty->isSearchable());
        $property->setFilterable($originalProperty->isFilterable());
        $property->setWidgetType($originalProperty->getWidgetType());
        $property->setExplanation($originalProperty->getExplanation());
        $property->setExtra($originalProperty->getExtra());

        $propertiesDefinition->addProperty($property);
    }
1024617
static function select($name, $option, $default = null, $self = null, $attrArray = null, $add_help = true, $force = false)
	{
		$htmlStr = "<select name=\"$name\" id=\"$name\"";
		$htmlStr .= self::input_attr($attrArray) . ">\n";

        if ($add_help) {
            if ($add_help === true) {
                $htmlStr .= "<option value=\"\">" . self::$default_help_option . "</option>\n";
            } else {
                $htmlStr .= "<option value=\"\">$add_help</option>\n";
            }
        }
        foreach ($option as $key => $value) {
            if ($self) {
                $key = $value;
            }

            if (!$force and $key == $default) {
                $htmlStr .= "<option value=\"{$key}\" selected=\"selected\">{$value}</option>\n";
            } elseif ($force and $key === $default) {
				$htmlStr .= "<option value=\"{$key}\" selected=\"selected\">{$value}</option>\n";
			} else {
                $htmlStr .= "<option value=\"{$key}\">{$value}</option>\n";
            }
        }
        $htmlStr .= "</select>\n";

		return $htmlStr;
	}
1136646
public function select($multiple = false)
	{
		if ( !$this->isSelected() ) {
			if ( $this->select === null ) {
				throw new SelectException(
					'No SELECT element association defined',
					SelectException::TYPE_UNBOUND_OPTION
				);
			}

			$this->select->getWrappedElement()->selectOption($this->getValue(), $multiple);
		}

		return $this;
	}
498601
public function addSelect($_)
    {
        RecursiveArgs::each(func_get_args(), function ($arg) {
           $this->selectClauses[] = $arg;
        });

        return $this;
    }
418172
protected function _initSelect()
    {
        parent::_initSelect();

        $this->addFieldToFilter(
            ['is_searchable', 'is_filterable', 'is_filterable_in_search', 'is_used_for_promo_rules', 'used_for_sort_by'],
            [true, [1, 2], true, true, true]
        );

        $conditions = [
            $this->_getConditionSql('backend_type', ['in' => $this->availableBackendTypes]),
            "(backend_type = 'varchar' AND frontend_class = 'validate-number')",
            "(backend_type = 'varchar' AND frontend_class = 'validate-digits')",
        ];

        $this->getSelect()->where(implode(' OR ', $conditions));

        return $this;
    }
117414
public function makeSelect(string $connectionName = ''): SelectQueryBuilder
    {
        $connection = $this->provideConnection($connectionName);
        $statementBuilder = new SelectStatementBuilder;
        return new SelectQueryBuilder($connection, $statementBuilder);
    }
1243822
public function createSelect(array $options = [], $selected = null, array $attributes = [])
    {
        $field = new Form\Elements\Select();

        if (count($options)) {
            $field->createOptions($options, $selected);
        }

        if (count($attributes)) {
            foreach ($attributes as $name => $value) {
                $field->attributes->addAttribute($name, $value);

                if ($name === 'name') {
                    $this->entity->setEntityName('input-' . $value);

                    if ( ! array_key_exists('id', $attributes)) {
                        $field->attributes->setAttributeId('input-' . $value);
                    }
                }
            }
        }

        return $this->input = $field;
    }
1335557
public function putSelectFields($objBuilder, $strPrefix = null, $objSelect = null)
    {
        if ($strPrefix) {
            $strTableName = $strPrefix;
            $strAliasPrefix = $strPrefix . '__';
        } else {
            $strTableName = $this->strTableName;
            $strAliasPrefix = '';
        }

        if ($objSelect) {
            if (!$objSelect->skipPrimaryKey() && !$objBuilder->Distinct) {
                $strFields = $this->primaryKeyFields();
                foreach ($strFields as $strField) {
                    $objBuilder->addSelectItem($strTableName, $strField, $strAliasPrefix . $strField);
                }
            }
            $objSelect->addSelectItems($objBuilder, $strTableName, $strAliasPrefix);
        } else {
            $strFields = $this->fields();
            foreach ($strFields as $strField) {
                $objBuilder->addSelectItem($strTableName, $strField, $strAliasPrefix . $strField);
            }
        }
    }
1039827
public function build()
    {
        if (is_null($this->selectFields)) {
            throw new RuntimeException('The `select()` function must be' .
                ' called prior to this function');
        }

        $awql = $this->buildSelectClause();
        $awql = $this->appendWhereClause($awql);
        $awql = $this->appendOrderByClause($awql);

        if (is_null($this->startIndex) && is_null($this->pageSize)) {
            return new ServiceQuery($awql);
        }
        return new ServiceQuery(
            $awql,
            $this->startIndex,
            $this->pageSize
        );
    }
1195599
protected function generateSelect($options, $currentValue = null)
    {
        $value = is_null($currentValue) ? $options['value'] : $currentValue;

        unset($options["type"]);
        unset($options["value"]);

        $optionsHtml = "";
        if (array_key_exists("choices", $options) && is_array($options["choices"])) {
            foreach ($options["choices"] as $key => $val) {
                $optionsHtml .= sprintf('<option%s value="%s">%s</option>', "$key" === "$value" ? ' selected="selected"' : '', $key, $val);
            }
            unset($options["choices"]);
        }

        return sprintf('<select %s>%s</select>', $this->arrayToHtmlAttributes($options), $optionsHtml);
    }
1314257
public function supplyRemoveDraftStmtBuilder($targetDrafts, $oldTargetDrafts, 
			RemoveDraftStmtBuilder $removeDraftStmtBuilder, RemoveDraftAction $removeDraftAction) {
		$draftActionQueue = $removeDraftAction->getQueue();
		foreach ($oldTargetDrafts as $oldTargetDraft) {
			$draftActionQueue->remove($oldTargetDraft);
		}
		
		$this->createRelationDraftAction($removeDraftStmtBuilder, $removeDraftAction);
	}
1280148
function Select($distinct, SelectList $selectList, Source $source, Condition $condition = null, OrderList $orderList = null, GroupList $groupList = null, $offset = 0, $count = 0)
    {
        return parent::CreateSelect($distinct, $selectList, $source, $condition, $orderList, $groupList, $offset, $count); 
    }
498879
public function create(
        $width,
        $currentPageNumber,
        $lastPageNumber,
        $actionFirstPage,
        $actionPreviousPage,
        $actionNextPage,
        $actionLastPage,
        $actionGotoPage
    ) {

        $frame = Frame::Create();
        $frame->setSize($width, 16);

        $pagerLine = $this->uiFactory->createLayoutLine(0, -1);
        $buttonSize = 6;

        $empty = Quad::create();
        $empty->setOpacity(0)->setSize($buttonSize, $buttonSize);

        // Show previous buttons
        if ($currentPageNumber > 2) {
            $button = $this->uiFactory->createButton("", Button::TYPE_DECORATED);
            $button
                ->setSize($buttonSize, $buttonSize)
                ->setAction($actionFirstPage);
        } else {
            $button = clone $empty;
        }


        $pagerLine->addChild($button);

        if ($currentPageNumber > 1) {
            $button = $this->uiFactory->createButton("", Button::TYPE_DECORATED);
            $button
                ->setSize($buttonSize, $buttonSize)
                ->setAction($actionPreviousPage);

        } else {
            $button = clone $empty;
        }
        $pagerLine->addChild($button);


        // Show current page.

        $input = $this->uiFactory->createInput('pager_gotopage', $currentPageNumber, 7);
        $input->setAction($actionGotoPage)->setPosition(0, 1)->setHorizontalAlign("center");


        $label = $this->uiFactory->createLabel(" / $lastPageNumber");
        $label->setSize(10, 7)->setHorizontalAlign("left");

        $line = $this->uiFactory->createLayoutLine(0, -2);
        $line->setHorizontalAlign("left");
        $line->addChildren([$input, $label]);

        if ($lastPageNumber > 1) {
            $pagerLine->addChild($line);
        } else {
            $label->setText("1 / 1");
            $pagerLine->addChild($label);
        }

        if ($currentPageNumber < $lastPageNumber) {
            $button = $this->uiFactory->createButton("", Button::TYPE_DECORATED);
            $button
                ->setSize($buttonSize, $buttonSize)
                ->setZ(3)
                ->setAction($actionNextPage);

        } else {
            $button = clone $empty;
        }
        $pagerLine->addChild($button);

        if ($currentPageNumber < $lastPageNumber - 1) {
            $button = $this->uiFactory->createButton("", Button::TYPE_DECORATED);
            $button
                ->setSize($buttonSize, $buttonSize)
                ->setAction($actionLastPage);

        } else {
            $button = clone $empty;
        }
        $pagerLine->addChild($button);

        $pagerLine->setAlign("center", "top");
        $pagerLine->setX(($width - $pagerLine->getWidth()) / 2);


        $borderTop = $this->uiFactory->createLine(0, 0);
        $borderTop->setLength($width)->setColor("fff");

        $frame->addChild($borderTop);
        $frame->addChild($pagerLine);

        return $frame;
    }