@param SettingsOwnerInterface $owner
@param string $name

@return bool TRUE if the cache entry was successfully deleted, FALSE otherwise.
517814
protected function invalidateCache($name, SettingsOwnerInterface $owner = null)
    {
        return $this->storage->deleteItem($this->getCacheKey($name, $owner));
    }
955341
public function findSettingItem($owner, $code)
    {
        if ($this->items === null) {
            $this->loadItems();
        }

        $owner = strtolower($owner);
        $code = strtolower($code);

        foreach ($this->items as $item) {
            if (strtolower($item->owner) == $owner && strtolower($item->code) == $code) {
                return $item;
            }
        }

        return false;
    }
1043648
public function setOwner(ContentInterface $owner = null)
    {
        if ($owner instanceof Content) {
            $this->content = $owner;
        } elseif ($owner instanceof Template) {
            $this->template = $owner;
        } elseif ($owner === null) {
            $this->template = null;
            $this->content = null;
        } else {
            throw new \Exception(sprintf('BlockInterface owner can only be of type Content or Template, not the provided %s type.', get_class($owner)));
        }

        return $this;
    }
635385
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null) if (m_recordToSync != null)
            m_recordToSync.addListener(new FileRemoveBOnCloseHandler(this));
    }
378295
public function isSaved( string $name ): bool
	{
		return $this->load($name) !== false || $this->memcached->getResultCode() !== \Memcached::RES_NOTFOUND;
	}
561764
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
        {
            if (mainFieldName == null)
                m_fldMain = this.getOwner().getReferenceField(m_FileToRead);
            if (fileKeyFieldName != null)
                m_FileToRead.setKeyArea(m_FileToRead.getField(fileKeyFieldName));
            else
                m_FileToRead.setKeyArea(m_FileToRead.getField(m_iFileKeyField));
        }
    }
970390
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (this.getOwner() != null)
        {
            InitFieldHandler behavior = (InitFieldHandler)this.getOwner().getListener(InitFieldHandler.class.getName());
            if (this.getOwner().getRecord().getEditMode() == DBConstants.EDIT_CURRENT)
                behavior = null;    // Special case - if there is a current record, make sure initonce works.
            if (behavior != null)
                this.setFirstTime(false);  // If InitFieldHandler already set the initial value, don't set the first time.
        }
    }
178173
final public function delete($name) {

        if ( array_key_exists($name, $this->rpc_methods) ) {

            unset($this->rpc_methods[$name]);

            $this->logger->debug("Deleted method $name");

            return true;

        } else {

            $this->logger->warning("Cannot delete method $name: entry not found");

            return false;

        }

    }
1102976
private function getUserSettings(string $owner)
    {
        if (!$this->userSettings->get($owner)) {
            $this->userSettings->set($owner, $this->provider->findUserSettings($owner));
        }

        return $this->userSettings->get($owner);
    }
397326
public function set($name, $value = '')
    {
        if (!$name) {
            return false;
        }

        /** @var SettingEntity $setting */
        $setting = SettingEntityRepository::findOneEntityByCriteria(['name' => $name]);

        if (!$setting) {
            $setting = new SettingEntity();
            $setting->setName($name);
        }
        $setting->setValue($value);
        $setting->save();

        // Update cache
        self::$_cached_settings[$name] = $value;
        Cacher::getInstance()->getDefaultCacher()->delete(self::CACHE_KEY);

        return true;
    }
188886
public function set($name = null, $version = null)
    {
        if ($name !== null) {
            $this->name = trim($name);
        }

        if ($version !== null) {
            $this->version = trim($version);
        }

        return true;
    }
351559
private function setWithoutFlush($name, $value, SettingsOwnerInterface $owner = null)
    {
        $this->validateSetting($name, $owner);
        $this->loadSettings($owner);

        if ($owner === null) {
            $this->globalSettings[$name] = $value;
        } else {
            $this->ownerSettings[$owner->getSettingIdentifier()][$name] = $value;
        }

        return $this;
    }
309860
public function __isset($name)
    {
        if (isset($this->instances[$name])) {
            return true;
        } elseif (isset($this->autoloader)) {
            try {
                $this->$name;
                return true;
            } catch (InvalidModuleException $e) {
            }
        }
        return false;
    }
112447
public function hasSettingsForm(string $name): bool
    {
        $extension = $this->getAvailableExtensions()->findByName($this->getNormalizedName($name));

        if ($extension instanceof ExtensionContract) {
            if ($extension->getSettings()->getCustomUrl()) {
                return true;
            }

            return app()->make(SettingsFormResolver::class)->hasSettingsForm($extension);
        }

        return false;
    }
90618
public function chown(string $file, string $owner = null, bool $recursive = false) : void
    {
        if ($owner === null) {
            $owner = $this->getUser();
        }

        $this->call('update_chown', [
            'chown_path' => $file,
            'chown_user' => $owner,
            'recursive' => $recursive ? 'Y' : 'N',
        ]);
    }
980439
public function setOwner($user)
    {
        // Note: We need to do a bit of uuid juggling here, because we can't bind the workspaces Owner to a specific
        // implementation, and creating entity relations via interfaces is not supported by Flow. Since the property
        // mapper will call setOwner() with a string parameter (because the property $owner is string), but developers
        // will want to use objects, we need to support both.
        if ($user === null || $user === '') {
            $this->owner = null;
            return;
        }
        if (is_string($user) && preg_match('/^([a-f0-9]){8}-([a-f0-9]){4}-([a-f0-9]){4}-([a-f0-9]){4}-([a-f0-9]){12}$/', $user)) {
            $this->owner = $user;
            return;
        }
        if (!$user instanceof UserInterface) {
            throw new \InvalidArgumentException(sprintf('$user must be an instance of UserInterface, %s given.', gettype($user)), 1447764244);
        }
        $this->owner = $this->persistenceManager->getIdentifierByObject($user);
    }
184129
public function softDeleteField (MapField $field, ElementInterface $owner)
	{
		/** @var MapElement $map */
		$map = $owner->getFieldValue($field->handle);

		\Craft::$app->getElements()->deleteElement($map);
	}