• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/senderconnector.php
  • Класс: BitrixIblockSenderConnectorIblock
  • Вызов: SenderConnectorIblock::getData
public function getData()
	{
		$iblockId = $this->getFieldValue('IBLOCK', null);
		$propertyNameId = $this->getFieldValue('PROPERTY_NAME', null);
		$propertyEmailId = $this->getFieldValue('PROPERTY_EMAIL', null);

		if($iblockId && $propertyEmailId)
		{
			// if property is property with code like '123'
			$propertyNameValue = null;
			$propertyEmailValue = null;
			if($propertyEmailId)
			{
				if(is_numeric($propertyEmailId))
				{
					$propertyEmailId = "PROPERTY_" . $propertyEmailId;
					$propertyEmailValue = $propertyEmailId."_VALUE";
				}
				else
				{
					$propertyEmailValue = $propertyEmailId;
				}
			}
			$selectFields = array($propertyEmailValue);

			if($propertyNameId)
			{
				if(is_numeric($propertyNameId))
				{
					$propertyNameId = "PROPERTY_" . $propertyNameId;
					$propertyNameValue = $propertyNameId . "_VALUE";
				}
				else
				{
					$propertyNameValue = $propertyNameId;
				}

				$selectFields[] = $propertyNameValue;
			}

			$filter = array('IBLOCK_ID' => $iblockId, '!'.$propertyEmailId => false);
			$iblockElementListDb = CIBlockElement::getList(array('id' => 'asc'), $filter, false, false, $selectFields);

			// replace property names from PROPERTY_123_VALUE to EMAIL, NAME
			$iblockElementDb = new CDBResultSenderConnector($iblockElementListDb);
			$iblockElementDb->senderConnectorFieldEmail = $propertyEmailValue;
			$iblockElementDb->senderConnectorFieldName = $propertyNameValue;
		}
		else
		{
			$iblockElementDb = new CDBResult();
			$iblockElementDb->InitFromArray(array());
		}


		return $iblockElementDb;
	}