foster() public method

Parent Changing with descendant
public foster ( ConfigEntity $config, string $to ) : void
$config ConfigEntity config object
$to string to config prefix
return void
 /**
  * Parent Changing with descendant
  *
  * @param ConfigEntity $config config object
  * @param string       $to     to config prefix
  * @return void
  */
 public function foster(ConfigEntity $config, $to)
 {
     $this->erase($config->siteKey, $config->name);
     $this->erase($config->siteKey, $to);
     $this->repo->foster($config, $to);
 }
 /**
  * Move entity hierarchy to new parent or root
  *
  * @param ConfigEntity $config config object
  * @param string|null  $to     parent name
  * @return ConfigEntity
  * @throws InvalidArgumentException
  * @throws NoParentException
  */
 public function move(ConfigEntity $config, $to = null)
 {
     if ($to !== null && $this->repo->find($config->siteKey, $to) === null) {
         throw new InvalidArgumentException(['arg' => $to]);
     }
     $parent = $config->getParent();
     if ($parent === null) {
         if ($config->getDepth() !== 1) {
             throw new NoParentException();
         }
         $this->repo->affiliate($config, $to);
     } else {
         $this->repo->foster($config, $to);
     }
     $arrName = explode('.', $config->name);
     $key = array_pop($arrName);
     if ($to !== null) {
         $key = $to . '.' . $key;
     }
     return $this->get($key, false, $config->siteKey);
 }