14 class Collection extends \Magento\Eav\Model\Entity\Collection\VersionControl\AbstractCollection
55 \
Magento\Eav\Model\EntityFactory $eavEntityFactory,
61 $modelName = self::CUSTOMER_MODEL_NAME
63 $this->_fieldsetConfig = $fieldsetConfig;
64 $this->_modelName = $modelName;
99 [
'email_count' =>
new \
Zend_Db_Expr(
'COUNT(email.entity_id)')]
101 'email.entity_id = e.entity_id' 117 $customerAccount = $this->_fieldsetConfig->getFieldset(
'customer_account');
118 foreach ($customerAccount as
$code => $field) {
119 if (isset($field[
'name'])) {
126 if (isset(
$fields[
'prefix'])) {
128 '{{prefix}} IS NOT NULL AND {{prefix}} != \'\'',
129 $connection->getConcatSql([
'LTRIM(RTRIM({{prefix}}))',
'\' \
'']),
133 $concatenate[] =
'LTRIM(RTRIM({{firstname}}))';
134 $concatenate[] =
'\' \
'';
135 if (isset(
$fields[
'middlename'])) {
137 '{{middlename}} IS NOT NULL AND {{middlename}} != \'\'',
138 $connection->getConcatSql([
'LTRIM(RTRIM({{middlename}}))',
'\' \
'']),
142 $concatenate[] =
'LTRIM(RTRIM({{lastname}}))';
143 if (isset(
$fields[
'suffix'])) {
145 '{{suffix}} IS NOT NULL AND {{suffix}} != \'\'',
146 $connection->getConcatSql([
'\' \
'',
'LTRIM(RTRIM({{suffix}}))']),
151 $nameExpr =
$connection->getConcatSql($concatenate);
165 $select = parent::getSelectCountSql();
180 $idsSelect = parent::_getAllIdsSelect($limit, $offset);
181 $idsSelect->resetJoinLeft();
_init($model, $entityModel)
_getAllIdsSelect($limit=null, $offset=null)
const CUSTOMER_MODEL_NAME
__construct(\Magento\Framework\Data\Collection\EntityFactory $entityFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\App\ResourceConnection $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Eav\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot $entitySnapshot, \Magento\Framework\DataObject\Copy\Config $fieldsetConfig, \Magento\Framework\DB\Adapter\AdapterInterface $connection=null, $modelName=self::CUSTOMER_MODEL_NAME)
addExpressionAttributeToSelect($alias, $expression, $attribute)