@param string $id
@param bool   $force

@return mixed

@throws \Exception
430411
public function delete(string $id, bool $force = false)
    {
        return $this->curl->delete($this->url.'/'.$id.'?'.http_build_query(['force' => $force]));
    }
1092108
public function leave(bool $force = false)
    {
        $url = $this->url.'/leave?'.http_build_query(['force' => $force]);

        return $this->curl->post($url);
    }
1172733
public function getAPILanguages(bool $force = false) : CNabuLanguageList
    {
        $nb_api = new CNabuLanguageList();
        $this->getLanguages($force)->iterate(function ($key, CNabuLanguage $nb_language) use ($nb_api) {
            if ($nb_language->isAPILanguage()) {
                $nb_api->addItem($nb_language);
            }
            return true;
        });

        return $nb_api;
    }
794756
public function getById($id) : Response
    {
        //find the info
        $user = $this->model->findFirst([
            'id = ?0 AND is_deleted = 0',
            'bind' => [$this->userData->getId()],
        ]);

        $user->password = null;

        //get relationship
        if ($this->request->hasQuery('relationships')) {
            $relationships = $this->request->getQuery('relationships', 'string');

            $user = QueryParser::parseRelationShips($relationships, $user);
        }

        if ($user) {
            return $this->response($user);
        } else {
            throw new Exception('Record not found');
        }
    }
400189
public function getAction(Request $request, $id)
    {
        $locale = $this->getProductLocaleManager()->retrieveLocale($this->getUser(), $request->get('locale'));
        try {
            $attribute = $this->getManager()->findByIdAndLocale($id, $locale);
            $view = $this->view($attribute, 200);
        } catch (AttributeNotFoundException $exc) {
            $exception = new EntityNotFoundException($exc->getEntityName(), $exc->getId());
            $view = $this->view($exception->toArray(), 404);
        }

        return $this->handleView($view);
    }
627852
public function get($id)
    {
        try {
            $em = $this->entityManager->getDoctrineEntityManager();
            $accessEntity = $em->getRepository($this->getEntityClass())->findOneBy(array(
                'id' => $id,
            ));
            
            if ($accessEntity !== null) {
                return $accessEntity;
            }
            
            return false;
        } catch (\Exception $e) {
            throw new Exception('Cannot load the entity from the database for the given id "' . $id . '".', 0, $e);
        }
    }
830876
public function getById($id)
    {
        $inputResult = $this->getRequest()->request(
            'GET',
            $this->getRequestUrl(sprintf('inputs/%s', $id))
        );

        if (isset($inputResult['input'])) {
            $input = new Input($inputResult['input']);
        } else {
            throw new \Exception('Input Not Found');
        }

        return $input;
    }
839581
public function remove(string $name, bool $force = false)
    {
        return $this->curl->delete($this->base_url.'/'.$name.'?'.http_build_query([
                    'force' => $force,
                ]
            )
        );
    }
187032
public function render($force = false) {

		if(empty($this->html) || $force) {

            if($this->template) {

                parent::render();

            }

            else {

                $name = $this->parentElement->getName();
                $value = $this->getValue();

                if($this->selected) {
                    $this->attributes['checked'] = 'checked';
                }
                else {
                    unset($this->attributes['checked']);
                }

                if(!isset($this->attributes['id'])) {
                    $formId = $this->parentElement->getForm()->getAttribute('id');
                    $this->attributes['id'] = ($formId ? ($formId . '_') : '') . $name . '_' . $value;
                }

                $this->attributes['value'] = $this->getValue();
                $this->attributes['name'] = $this->parentElement->getName();

                $attr = [];

                foreach($this->attributes as $k => $v) {
                    $attr[] = sprintf('%s="%s"', $k, $v);
                }

                $this->html = sprintf(
                    '<input type="radio" %s>',
                    implode(' ', $attr)
                );

                if($this->label) {
                    $this->html .= $this->label->setAttribute('for', $this->attributes['id'])->render();
                }

            }

		}

		return $this->html;

	}
217390
public function getData($force = false)
    {
        if ($this->data === null || $force === true) {
            $route  = $this->getRoute();
            $action = $route->getAction();
            $method = false;

            $this->action($action);

            // Check for concrete method call
            if (method_exists($this, '__data'.ucfirst($action))) {
                // Concrete integration ...
                $method = '__data'.ucfirst($action);
            } elseif (method_exists($this, '__data')) {
                // custom generic overload solution
                $method = '__data';
            }

            // Call if method detected ...
            if ($method !== false) {
                $arguments = func_get_args();

                if (count($arguments) > 0) {
                    $result = call_user_func_array([$this, $method], $arguments);
                } else {
                    $result = call_user_func([$this, $method]);
                }

                if (true !== $result) {
                    throw new Doozr_Base_Model_Exception(
                        sprintf(
                            '%s() (if set) MUST return TRUE. %s() is set but it returned: "%s"',
                            $method,
                            $method,
                            var_export($result, true)
                        )
                    );
                }
            }
        }

        return $this->data;
    }
458641
public static function createAdminRole($force = false)
    {
        if(!$force) {
            if(Permission::exists('global', 'admin')) {
                return false;
            }
        }

        return self::createRole(
            'Admin', true, [[
            'app' => 'global',
            'key' => 'admin'
            ]]
        );
    }
431805
public function getRoles(bool $force = false)
    {
        if ($this->nb_role_list->isEmpty() || $force) {
            $this->nb_role_list->clear();
            $this->nb_role_list->merge(CNabuRole::getAllRoles($this));
        }

        return $this->nb_role_list;
    }
598888
public function find($id)
    {
        if (trim($id) == "") {
            throw new Exception\NotFound('dispute with id "' . $id . '" not found');
        }

        try {
            $path = $this->_config->merchantPath() . '/disputes/' . $id;
            $response = $this->_http->get($path);
            return Dispute::factory($response['dispute']);
        } catch (Exception\NotFound $e) {
            throw new Exception\NotFound('dispute with id "' . $id . '" not found');
        }
    }
490465
public function getAttribute($id, $create = false)
    {
        foreach ($this->attributes as $attribute) {
            if ($id == $attribute->getId()) {
                return $attribute;
            }
        }

        if ($create) {
            $attribute = new Attribute();
            $attribute->setId($id);
            $this->addAttribute($attribute);

            return $attribute;
        }

        return null;
    }
1245185
public function getAction($id, Request $request)
    {
        if ($this->getBooleanRequestParameter($request, 'tree', false, false)) {
            $collections = $this->getCollectionManager()->getTreeById(
                $id,
                $this->getRequestParameter($request, 'locale', true)
            );

            return $this->handleView(
                $this->view(
                    new CollectionRepresentation($collections, 'collections')
                )
            );
        }

        try {
            $locale = $this->getRequestParameter($request, 'locale', true);
            $depth = intval($request->get('depth', 0));
            $breadcrumb = $this->getBooleanRequestParameter($request, 'breadcrumb', false, false);
            $children = $this->getBooleanRequestParameter($request, 'children', false, false);
            $collectionManager = $this->getCollectionManager();

            // filter children
            $listRestHelper = $this->get('sulu_core.list_rest_helper');
            $limit = $request->get('limit', null);
            $offset = $this->getOffset($request, $limit);
            $search = $listRestHelper->getSearchPattern();
            $sortBy = $request->get('sortBy');
            $sortOrder = $request->get('sortOrder', 'ASC');

            $filter = [
                'limit' => $limit,
                'offset' => $offset,
                'search' => $search,
            ];

            $view = $this->responseGetById(
                $id,
                function($id) use ($locale, $collectionManager, $depth, $breadcrumb, $filter, $sortBy, $sortOrder, $children) {
                    $collection = $collectionManager->getById(
                        $id,
                        $locale,
                        $depth,
                        $breadcrumb,
                        $filter,
                        null !== $sortBy ? [$sortBy => $sortOrder] : [],
                        $children
                    );

                    if (SystemCollectionManagerInterface::COLLECTION_TYPE === $collection->getType()->getKey()) {
                        $this->get('sulu_security.security_checker')->checkPermission(
                            'sulu.media.system_collections',
                            PermissionTypes::VIEW
                        );
                    }

                    return $collection;
                }
            );
        } catch (CollectionNotFoundException $cnf) {
            $view = $this->view($cnf->toArray(), 404);
        } catch (MediaException $e) {
            $view = $this->view($e->toArray(), 400);
        }

        return $this->handleView($view);
    }
950595
public function getManager($force = false)
    {
        if ($force === true) {
            $this->wipe();
        }

        if (!$this->manager instanceof ObjectManager) {
            $this->manager = $this->buildManager();
        }

        return $this->manager;
    }
96949
public function getPrescriber(bool $force = false)
    {
        if ($this->nb_prescriber == NULL ||
            $this->nb_prescriber->getId() != $this->getPrescriberId() ||
            $force
        ) {
            $nb_prescriber_id = $this->getPrescriberId();
            if ($nb_prescriber_id === null || $this->getCustomer() === null) {
                $this->nb_prescriber = null;
            } else {
                $this->nb_prescriber = $this->getCustomer()->getUser($nb_prescriber_id);
            }
        }

        return $this->nb_prescriber;
    }