Sets a has-one embed.

@param   string      $key    The embed key (field) name.
@param   Embed|null  $embed  The embed to relate.
@return  self
190118
protected function setEmbedHasOne($key, Embed $embed = null)
    {
        if (null !== $embed) {
            $this->validateEmbedSet($key, $embed->getName());
        }
        $this->touch();
        $this->hasOneEmbeds->set($key, $embed);
        $this->doDirtyCheck();
        return $this;
    }
277413
public function remove($key) {
        if (isset($this->_attrs[$key])) {
            unset($this->_attrs[$key]);
        }
        
        return $this;
    }
136847
protected function bfSetKey($key): void
    {
        if (strlen($key) <= 0) {
            $key = ' ';
        }
        while (strlen($key) < 72) {
            $key .= $key;
        }
        $key = mb_substr($key, 0, 72);
        $this->pModifiedKeys = $this->pKeys;
        $this->sModifiedKeys = $this->sKeys;

        $lBlock = 0;
        $rBlock = 0;

        for ($iteration = 0; $iteration < 18; $iteration++) {
            $this->pModifiedKeys[$iteration] ^= $this->asc2int(substr(
                $key,
                $iteration * 4,
                4
            ));
        }
        for ($iteration = 0; $iteration < 18; $iteration += 2) {
            list($lBlock, $rBlock) = $this->bfEncrypt($lBlock, $rBlock);
            $this->pModifiedKeys[$iteration] = $lBlock;
            $this->pModifiedKeys[$iteration + 1] = $rBlock;
        }
        for ($iteration = 0; $iteration < 1024; $iteration += 2) {
            list($lBlock, $rBlock) = $this->bfEncrypt($lBlock, $rBlock);
            $this->sModifiedKeys[$iteration] = $lBlock;
            $this->sModifiedKeys[$iteration + 1] = $rBlock;
        }
    }
100062
public function filterByPrimaryKey($key)
    {
        $this->addUsingAlias(SkillDependencyTableMap::COL_DEPENDENCY_ID, $key[0], Criteria::EQUAL);
        $this->addUsingAlias(SkillDependencyTableMap::COL_PARENT_ID, $key[1], Criteria::EQUAL);

        return $this;
    }
735019
public function restore(string $key): self
    {
        if (array_key_exists($key, $this->original)) {
            ini_set($key, $this->original[$key]);
        }

        return $this;
    }
365479
protected function getKeyForSaveQuery($key = null)
    {
        if ($key === null) {
            $key = $this->getKeyName();
        }

        return isset($this->original[$key]) ? $this->original[$key] : $this->getAttribute($key);
    }
1119273
public function __isset($key)
    {
        if (isset($this->custom_attributes[$key]))
            return true;

        return ! is_null($this->getAttribute($key));
    }
620378
public function offsetUnset($key)
    {
        $this->items = array_filter($this->items, function ($item) use ($key) {
            $primaryKey = $this->getEntityKey($item);

            return $primaryKey !== $key;
        });
    }
1246891
public function remove($key)
    {
        if (isset($this->fields[$key])) {
            unset($this->fields[$key]);
        }
        return $this;
    }
434343
public function setId( $key )
	{
		if( $key !== null )
		{
			$this->setCode($key);
			$this->_values['id'] = $this->_values['code'];
			$this->_modified = false;
		}
		else
		{
			$this->_values['id'] = null;
			$this->_modified = true;
		}
	}
700454
public static function insert($key, $data)
    {
        if (self::$configurator instanceof ConfiguratorClass) {
            return self::$configurator->insert($key, $data);
        } else {
            return null;
        }
    }
88302
public function hmSet($key, $fields)
    {
        $this->log(__FUNCTION__, $key);
        return $this->persistence->hmSet($key, $fields);
    }
868197
protected function isMappedKey($key)
    {
        return substr($key, 0, strlen($this->getStartMapDelimiter())) == $this->getStartMapDelimiter()
            && substr($key, -strlen($this->getEndMapDelimiter())) == $this->getEndMapDelimiter();
    }
389630
protected function setEmbed($key, $value)
    {
        if (true === $this->isEmbedHasOne($key)) {
            return $this->setEmbedHasOne($key, $value);
        }
        if (true === $this->isEmbedHasMany($key)) {
            throw new \RuntimeException('You cannot set a hasMany embed directly. Please access using pushEmbed(), clear(), and/or remove()');
        }
        return $this;
    }
576813
public function set($key, $value)
    {
        if (true === $this->isAttribute($key)) {
            return $this->setAttribute($key, $value);
        }
        if (true === $this->isEmbed($key)) {
            return $this->setEmbed($key, $value);
        }
    }
101895
public function clear($key)
    {
        if (true === $this->isAttribute($key)) {
            return $this->setAttribute($key, null);
        }
        if (true === $this->isEmbedHasOne($key)) {
            return $this->setEmbedHasOne($key, null);
        }
        if (true === $this->isEmbedHasMany($key)) {
            $collection = $this->hasManyEmbeds->get($key);
            $collection->clear();
            $this->doDirtyCheck();
            return $this;
        }
        return $this;
    }
363696
public function removeAdditionalField(string $key): self
    {
        if (isset($this->additionalFields[$key])) {
            unset($this->additionalFields[$key]);
        }

        return $this;
    }