public function processRecord(NodeTemplate $nodeTemplate, array $data)
    {
        $this->unsetAllNodeTemplateProperties($nodeTemplate);

        $externalIdentifier = $this->getExternalIdentifierFromRecordData($data);
        if (!isset($data['uriPathSegment'])) {
            $data['uriPathSegment'] = Slug::create($this->getLabelFromRecordData($data))->getValue();
        }

        $this->nodeTemplate->setNodeType($this->nodeType);
        $this->nodeTemplate->setName($this->renderNodeName($externalIdentifier));

        if (!isset($data['mode'])) {
            throw new \Exception(sprintf('Could not determine command mode from data record with external identifier %s. Please make sure that "mode" exists in that record.', $externalIdentifier), 1462985246103);
        }

        $commandMethodName = $data['mode'] . 'Command';
        if (!method_exists($this, $commandMethodName)) {
            throw new \Exception(sprintf('Could not find a command method "%s" in %s for processing record with external identifier %s.', $commandMethodName, get_class($this), $externalIdentifier), 1462985425892);
        }

        $this->$commandMethodName($externalIdentifier, $data);
    }
public function processRecord(NodeTemplate $nodeTemplate, array $data)
    {
        $this->unsetAllNodeTemplateProperties($nodeTemplate);

        $externalIdentifier = $this->getExternalIdentifierFromRecordData($data);
        if (!isset($data['uriPathSegment'])) {
            $data['uriPathSegment'] = Slug::create($this->getLabelFromRecordData($data))->getValue();
        }

        $this->nodeTemplate->setNodeType($this->nodeType);
        $this->nodeTemplate->setName($this->renderNodeName($externalIdentifier));

        if (!isset($data['mode'])) {
            throw new \Exception(sprintf('Could not determine command mode from data record with external identifier %s. Please make sure that "mode" exists in that record.', $externalIdentifier), 1462985246103);
        }

        $commandMethodName = $data['mode'] . 'Command';
        if (!method_exists($this, $commandMethodName)) {
            throw new \Exception(sprintf('Could not find a command method "%s" in %s for processing record with external identifier %s.', $commandMethodName, get_class($this), $externalIdentifier), 1462985425892);
        }

        $this->$commandMethodName($externalIdentifier, $data);
    }
public function processRecord ( NodeTemplate $ nodeTemplate , array $ data ) { $ this -> unsetAllNodeTemplateProperties ( $ nodeTemplate ) ; $ externalIdentifier = $ this -> getExternalIdentifierFromRecordData ( $ data ) ; if ( ! isset ( $ data [ 'uriPathSegment' ] ) ) { $ data [ 'uriPathSegment' ] = Slug :: create ( $ this -> getLabelFromRecordData ( $ data ) ) -> getValue ( ) ; } $ this -> nodeTemplate -> setNodeType ( $ this -> nodeType ) ; $ this -> nodeTemplate -> setName ( $ this -> renderNodeName ( $ externalIdentifier ) ) ; if ( ! isset ( $ data [ 'mode' ] ) ) { throw new \ Exception ( sprintf ( 'Could not determine command mode from data record with external identifier %s. Please make sure that "mode" exists in that record.' , $ externalIdentifier ) , 1462985246103 ) ; } $ commandMethodName = $ data [ 'mode' ] . 'Command' ; if ( ! method_exists ( $ this , $ commandMethodName ) ) { throw new \ Exception ( sprintf ( 'Could not find a command method "%s" in %s for processing record with external identifier %s.' , $ commandMethodName , get_class ( $ this ) , $ externalIdentifier ) , 1462985425892 ) ; } $ this -> $ commandMethodName ( $ externalIdentifier , $ data ) ; }
Processes a single command

Override this method if you need a different approach.

@param NodeTemplate $nodeTemplate
@param array $data
@return void
@throws \Exception
@api
Processes a single command