Table of Contents tree

@param string  $owner
@param integer $ownerId

@return Response
191475
public function tocAction($owner, $ownerId)
    {
        /** @var BlockProviderInterface $provider */
        $provider = $this->get('opifer.content.block_provider_pool')->getProvider($owner);
        $object = $provider->getBlockOwner($ownerId);

        /** @var Environment $environment */
        $environment = $this->get('opifer.content.block_environment');
        $environment->setDraft(true)->setObject($object);
        $environment->setBlockMode('manage');

        $twigAnalyzer = $this->get('opifer.content.twig_analyzer');

        $parameters = [
            'environment' => $environment,
            'analyzer' => $twigAnalyzer,
            'object' => $environment->getObject(),
        ];

        return $this->render('OpiferContentBundle:Content:toc.html.twig', $parameters);
    }
1054065
function ownerDocument(componentOrElement) {
    var elem = ReactDOM.findDOMNode(componentOrElement);
    return elem && elem.ownerDocument || document;
}
1052124
function touch($path, $owner = null)
    {
        touch($path);

        if ($owner) {
            $this->chown($path, $owner);
        }

        return $path;
    }
962352
private function selectList($skip=0, $owner = 0, $level = 0)
    {
        $items = Eresus_CMS::getLegacyKernel()->sections->
            children($owner, Eresus_CMS::getLegacyKernel()->user['access']);
        $result = array(array(), array());
        foreach ($items as $item)
        {
            if ($item['id'] != $skip)
            {
                $item['caption'] = trim($item['caption']);
                if (empty($item['caption']))
                {
                    $item['caption'] = ADM_NA;
                }
                $result[0][] = $item['id'];
                $result[1][] = str_repeat('&nbsp;', $level*2).$item['caption'];
                $children = $this->selectList($skip, $item['id'], $level+1);
                $result[0] = array_merge($result[0], $children[0]);
                $result[1] = array_merge($result[1], $children[1]);
            }
        }
        return $result;
    }
209304
public static function fromOwnerAndName(string $owner, string $name): self
    {
        if (1 !== \preg_match(self::ownerRegEx(), $owner)) {
            throw new Exception\InvalidArgumentException(\sprintf(
                'Owner "%s" does not appear to be a valid owner.',
                $owner
            ));
        }

        if (1 !== \preg_match(self::nameRegEx(), $name)) {
            throw new Exception\InvalidArgumentException(\sprintf(
                'Name "%s" does not appear to be a valid name.',
                $name
            ));
        }

        return new self(
            $owner,
            $name
        );
    }
341952
public static function fromOwner( $owner, $provider, $dataPool )
	{
		$result = new ExprIterator();
		$result->nodes = $owner->toArray();
		$result->provider = $provider;
		$result->dataPool = $dataPool;
		return $result;
	}
342695
private function updateAttendees(string $owner_type, int $owner_id)
    {

        CharacterCalendarEventDetail::where('owner_id', $owner_id)
            ->where('owner_type', $owner_type)
            ->get()->each(function ($event) {

                $attendees = $this->retrieve([
                    'character_id' => $this->getCharacterId(),
                    'event_id'     => $event->event_id,
                ]);

                if ($attendees->isCachedLoad()) return;

                collect($attendees)->each(function ($attendee) use ($event) {

                    CharacterCalendarAttendee::firstOrNew([
                        'character_id' => $attendee->character_id,
                        'event_id'     => $event->event_id,
                    ])->fill([
                        'event_response' => $attendee->event_response,
                    ])->save();

                });

                CharacterCalendarAttendee::where('event_id', $event->event_id)
                    ->whereNotIn('character_id', collect($attendees)
                        ->pluck('character_id')->flatten()->all())
                    ->delete();
            });
    }
881018
public function newAuthorizeRequest($owner, $owner_id, $options)
  {
    return $this->getOAuth()->getAuthServer()
          ->getGrantType('authorization_code')
          ->newAuthoriseRequest($owner, $owner_id, $options);
  }
8383
public function createBlock($owner, $type, $parentId, $placeholder, $sort, $data = null, $draft = true)
    {
        /** @var AbstractBlockService $service */
        $service = $this->getService($type);
        $parent = $parentId ? $this->find($parentId, $draft) : null;

        // This should replaced with a more hardened function
        if (is_null($data)) {
            $data = array();
        }
        $data['owner'] = $owner;

        $block = $service->createBlock($data);

        $block->setPosition($placeholder);
        $block->setSort(0); // < default, gets recalculated later for entire level
        $block->setSortParent(-1); // < need to be calculated when putting in the tree

        // Set owner
        if (is_null($parent) || false === $parent->isShared()) {
            $block->setOwner($owner);
        }

        $block->setParent($parent);

        // Save now, rest will be in changeset. All we do is a create a stub entry anyway.
        $this->save($block, $draft);

        if (count($sort) > 1) {
            // Replace the zero value in the posted sort array
            // with the newly created id to perform sorting
            $id = $block->getId();
            $sort = array_map(
                function ($v) use ($id) {
                    return $v == "" || $v == "0" ? $id : $v;
                },
                $sort
            );

            array_walk($sort, function (&$id) { $id = (int) $id; });
            $contained = $this->findById($sort, $draft);

            if ($contained) {
                $contained = $this->setSortsByDirective($contained, $sort);

                foreach ($contained as $node) {
                    // If nodes are in the same parent and if their owners match we
                    // save the changes. We don't want to save sort changes made to
                    // nodes belonging to inherited trees.
                    if ($node->getParent() === $block->getParent() &&
                        (($node->getOwner() === null && $block->getOwner() === null) ||
                        ($node->getOwner()->getId() == $block->getOwner()->getId()))) {
                        $this->save($node, $draft);
                    }
                }
            }
        }

        return $block;
    }
799389
protected function getAttributes(ContentInterface $owner)
    {
        /** @var AttributeInterface $attributes */
        $attributes = $owner->getValueSet()->getAttributes();

        $choices = [];
        foreach ($attributes as $attribute) {
            if (!in_array($attribute->getValueType(), ['select', 'radio', 'checklist'])) {
                continue;
            }
            $choices[$attribute->getDisplayName()] = $attribute->getName();
        }

        return $choices;
    }
221257
public function generateTableName($ownerTableName, $tableNameSuffix)
    {
        if (preg_match('/{{%(\w+)}}$/', $ownerTableName, $matches)) {
            $ownerTableName = $matches[1];
        }

        return '{{%' . $ownerTableName . $tableNameSuffix . '}}';
    }
811274
public function create($chatid, $name, $owner, $userlist)
    {
        $params = array(
            'chatid' => $chatid,
            'name' => $name,
            'owner' => $owner,
            'userlist' => $userlist
        );

        $response = $this->http->jsonPost(self::API_CREATE, $params);

        return $response;
    }
87174
public function change_owner($owner)
    {

        if (empty($owner) || !is_int($owner) || $this->owner != getmyuid()) return false;

        if (!empty($this->fp)) fclose($this->fp);

        if (chown($this->path . $this->filename, $owner)) {
            return $this->open($this->path . $this->filename);
        }

        return false;
    }
1278258
public function setOwner(\WobbleCode\UserBundle\Document\User $owner)
    {
        $this->owner = $owner;
        return $this;
    }
751512
private function mapUserToCreatedContent(User $user)
    {
        return new CreatedContent([
            'content' => new RestContent(
                $user->contentInfo,
                $this->repository->getLocationService()->loadLocation($user->contentInfo->mainLocationId),
                $this->repository->getContentService()->loadContentByContentInfo($user->contentInfo),
                $this->repository->getContentTypeService()->loadContentType($user->contentInfo->contentTypeId),
                $this->repository->getContentService()->loadRelations($user->versionInfo)
            ),
        ]);
    }
28557
public function addOwner($owner_id, $owner, $owner_attribute)
    {
        $mediafiles = new Owners();
        $mediafiles->mediafile_id = $this->id;
        $mediafiles->owner = $owner;
        $mediafiles->owner_id = $owner_id;
        $mediafiles->owner_attribute = $owner_attribute;

        return $mediafiles->save();
    }
1321116
protected function _owner()
    {
        static $owner = false;

        if ( $owner === false )
        {
            $owner = eZUser::fetch( $this->owner_id );
        }

        return $owner;
    }