Attaches the content to the container
@param boolean $isNew
486038
private function AttachContainerContent($isNew)
    {
        $provider = new ContainerContentTreeProvider($this->Container());
        $tree = new TreeBuilder($provider);
        $containerContent = $this->Content()->GetContainerContent();
        if (!$containerContent) {
            $containerContent = new ContainerContent();
            $containerContent->SetContainer($this->Container());
            $provider->AttachContent($containerContent, $this->Content());
        }
        if ($isNew) {
            $tree->Insert($containerContent, $this->ParentItem(), $this->PreviousItem());
        }
    }
1204950
public function prependHeadScript($src, $isFile = true)
    {
        $script = $this->createScript($src, $isFile);
        $scripts = $this->headScripts;
        array_unshift($scripts, $script);
        $this->headScripts = $scripts;
    }
690642
public function setXML($xml, $isFile = false)
    {
        $this->_xml = ($isFile ? file_get_contents($xml) : $xml);
    }
1105088
public function appendHeadScript($src, $isFile = true)
    {
        $this->headScripts[] = $this->createScript($src, $isFile);
    }
985445
public function setAttachStdin(bool $attachStdin = false)
    {
        $this->attachStdin = $attachStdin;

        $this->raw = array_merge($this->raw, ['AttachStdin' => $attachStdin]);

        return $this;
    }
19139
public function isContentShown($isFirst = false, $isMiddle = false, $isLast = false)
    {
        return $this->isShown('Content', $isFirst, $isMiddle, $isLast);
    }
40419
public function setNotNew() {
		$this->_isNew = false;
		foreach ($this->_data as $d) {
			if ($d instanceof Model) {
				$d->setNotNew();
			}
		}
	}
1155056
public function getPropertyPageForm($idPage, $isNew)
	{
		$pathAppConfigForm = self::PagePropertiesAppConfigPath;
		 
		/**
		 * Get the config for this form
		 */
		$melisMelisCoreConfig = $this->serviceLocator->get('MelisCoreConfig');
		
		$appConfigForm = $melisMelisCoreConfig->getFormMergedAndOrdered(
		    self::PagePropertiesAppConfigPath,
		    'meliscms_page_properties',
		    $idPage . '_'
		);
        /** Overriding the Page properties form by calling listener */
        $modifiedForm =  $this->getEventManager()->trigger(
            'modify_page_properties_form_config',
            $this,
            ['appConfigForm' => $appConfigForm]
        )->last();

        if (!empty($modifiedForm)) {
            $appConfigForm = $modifiedForm;
        }
			
		if ($isNew == false)
		{
			// Lang not changeable after creation
			$appConfigForm = $melisMelisCoreConfig->setFormFieldDisabled($appConfigForm, 'plang_lang_id', true);
			$appConfigForm = $melisMelisCoreConfig->setFormFieldRequired($appConfigForm, 'plang_lang_id', false);
		}
	
		/**
		 * Generate the form through factory and change ElementManager to
		 * have access to our custom Melis Elements
		 */
		$factory = new \Zend\Form\Factory();
		$formElements = $this->serviceLocator->get('FormElementManager');
		$factory->setFormElementManager($formElements);
		$propertyForm = $factory->createForm($appConfigForm);
		
		return $propertyForm;
	}
1292489
public function saveAttachments($options = null)
    {
        if(!isset($options['dir'])){
            $dir = __DIR__.DIRECTORY_SEPARATOR;
        }else{
            $dir = $options['dir'];
        };
        if(!isset($options['incomingMessage'])){
            $incomingMessage = $this->incomingMessage;
        }else{
            $incomingMessage = $options['incomingMessage'];
        };
        foreach ($incomingMessage->attachments as $key => $attachment) {
            $newFileName = $attachment->name;
            file_put_contents($dir.DIRECTORY_SEPARATOR.$newFileName, $attachment->body);
        };
    }
903323
protected function saving(string $name, $userId, $value = null, bool $isNew = true): void
    {
        $meta = $this->getModel()->search($name, $userId)->first();

        // Deleting a configuration is determined by ':to-be-deleted:'. It
        // would be extremely weird if that is used for other purposed.
        if (\is_null($value) || $value === ':to-be-deleted:') {
            ! \is_null($meta) && $meta->delete();

            return;
        }

        // If the content is a new configuration, let push it as a insert
        // instead of an update to Eloquent.
        if (true === $isNew && \is_null($meta)) {
            $meta = $this->getModel();

            $meta->setAttribute('name', $name);
            $meta->setAttribute('user_id', $userId);
        }

        $meta->setAttribute('value', \serialize($value));
        $meta->save();
    }
759293
public function assign($aRecord)
    {
        startProfile('articleAssign');

        // load object from database
        parent::assign($aRecord);

        //clear seo urls
        $this->_aSeoUrls = [];

        $this->oxarticles__oxnid = $this->oxarticles__oxid;

        // check for simple article.
        if ($this->_blSkipAssign) {
            return;
        }

        $this->_assignParentFieldValues();
        $this->_assignNotBuyableParent();

        // assign only for a first load time
        if (!$this->isLoaded()) {
            $this->_setShopValues($this);
        }

        $this->_assignStock();
        $this->_assignPersistentParam();
        $this->_assignDynImageDir();
        $this->_assignComparisonListFlag();

        stopProfile('articleAssign');
    }
1146603
public function setAttachStdout(bool $attachStdout = false)
    {
        $this->attachStdout = $attachStdout;

        $this->raw = array_merge($this->raw, ['AttachStdout' => $attachStdout]);

        return $this;
    }
742892
public function attach(\Zend\EventManager\EventManagerInterface $oEvents, $iPriority = 1) {
        $this->listeners[] = $oEvents->attach(\Zend\View\ViewEvent::EVENT_RENDERER, array($this, 'selectRenderer'), $iPriority);
        $this->listeners[] = $oEvents->attach(\Zend\View\ViewEvent::EVENT_RESPONSE, array($this, 'injectResponse'), $iPriority);
    }
893031
public function alterValid(Form $mainForm, &$isValid)
    {
        $this->parent->getFormHelper()->alterValid($this->form, $mainForm, $isValid);
    }
325670
public function addAttachment($attachment, $group = 'contents')
    {
        if (!$attachment instanceof AttachableInterface && !$attachment instanceof ModelInterface) {
            return false;
        }

        $join = $this->modelFactory()->create(Join::class);

        $objId   = $this->id();
        $objType = $this->objType();
        $attId   = $attachment->id();

        $join->setAttachmentId($attId);
        $join->setObjectId($objId);
        $join->setGroup($group);
        $join->setObjectType($objType);

        $join->save();

        return $this;
    }
499347
function attach(vnode, withEl) {
	vnode.el = withEl;
	withEl._node = vnode;

	var nattrs = vnode.attrs;

	for (var key in nattrs) {
		var nval = nattrs[key];
		var isDyn = isDynAttr(vnode.tag, key);

		if (isStyleAttr(key) || isSplAttr(key)) ;
		else if (isEvAttr(key))
			{ patchEvent(vnode, key, nval); }
		else if (nval != null && isDyn)
			{ setAttr(vnode, key, nval, isDyn); }
	}

	if ((vnode.flags & LAZY_LIST) === LAZY_LIST)
		{ vnode.body.body(vnode); }

	if (isArr(vnode.body) && vnode.body.length > 0) {
		var c = withEl.firstChild;
		var i = 0;
		var v = vnode.body[i];
		do {
			if (v.type === VVIEW)
				{ v = createView(v.view, v.data, v.key, v.opts)._redraw(vnode, i, false).node; }
			else if (v.type === VMODEL)
				{ v = v.vm.node || v.vm._update(v.data, vnode, i, false, true).node; }

			{
				if (vnode.tag === "table" && v.tag === "tr") {
					devNotify("ATTACH_IMPLICIT_TBODY", [vnode, v]);
				}
			}

			attach(v, c);
		} while ((c = c.nextSibling) && (v = vnode.body[++i]));

		var vm = vnode.vm;

		vm != null && fireHook(vm.hooks, "willMount", vm, vm.data);
		fireHook(vnode.hooks, "willInsert", vnode);
		fireHook(vnode.hooks, "didInsert", vnode);
		vm != null && fireHook(vm.hooks, "didMount", vm, vm.data);
	}
}
366985
public function setDocument($document)
	{
		if (is_string($document)) {
			$this->document = $document;
		} else if (is_resource($document)) {
			$this->addMultipart("document", $document);
			$this->document = "attach://document";
		} else if ($document instanceof InputFile) {
			$this->addMultipart("document", $document->getFile());
			$this->document = "attach://document";
		}
	}