function addAkas(array $akas) { $itemName = Lms_Item::getItemName($this); $itemAkaName = $itemName . 'Aka'; $akas = array_unique($akas); //Для избежания дублирования ака foreach ($akas as $aka) { $akaObj = Lms_Item::create($itemAkaName); $akaObj->setName($aka); $this->add($akaObj); } }
public static function rowToItem($row, $itemName = null) { if (!$row) { return null; } if (!$itemName) { $itemName = Lms_Item::getCallingItemName(); } Lms_Item::initStructure(Lms_Item::getClassName($itemName)); $simplePk = Lms_Item::getSimplePk($itemName); $tableName = Lms_Item::getTableName($itemName); Lms_Item_Store::setValues($tableName, $row[$simplePk], $row, true); return Lms_Item::create($itemName, $row[$simplePk]); }