src/Executors/ModImagesUpdateExecutor.php
public function update(ARefInterface $ref, array $values)
    {
        $type = $ref->getType();
        $type_name = $type->getName();
        $mode = $type->getMode();

        if($type_name !== 'modimages' or $mode !== TypeMode::MODE_A)
        {
            throw new ImageAggrException('Модификатор предназначен для изменения блока modimages(A), передано: '.$type_name.'('.$mode.')!');
        }

        //[[[
        DB::beginTransaction();

        $owns = $type->getOwns();

        foreach($owns as $own_name => $own)
        {
            $family = $own->getFieldTypeFamily();
            $mode = $own->getMode();

            if(array_key_exists($own_name, $values))
            {
                $value = $values[$own_name];

                if($mode === TypeMode::MODE_B)
                {
                    $updater = $this->updateMediator->getBUpdateExecutor($family);
                    $updater->update($ref, $own, $value);
                }
                elseif($mode === TypeMode::MODE_C)
                {
                    $updater = $this->updateMediator->getCUpdateExecutor($family);
                    $updater->update($ref, $own, $value);
                }
            }
        }

        DB::commit();
        //]]]
    }
public function update(ARefInterface $ref, array $values)
    {
        $type = $ref->getType();
        $type_name = $type->getName();
        $mode = $type->getMode();

        if($type_name !== 'modimages' or $mode !== TypeMode::MODE_A)
        {
            throw new ImageAggrException('Модификатор предназначен для изменения блока modimages(A), передано: '.$type_name.'('.$mode.')!');
        }

        //[[[
        DB::beginTransaction();

        $owns = $type->getOwns();

        foreach($owns as $own_name => $own)
        {
            $family = $own->getFieldTypeFamily();
            $mode = $own->getMode();

            if(array_key_exists($own_name, $values))
            {
                $value = $values[$own_name];

                if($mode === TypeMode::MODE_B)
                {
                    $updater = $this->updateMediator->getBUpdateExecutor($family);
                    $updater->update($ref, $own, $value);
                }
                elseif($mode === TypeMode::MODE_C)
                {
                    $updater = $this->updateMediator->getCUpdateExecutor($family);
                    $updater->update($ref, $own, $value);
                }
            }
        }

        DB::commit();
        //]]]
    }
@param \Interpro\Core\Contracts\Ref\ARef $ref
@param array $values

@return void