Platon
Новичок
Вот хочу сделать некоторые изменения для своего ИМ. Я новичок в php и ООП. Не могу разобрать построение классов в этой CMS, например:
Не могу понять построение (синтаксиса) методов, например как в методе _loadProductPropertiesData
идет присвоение значения переменной $propertiesDatas:
1. SPropertiesQuery::create() - здесь понятно - идет обращение к методу create() класса SPropertiesQuery
2. Подскажите что имеется ввиду дальше через знак ->:
->filterByShowInCompare(true)
->orderByPosition()
->orderByPosition(Criteria::ASC)
->useSProductPropertiesDataQuery()
->filterByLocale(ShopController::getCurrentLocale())
->filterByProductId($this->productModel->id)
->endUse()
->joinWithI18n()
->distinct()
->find();
Это что создаются объекты, или это продолжения обращения к методам того же класса _loadProductPropertiesData?
PHP:
class SPropertiesRenderer {
public $inputsName = 'productProperties';
public $noValueText = '- none -';
public $useMultipleSelect = false;
protected $properties = null;
protected $productModel = null;
protected $propertiesData = array();
public function __construct() {
ShopCore::$ci->load->helper('form');
}
......................................................................
protected function _loadProductPropertiesData($locale = null, $forsed = false) {
$this->propertiesData = null;
if ($this->productModel === null)
return false;
$propertiesDatas = SPropertiesQuery::create()
->filterByShowInCompare(true)
->orderByPosition()
->orderByPosition(Criteria::ASC)
->useSProductPropertiesDataQuery()
->filterByLocale(ShopController::getCurrentLocale())
->filterByProductId($this->productModel->id)
->endUse()
->joinWithI18n()
->distinct()
->find();
if (sizeof($propertiesDatas) > 0) {
foreach ($propertiesDatas as $p) {
$propertyData = $p->getSProductPropertiesDatas();
foreach ($propertyData as $k => $v) {
if ($v->getProductId() == $this->productModel->id) {
$this->propertiesData[$propertyData[$k]->getPropertyId()][] = $v;
}
}
}
} else {
$this->propertiesData = array();
}
}
.................................................
}
идет присвоение значения переменной $propertiesDatas:
1. SPropertiesQuery::create() - здесь понятно - идет обращение к методу create() класса SPropertiesQuery
2. Подскажите что имеется ввиду дальше через знак ->:
->filterByShowInCompare(true)
->orderByPosition()
->orderByPosition(Criteria::ASC)
->useSProductPropertiesDataQuery()
->filterByLocale(ShopController::getCurrentLocale())
->filterByProductId($this->productModel->id)
->endUse()
->joinWithI18n()
->distinct()
->find();
Это что создаются объекты, или это продолжения обращения к методам того же класса _loadProductPropertiesData?