Removes specified child profile from this profile.

@param string $profile

@return $this
547496
public function remove(string $profile)
    {
        $child = $this->get($profile);
        $child->clearAll();
        $child->removeAll();

        unset($this->children[$profile]);

        return $this;
    }
181577
public function removeUser(ChildUser $user)
    {
        if ($this->getUsers()->contains($user)) { $userRole = new ChildUserRole();

            $userRole->setUser($user);
            if ($user->isRolesLoaded()) {
                //remove the back reference if available
                $user->getRoles()->removeObject($this);
            }

            $userRole->setRole($this);
            $this->removeUserRole(clone $userRole);
            $userRole->clear();

            $this->collUsers->remove($this->collUsers->search($user));

            if (null === $this->usersScheduledForDeletion) {
                $this->usersScheduledForDeletion = clone $this->collUsers;
                $this->usersScheduledForDeletion->clear();
            }

            $this->usersScheduledForDeletion->push($user);
        }


        return $this;
    }
1027709
public function setProfile($profileName)
    {
        if (!isset($this->profiles[$profileName])) {
            throw new \InvalidArgumentException('Profile "'. $profileName. '" does not exist');
        }

        $this->currentProfile = $profileName;
    }
392844
public function persist(ProfileInterface $profile)
    {
        foreach ($this->persistenceHandlers as $persistenceHandler) {
            $persistenceHandler->persist($profile);
        }

        return $this;
    }
1308386
public function setAccessTokenFromProfile(TwitterProfile $profile)
    {
        $tokens = $profile->get(['access_token', 'access_token_secret']);

        if (!empty($tokens['access_token'])) {
            $this->app['twitter']->setTokens($tokens['access_token'], $tokens['access_token_secret']);
            $this->profile = $profile;
        } else {
            // use the access token from profile that referenced this profile
            $referencingProfile = $profile->relation('most_recently_referenced_by');

            // recursion would be nice here, but could be dangerous
            $tokens = $referencingProfile->get(['access_token', 'access_token_secret']);

            if ($referencingProfile->exists() && !empty($tokens['access_token'])) {
                $this->app['twitter']->setTokens($tokens['access_token'], $tokens['access_token_secret']);
                $this->profile = $referencingProfile;
            }
        }

        return $this;
    }
1102482
public function stop()
    {
        // Create a new profile based upon the data of the adapter
        $profile = $this->getProfileFactory()->create(
            $this->getProfilerAdapter()->stop(),
            $this->getApplicationData(),
            $_SERVER // TODO: Don't want to use this directly, do something smarter
        );

        // Notify and persist the profile on the persistence service
        $this->getPersistenceService()->persist($profile);

        // Return the profile for further handling
        return $profile;
    }
642160
public function deleteSEPABankAccount( CustomerVault\Profile $profile, CustomerVault\SEPABankaccounts $bankDetails )
    {
        $profile->setRequiredFields(array('id'));
        $profile->checkRequiredFields();
        $bankDetails->setRequiredFields(array('id'));
        $bankDetails->checkRequiredFields();
        $request = new Request(array(
            'method' => Request::DELETE,
            'uri' => $this->prepareURI("/profiles/" . $profile->id . "/sepabankaccounts/" . $bankDetails->id)
        ));
        $response = $this->client->processRequest($request);
        return $response;
    }
554863
protected function removeChild(Node $child) {
    $this->childCount--;
    foreach ($this->getChildProperties() as $name => $value) {
      if ($child === $value) {
        $this->{$name} = NULL;
        break;
      }
    }
    if ($child->previous === NULL) {
      $this->head = $child->next;
    }
    else {
      $child->previous->next = $child->next;
    }
    if ($child->next === NULL) {
      $this->tail = $child->previous;
    }
    else {
      $child->next->previous = $child->previous;
    }
    $child->parent = NULL;
    $child->previous = NULL;
    $child->next = NULL;
    return $this;
  }
368297
public DrawerView removeProfile(DrawerProfile profile) {
        profile.detach();
        mProfileAdapter.remove(profile);
        updateProfile();
        return this;
    }
927479
public function removeParameter($name)
    {
        if ($this->hasParameter($name)) {
            $this->getParameterContainer()->remove($name);
        }
        return $this;
    }
994735
public function profile($profile = null)
    {
        if ($profile === null) {
            return $this->_providerProfile;
        }

        $this->_providerProfile = $profile;
    }
1170616
public function delete($id = null)
    {
        $this->request->allowMethod(['post', 'delete']);
        $profile = $this->Profiles->get($id);
        if ($this->Profiles->delete($profile)) {
            $this->Flash->success(__('The profile has been deleted.'));
        } else {
            $this->Flash->error(__('The profile could not be deleted. Please, try again.'));
        }

        return $this->redirect(['action' => 'index']);
    }
520248
public function stopAll($message = 'Stop', $context = [], $lap = true)
    {
        // Stop all running child profiles first
        foreach ($this->getProfiles(true) as $child) {
            $child->stopAll($message, $context, $lap);
        }

        // Stop this profile if still running
        if ($this->isRunning()) {
            $this->stop($message, $context, $lap);
        }

        return $this;
    }
985176
public function addProfile($profile)
    {
        if (!array_key_exists('profileIds', $this->content)) {
            $this->content['profileIds'] = [];
        }

        $this->content['profileIds'][] = $this->extractProfileId($profile);

        return $this;
    }
211683
public function removeAvatar()
    {
        $profile         = auth()->user();
        $profile->avatar = '';
        $profile->save();

        event(new ProfileWasUpdated($profile));

        return redirect()->route('administrator.profile.edit');
    }
347088
protected function removeChildDirecotries(string $dir = null)
    {
        if (empty($dir)) {
            $dir = $this->cacheDir;
        }

        $success = true;
        $objects = new GlobIterator($dir);

        foreach ($objects as $object) {
            if (!is_dir("$dir/$object") && is_link("$dir/$object")) {
                $success = $this->recursiveRemove("$dir/$object") && rmdir($dir) && $success;
            }
        }

        return $success;
    }
1114388
public function write(Profile $profile)
    {
        $file = $this->getFilename($profile->getToken());

        $profileIndexed = is_file($file);
        if (!$profileIndexed) {
            // Create directory
            $dir = \dirname($file);
            if (!is_dir($dir) && false === @mkdir($dir, 0777, true) && !is_dir($dir)) {
                throw new \RuntimeException(sprintf('Unable to create the storage directory (%s).', $dir));
            }
        }

        $profileToken = $profile->getToken();
        // when there are errors in sub-requests, the parent and/or children tokens
        // may equal the profile token, resulting in infinite loops
        $parentToken = $profile->getParentToken() !== $profileToken ? $profile->getParentToken() : null;
        $childrenToken = array_filter(array_map(function (Profile $p) use ($profileToken) {
            return $profileToken !== $p->getToken() ? $p->getToken() : null;
        }, $profile->getChildren()));

        // Store profile
        $data = [
            'token' => $profileToken,
            'parent' => $parentToken,
            'children' => $childrenToken,
            'data' => $profile->getCollectors(),
            'ip' => $profile->getIp(),
            'method' => $profile->getMethod(),
            'url' => $profile->getUrl(),
            'time' => $profile->getTime(),
            'status_code' => $profile->getStatusCode(),
        ];

        if (false === file_put_contents($file, serialize($data))) {
            return false;
        }

        if (!$profileIndexed) {
            // Add to index
            if (false === $file = fopen($this->getIndexFilename(), 'a')) {
                return false;
            }

            fputcsv($file, [
                $profile->getToken(),
                $profile->getIp(),
                $profile->getMethod(),
                $profile->getUrl(),
                $profile->getTime(),
                $profile->getParentToken(),
                $profile->getStatusCode(),
            ]);
            fclose($file);
        }

        return true;
    }