public function assign($var, $value = null)
    {
        if (is_string($var)) {
            $this->_vars[$var] = $value;

            return $this;
        }

        if (is_array($var)) {
            foreach ($var as $key => $value) {
                if ($value instanceof AbstractClassContent) {
                    // trying to load subcontent
                    $subcontent = $this->getApplication()
                            ->getEntityManager()
                            ->getRepository(ClassUtils::getRealClass($value))
                            ->load($value, $this->getApplication()->getBBUserToken());
                    if (null !== $subcontent) {
                        $value = $subcontent;
                    }
                }

                $this->_vars[$key] = $value;
            }
        }

        return $this;
    }
public function assign($var, $value = null)
    {
        if (is_string($var)) {
            $this->_vars[$var] = $value;

            return $this;
        }

        if (is_array($var)) {
            foreach ($var as $key => $value) {
                if ($value instanceof AbstractClassContent) {
                    // trying to load subcontent
                    $subcontent = $this->getApplication()
                            ->getEntityManager()
                            ->getRepository(ClassUtils::getRealClass($value))
                            ->load($value, $this->getApplication()->getBBUserToken());
                    if (null !== $subcontent) {
                        $value = $subcontent;
                    }
                }

                $this->_vars[$key] = $value;
            }
        }

        return $this;
    }
public function assign ( $ var , $ value = null ) { if ( is_string ( $ var ) ) { $ this -> _vars [ $ var ] = $ value ; return $ this ; } if ( is_array ( $ var ) ) { foreach ( $ var as $ key => $ value ) { if ( $ value instanceof AbstractClassContent ) { // trying to load subcontent $ subcontent = $ this -> getApplication ( ) -> getEntityManager ( ) -> getRepository ( ClassUtils :: getRealClass ( $ value ) ) -> load ( $ value , $ this -> getApplication ( ) -> getBBUserToken ( ) ) ; if ( null !== $ subcontent ) { $ value = $ subcontent ; } } $ this -> _vars [ $ key ] = $ value ; } } return $ this ; }
Assign one or more variables.

@param mixed $var   A variable name or an array of variables to set
@param mixed $value The variable value to set

@return AbstractRenderer The current renderer
Assign one or more variables .