1
0
Fork 0
mirror of synced 2025-04-20 01:21:01 +00:00

included class files in install.php

This commit is contained in:
Sergey Chazov 2020-08-21 11:21:53 +03:00 committed by Павел
parent b851a17c49
commit 92189641cb
4 changed files with 23 additions and 17 deletions

View file

@ -225,11 +225,14 @@ class intaro_retailcrm extends CModule
}
}
include($this->INSTALL_PATH . '/../lib/model/bitrix/abstractmodelproxy.php');
include($this->INSTALL_PATH . '/../lib/model/bitrix/orderprops.php');
include($this->INSTALL_PATH . '/../lib/model/bitrix/tomodule.php');
include($this->INSTALL_PATH . '/../lib/repository/abstractrepository.php');
include($this->INSTALL_PATH . '/../lib/repository/orderpropsrepository.php');
include($this->INSTALL_PATH . '/../lib/repository/persontyperepository.php');
include($this->INSTALL_PATH . '/../lib/repository/tomodulerepository.php');
include($this->INSTALL_PATH . '/../lib/model/bitrix/orm/tomodule.php');
$this->CopyFiles();
$this->addBonusPaySystem();
@ -1501,11 +1504,9 @@ class intaro_retailcrm extends CModule
public function addLPOrderProps(): void
{
$persons = PersonTypeRepository::getCollectionByWhere(['ID']);
foreach ($persons as $person) {
$personId = $person->getID();
$groupID = $this->getGroupID($personId);
if (isset($groupID)) {
$this->addBonusField($personId, $groupID);
}
@ -1570,6 +1571,9 @@ class intaro_retailcrm extends CModule
/**
* @param $personID
* @param $groupID
* @throws \Bitrix\Main\ArgumentException
* @throws \Bitrix\Main\ObjectPropertyException
* @throws \Bitrix\Main\SystemException
*/
private function addBonusField($personID, $groupID): void
{
@ -1579,8 +1583,8 @@ class intaro_retailcrm extends CModule
];
$bonusProp = OrderPropsRepository::getFirstByWhere(['ID'], $where);
if ($bonusProp === false) {
if ($bonusProp === null) {
$fields = [
"REQUIRED" => "N",
"NAME" => self::BONUS_COUNT,
@ -1653,8 +1657,6 @@ class intaro_retailcrm extends CModule
private function addLPEvents(): void
{
$eventManager = EventManager::getInstance();
include($this->INSTALL_PATH . '/../lib/model/bitrix/orm/tomodule.php');
include($this->INSTALL_PATH . '/../lib/repository/tomodulerepository.php');
foreach (self::SUBSCRIBE_LP_EVENTS as $event){
$select = ['ID'];

View file

@ -11,13 +11,10 @@
*/
namespace Intaro\RetailCrm\Repository;
use Bitrix\Sale\FuserTable;
use Bitrix\Sale\Internals\OrderPropsTable;
use Intaro\RetailCrm\Model\Bitrix\Fuser;
use Bitrix\Main\ORM\Objectify\EntityObject;
use Intaro\RetailCrm\Model\Bitrix\OrderProps;
use Intaro\RetailCrm\Model\Bitrix\ORM\ToModuleTable;
use Intaro\RetailCrm\Model\Bitrix\ToModule;
/**
* Class RepositoryRepository
@ -26,10 +23,17 @@ use Intaro\RetailCrm\Model\Bitrix\ToModule;
*/
class OrderPropsRepository extends AbstractRepository
{
public static function getFirstByWhere(array $select, array $where): ?ToModule
/**
* @param array $select
* @param array $where
* @return \Intaro\RetailCrm\Model\Bitrix\OrderProps|null
* @throws \Bitrix\Main\ArgumentException
* @throws \Bitrix\Main\ObjectPropertyException
* @throws \Bitrix\Main\SystemException
*/
public static function getFirstByWhere(array $select, array $where): ?OrderProps
{
return static::getWrapped(ToModuleTable::query()
return static::getWrapped(OrderPropsTable::query()
->setSelect($select)
->where($where)
->fetchObject());

View file

@ -24,12 +24,12 @@ class PersonTypeRepository extends AbstractRepository
/**
* @param array $select
* @param array $where
* @return \Bitrix\Main\Type\Collection|null
* @return \Bitrix\Main\Type\Collection|null|Bitrix\Sale\Internals\EO_PersonType_Collection
* @throws \Bitrix\Main\ArgumentException
* @throws \Bitrix\Main\ObjectPropertyException
* @throws \Bitrix\Main\SystemException
*/
public static function getCollectionByWhere(array $select = ['*'], array $where = []): ?Collection
public static function getCollectionByWhere(array $select = ['*'], array $where = [])
{
return PersonTypeTable::query()
->setSelect($select)

View file

@ -41,12 +41,12 @@ class ToModuleRepository extends AbstractRepository
/**
* @param array $select
* @param array $where
* @return \Bitrix\Main\Type\Collection|null
* @return \Bitrix\Main\Type\Collection|Intaro\RetailCrm\Model\Bitrix\ORM\EO_ToModule_Collection|null
* @throws \Bitrix\Main\ArgumentException
* @throws \Bitrix\Main\ObjectPropertyException
* @throws \Bitrix\Main\SystemException
*/
public static function getCollectionByWhere(array $select, array $where): ?Collection
public static function getCollectionByWhere(array $select, array $where)
{
return ToModuleTable::query()
->setSelect($select)