@param FamilyPermission $familyPermission

@return $this
508496
public function removeFamilyPermission(FamilyPermission $familyPermission)
    {
        $this->familyPermissions->removeElement($familyPermission);
        $familyPermission->setGroup(null);

        return $this;
    }
1003572
public function setGroup(Group $group = null): FamilyPermission
    {
        $this->group = $group;
        if ($group && !$group->getFamilyPermissions()->contains($this)) {
            $group->getFamilyPermissions()->add($this);
        }

        return $this;
    }
732908
private function addFamilyAndDescendantsToCart(Family $family): void
    {
        $this->addRecordToCart($family);

        foreach ($family->spouses() as $spouse) {
            $this->addRecordToCart($spouse);
        }
        foreach ($family->children() as $child) {
            $this->addRecordToCart($child);
            foreach ($child->spouseFamilies() as $child_family) {
                $this->addFamilyAndDescendantsToCart($child_family);
            }
        }
    }
74875
protected function getQueryBuilderByFamily(Request $request, FamilyInterface $family)
    {
        $m = __METHOD__.' is deprecated and now internal to the '.FamilySearchAction::class.' action/service';

        throw new \BadMethodCallException($m);
    }
976937
public function setFamily(FamilyInterface $family = null): FamilyPermission
    {
        $this->familyCode = $family ? $family->getCode() : null;

        return $this;
    }
917402
public function exportAction(Request $request, FamilyInterface $family)
    {
        $this->setFamily($family);

        $exportConfig = $this->getExportConfig($request);
        $defaultFormOptions = $this->getDefaultFormOptions($request, 'export');
        $attr = $defaultFormOptions['attr'] ?? [];
        $attr['data-target-element'] = null; // Deep merge hell
        $form = $this->getForm(
            $request,
            $exportConfig,
            [
                'family' => $family,
                'attr' => $attr,
            ]
        );

        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            return $this->generateExport($form->getData());
        }

        return $this->renderAction($this->getViewParameters($request, $form));
    }
723561
public function addPermission($permission)
    {
        if (is_string($permission)) {
            $name       = $permission;
            $permission = $this->createPermission($name);
        } elseif ($permission instanceof PermissionInterface) {
            $name = $permission->getName();
        } else {
            throw new \InvalidArgumentException('Permission must be a string or implement PermissionInterface');
        }

        $this->permissions[$name] = $permission;
        return $permission;
    }
1080245
private function restrictPermissions(array $userPermission, array $permissions)
    {
        return $this->mapPermissions($userPermission, $permissions, function($permission1, $permission2) {
            return $permission1 && $permission2;
        });
    }
819541
public function deleteFromFamily($family)
    {
        $this->mutations[] = (new Mutation)
            ->setDeleteFromFamily(
                (new DeleteFromFamily)->setFamilyName($family)
            );
        return $this;
    }
50072
public function detachPermission(...$permissions)
    {
        $this->eachPermission($permissions, function($permission) {
            if ($this->hasDirectPermission($permission)) {
                $this->permissions()->detach($permission->id);
            }
        });

        return $this;
    }
882734
def _set_family_view(self, session):
        """"""
        if self._family_view == FEDERATED:
            try:
                session.use_federated_family_view()
            except AttributeError:
                pass
        else:
            try:
                session.use_isolated_family_view()
            except AttributeError:
                pass
758434
public function setPrivilege($privilege = null)
        {
            $this->_privilege = is_string($privilege) ? $privilege : null;
            return $this;
        }
543821
public function setPrivileged(bool $privileged)
    {
        $this->privileged = $privileged;

        $this->hostConfig = array_merge($this->hostConfig, ['Privileged' => $privileged]);

        return $this;
    }
616727
public function addPermission($permission) {
		$per                                 = new permission($permission);
		$this->role->sharedPermissionList [] = $per->get();
		R::store($this->role);
	}
541372
public function setPermission(ChildPermission $v = null)
    {
        if ($v === null) {
            $this->setPermissionId(NULL);
        } else {
            $this->setPermissionId($v->getId());
        }

        $this->aPermission = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildPermission object, it will not be re-added.
        if ($v !== null) {
            $v->addRolePermission($this);
        }


        return $this;
    }
40746
public function attachPermission($permission)
    {
        $permission = Helper::getIdFor($permission, 'permission');

        $this->permissions()->attach($permission);
        $this->flushCache();
        $this->fireLaratrustEvent("permission.attached", [$this, $permission]);

        return $this;
    }
1312390
public function setParent(\Haven\CoreBundle\Entity\Category $parent = null) {
        $this->parent = $parent;

        return $this;
    }