Handles getting _links
@param $object
@param $view
@internal param \ReflectionClass $reflection
@return \stdClass
974743
protected function getLinks($object, $view)
    {
        $reflection = new \ReflectionClass($object);
        $links = new \stdClass();
        $annot = $this->reader->getClassAnnotation($reflection, '\Represent\Annotations\LinkCollection');

        if ($annot) {
            $links = $this->parseLinks($annot, $view, $links, $object);
        }

        return $links;
    }
37045
protected function redirectTo($object)
    {
        $request = $this->getRequest();

        $url = false;

        if (null !== $request->get('btn_update_and_list')) {
            $url = $this->admin->generateUrl('list');
        }
        if (null !== $request->get('btn_create_and_list')) {
            $url = $this->admin->generateUrl('list');
        }

        if (null !== $request->get('btn_create_and_create')) {
            $params = array();
            if ($this->admin->hasActiveSubClass()) {
                $params['subclass'] = $request->get('subclass');
            }
            $url = $this->admin->generateUrl('create', $params);
        }

        if ($this->getRestMethod() === 'DELETE') {
            $url = $this->admin->generateUrl('list');
        }

        if (!$url) {
            foreach (array('show', 'edit') as $route) {
                if ($this->admin->hasRoute($route) && $this->admin->hasAccess($route,
                        $object)) {
                    $url = $this->admin->generateObjectUrl($route, $object);

                    break;
                }
            }
        }

        if (!$url) {
            $url = $this->admin->generateUrl('list');
        }

        return new RedirectResponse($url);
    }
522531
public function getLink($relation)
    {
        $links = $this->getAllLinks();
        foreach ($links as $link) {
            if ($link->getRelation() === $relation) {
                return $link;
            }
        }

        return null;
    }
337972
public function getView(View $view)
    {
        if (($configHash = $this->matcherFactory->match($view)) === null) {
            return null;
        }

        // We can set the collection directly to the view, no need to go through DTO
        $view->addParameters([
            ContentView::QUERY_DEFINITION_COLLECTION_NAME => $this->getQueryDefinitionCollection($configHash, $view),
        ]);

        // Return DTO so that Configurator can set the data back to the $view
        return $this->getDTO($configHash);
    }
205097
def link(text, link_func):
    """"""
    def object_formatter(v, c, m, p):
        """Format object view link."""
        return Markup('<a href="{0}">{1}</a>'.format(
            link_func(m), text))
    return object_formatter
1120838
public function index($lang = "", $view = "")
    {
        $classNameArr = explode("\\", get_class($this));
        $className = str_replace("Controller", "", $classNameArr[4]);
        // check if user has permissions to access this link
        $key = ($view == 'list' || $view == '') ? 'read' : $view;
        if(!User::hasAccess($className, $key)) {
            return view('errors.permissions', compact('lang', 'view'));
        }
        return view('content');
    }
214928
static function links($object, $params = array())
	{
		self::_target_class_parse($params);

		if(empty($params['order']))
			$params['order'] = 'sort_order';

		if(is_object($object))
		{
			$params['from_class'] = $object->extends_class_id();
			$params['from_id']    = $object->id();
		}
		else
		{
			$params['from_class'] = class_name_to_id($object);
		}

		if($to = @$params['to'])
		{
			if(is_object($to))
			{
				$params['to_class'] = $to->extends_class_id();
				$params['to_id']    = $to->id();
			}
			elseif($to)
			{
				$params['to_class'] = class_name_to_id($to);
			}

			unset($params['to']);
		}

		return bors_find_all('bors_link', $params);
	}
626025
private function getIndexForObject($object)
    {
        $reflClass = new ReflectionClass($object);

        $annotation = $this->reader->getClassAnnotation($reflClass, '\Keratine\Lucene\Mapping\Annotation\Indexable');

        if (!$annotation) {
            // throw new \Exception(sprintf('%s must define annotation @%s', get_class($object), '\Keratine\Lucene\Mapping\Annotation\Indexable'));
            return;
        }

        if (empty($annotation->index)) {
            AnnotationException::requiredError('index', '\Keratine\Lucene\Mapping\Annotation\Indexable', $object, 'string');
        }

        if(false === isset($this->indices[$annotation->index])) {
            throw new \Exception(sprintf('Unknown index "%s".', $annotation->index));
        }

        if (false === $this->indices[$annotation->index] instanceof SearchIndexInterface) {
            throw new \Exception(
                sprintf('Index "%s" must be an instance of "ZendSearch\Lucene\SearchIndexInterface". "%s" given.',
                    $annotation->index,
                    is_object($this->indices[$annotation->index]) ? get_class($this->indices[$annotation->index]) : $this->indices[$annotation->index]
                )
            );
        }

        return $this->indices[$annotation->index];
    }
965569
public function getLinkForObject(AttachableObjectInterface $object, $fieldName = null)
    {
        return AttachmentLinkQuery::create()
            ->filterByAttachment($this)
            ->filterByAttachableObject($object)
            ->filterByModelField($fieldName)
            ->findOne()
        ;
    }
83738
public function getByEntity($entityClass, $id, $locale, $object = null)
    {
        if (!$object) {
            $object = $this->documentManager->find($id, $locale);
        }

        $pageNumber = $object->getPageNumber();
        if ($object instanceof ArticlePageDocument) {
            // the article contains the seo/excerpt data and the controller handles the page-number automatically
            $object = $object->getParent();
        }

        $metadata = $this->structureMetadataFactory->getStructureMetadata('article', $object->getStructureType());

        // this parameter should not be used
        // but the sulu-collector for the profiler needs it to determine data from request
        $structure = $this->structureManager->wrapStructure('article', $metadata);
        $structure->setDocument($object);

        return [
            'object' => $object,
            'view' => $metadata->view,
            'pageNumber' => $pageNumber,
            'structure' => $structure,
            '_cacheLifetime' => $this->getCacheLifetime($metadata),
            '_controller' => $metadata->controller,
        ];
    }
832217
public function get()
    {
        $permalink = $this->getView()->getParam('this.permalink', null);

        if ($permalink === null) {
            return rtrim($this->getView()->getOutputDir(), '/')
                . '/'
                . ltrim($this->getRelativeFile('entries', false), '/') . '.html';
        }

        $class = 'Phrozn\\Site\\View\\OutputPath\\Entry\\' . ucfirst($permalink);
        if (!class_exists($class)) {
            $class = 'Phrozn\\Site\\View\\OutputPath\\Entry\\Parametrized';
        }

        $object = new $class($this->getView());
        return $object->get();
    }
1137141
public static function get($view, $data = array()){

        if( $data ){
            self::$level = self::$level + 1;
            self::$data[ self::$level ] = (array) $data;
        }

        $file = SRC. "{$view}.php";

        // Parse view
        ob_start();

            self::process($file);

            if( $data ){

                unset(self::$data[ self::$level ]);
                self::$level = self::$level - 1;
                self::process(NULL);

            }

            $view = ob_get_contents();

        ob_end_clean();

        return $view;
    }
699491
public function getDataForRow($key, $object)
    {
        $translationManager = $this->framework->getInstance('\\Zepi\\Core\\Language\\Manager\\TranslationManager');
        
        switch ($key) {
            case 'name':
                return '<span class="mdi mdi-group"></span>' . $object->getName();
            break;
            
            case 'uuid':
                return $object->getUuid();
            break;
            
            case 'actions':
                $request = $this->framework->getRequest();
                return '<a href="' . $request->getFullRoute('administration/groups/modify/' . $object->getUuid()) . '" class="btn btn-primary"><span class="glyphicon glyphicon-pencil"></span>'
                     .     $translationManager->translate('Modify', '\\Zepi\\Web\\AccessControl')
                     . '</a>'
                     . '<a href="' . $request->getFullRoute('administration/groups/delete/' . $object->getUuid()) . '" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span>'
                     .     $translationManager->translate('Delete', '\\Zepi\\Web\\AccessControl')
                     . '</a>';
            break;
                
            default:
                return '-';
            break;
        }
    }
1326895
public static function callMethod($object, $method, $args = null)
    {
        $args   = \func_get_args();
        $object = \array_shift($args);
        $method = \array_shift($args);

        $refl = new \ReflectionObject($object);
        $reflMethod = $refl->getMethod($method);
        $reflMethod->setAccessible(true);

        return $reflMethod->invokeArgs($object, $args);
    }
375539
public static function add_preview_params($link,$object)
    {
        // Pass through if not logged in
        if(!Member::currentUserID()) {
            return $link;
        }
        $modifiedLink = '';
        $request = Controller::curr()->getRequest();
        if ($request && $request->getVar('CMSPreview')) {
            // Preserve the preview param for further links
            $modifiedLink = HTTP::setGetVar('CMSPreview', 1, $link);
            // Quick fix - multiple uses of setGetVar method double escape the ampersands
            $modifiedLink = str_replace('&amp;','&',$modifiedLink); 
            // Add SubsiteID, if applicable
            if (!empty($object->SubsiteID)) {
                $modifiedLink = HTTP::setGetVar('SubsiteID', $object->SubsiteID, $modifiedLink);
                // Quick fix - multiple uses of setGetVar method double escape the ampersands
                $modifiedLink = str_replace('&amp;','&',$modifiedLink); 
            }
        } 

        return ($modifiedLink) ? $modifiedLink : $link;
    }
3295
public static function object_get($object, $key, $default = null)
    {
        if (\is_null($key) || trim($key) === '') {
            return $object;
        }

        foreach (explode('.', $key) as $segment) {
            if (! \is_object($object) || ! isset($object->{$segment})) {
                return self::value($default);
            }

            $object = $object->{$segment};
        }

        return $object;
    }
941148
public function getParameterClassObject($object, $method)
    {
        $reflectionClass = new \ReflectionClass(get_class($object));
        $parameters = $reflectionClass->getMethod($method)->getParameters();

        if ($parameters && isset($parameters[0])) {
            $refClass = $parameters[0]->getClass();

            if ($refClass) {
                $class = $refClass->getName();

                return new $class();
            }
        }
    }