@param object $owner
@param string $type

@return static
4958
public function remove($owner, $type = 'default')
    {
        $owner_id = spl_object_id($owner);

        if (!isset($this->_pool[$owner_id])) {
            return $this;
        }

        foreach ($type === null ? array_keys($this->_pool[$owner_id]) : [$type] as $current) {
            $queue = $this->_pool[$owner_id][$current];

            while (!$queue->isEmpty()) {
                $instance = $queue->pop();
                unset($instance);
            }

            unset($this->_pool[$owner_id][$current]);
        }

        if (count($this->_pool[$owner_id]) === 0) {
            unset($this->_pool[$owner_id]);
        }

        return $this;
    }
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;
    }
867754
public function exists($owner, $type = 'default')
    {
        $owner_id = spl_object_id($owner);
        return isset($this->_pool[$owner_id][$type]);
    }
914280
public function isOwnedBy(Model $owner)
    {
        if ( ! $this->hasOwner())
        {
            return false;
        }

        return ($owner->getKey() === $this->owner->getKey());
    }
1055894
public function make($type)
    {
        if ($instance = array_get($this->resolved, $type)) {
            return $instance;
        }

        return $this->build($type);
    }
36808
public function ownerPassword($password = null)
    {
        if ($password === null) {
            return $this->_ownerPassword;
        }
        $this->_ownerPassword = $password;

        return $this;
    }
1113961
public function withType(string $type): self
    {
        $metadata = clone $this;
        $metadata->type = $type;

        return $metadata;
    }
203064
public function withType(string $type): self
    {
        $this->type = UserPermissionEnum::ensureValid($type);
        return $this;
    }
1259172
public function removeOwner($owner)
    {
        if (!$this->owners->extract($owner)) {
            $this->resetStats(array($this->_mixer));
        }
    }
1102976
private function getUserSettings(string $owner)
    {
        if (!$this->userSettings->get($owner)) {
            $this->userSettings->set($owner, $this->provider->findUserSettings($owner));
        }

        return $this->userSettings->get($owner);
    }
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);
    }
296861
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner == null)
            return;
        try   {     // Open this table and move to the control record
            if (!this.getOwner().isOpen())
                this.getOwner().open();     // Open the control file
            if (this.getOwner().getEditMode() == Constants.EDIT_NONE)
                this.doNewRecord(true);     // Read the control file
        } catch (DBException e)   {
            return;
        }
    }
554341
public function viewBlockAction($owner, $ownerId, $id)
    {
        /** @var BlockManager $manager */
        $manager = $this->get('opifer.content.block_manager');

        $object = $this->get('opifer.content.block_provider_pool')->getProvider($owner)->getBlockOwner($ownerId);

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

        $block = $environment->getBlock($id);

        $environment->setBlockMode(Environment::MODE_MANAGE);

        /** @var AbstractBlockService $service */
        $service = $manager->getService($block);
        $service->setEnvironment($environment);

        $this->get('opifer.content.twig.content_extension')->setBlockEnvironment($environment);


        return new JsonResponse(['view' => $service->manage($block)->getContent()]);
    }
726870
public function isOwnedBy(CanBeOwnerContract $owner)
    {
        if (!$this->hasOwner()) {
            return false;
        }

        return $owner->getKey() === $this->getOwner()->getKey() && $owner->getMorphClass() === $this->getOwner()->getMorphClass();
    }
746047
public void addOwner(String owner) {
        if (this.owners == null) {
            this.owners = new Hashtable<String, String>();
        }
        this.owners.put(owner, owner);
    }
55789
public function setOwner(HTML_QuickForm2_Node $owner)
    {
        if (null !== $this->owner) {
            $this->owner->removeRule($this);
        }
        $this->owner = $owner;
    }
1097255
public function withOwner($owner, callable $callback, $args = [])
    {
        try {
            $this->setOwner($owner);
            return $callback(...$args);
        } finally {
            $this->clearOwner();
        }
    }