public function importItem(Item $item)
    {
        foreach ($this->data as $templateData) {
            foreach ($item->getData() as $itemData) {
                if ($itemData->getName() === $templateData->getName()) {
                    $templateData->setName($itemData->getName());
                    $templateData->setValue($itemData->getValue());
                    $templateData->setPrompt($itemData->getPrompt());
                }
            }
        }

        return $this;
    }
public function importItem(Item $item)
    {
        foreach ($this->data as $templateData) {
            foreach ($item->getData() as $itemData) {
                if ($itemData->getName() === $templateData->getName()) {
                    $templateData->setName($itemData->getName());
                    $templateData->setValue($itemData->getValue());
                    $templateData->setPrompt($itemData->getPrompt());
                }
            }
        }

        return $this;
    }
public function importItem ( Item $ item ) { foreach ( $ this -> data as $ templateData ) { foreach ( $ item -> getData ( ) as $ itemData ) { if ( $ itemData -> getName ( ) === $ templateData -> getName ( ) ) { $ templateData -> setName ( $ itemData -> getName ( ) ) ; $ templateData -> setValue ( $ itemData -> getValue ( ) ) ; $ templateData -> setPrompt ( $ itemData -> getPrompt ( ) ) ; } } } return $ this ; }
Import Item object into template

@return Template
Import Item object into template