Exemple #1
0
 /**
  * @internal
  *
  * @param $name
  * @param $value
  * @return Result|void
  * @throws Main\ArgumentOutOfRangeException
  */
 public function initField($name, $value)
 {
     if ($this->isCalculatedField($name)) {
         $this->calculatedFields->set($name, $value);
         return new Result();
     }
     parent::initField($name, $value);
 }
Exemple #2
0
 /**
  * @param $entityName
  * @param $orderId
  * @param $type
  * @param null $id
  * @param null|Entity $entity
  * @param array $data
  */
 protected static function addRecord($entityName, $orderId, $type, $id = null, $entity = null, array $data = array())
 {
     if ($entity !== null && ($operationType = static::getOperationType($entityName, $type)) && (!empty($operationType["DATA_FIELDS"]) && is_array($operationType["DATA_FIELDS"]))) {
         foreach ($operationType["DATA_FIELDS"] as $fieldName) {
             if (!array_key_exists($fieldName, $data) && ($value = $entity->getField($fieldName))) {
                 $data[$fieldName] = TruncateText($value, 128);
             }
         }
     }
     \CSaleOrderChange::AddRecord($orderId, $type, $data, $entityName, $id);
 }