id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
222,100 | symlex/input-validation | src/Form.php | Form.clearErrors | public function clearErrors()
{
$this->_validationDone = false;
if (count($this->_errors) != 0) {
$this->_errors = array();
}
return $this;
} | php | public function clearErrors()
{
$this->_validationDone = false;
if (count($this->_errors) != 0) {
$this->_errors = array();
}
return $this;
} | [
"public",
"function",
"clearErrors",
"(",
")",
"{",
"$",
"this",
"->",
"_validationDone",
"=",
"false",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"_errors",
")",
"!=",
"0",
")",
"{",
"$",
"this",
"->",
"_errors",
"=",
"array",
"(",
")",
";",... | Resets the validation and clears all errors | [
"Resets",
"the",
"validation",
"and",
"clears",
"all",
"errors"
] | a5f20c417d23eafd6be7acf9bad39bcbed24e9ff | https://github.com/symlex/input-validation/blob/a5f20c417d23eafd6be7acf9bad39bcbed24e9ff/src/Form.php#L1092-L1101 |
222,101 | claroline/CoreBundle | Manager/MaskManager.php | MaskManager.decodeMask | public function decodeMask($mask, ResourceType $type)
{
$decoders = $this->maskRepo->findBy(array('resourceType' => $type));
$perms = array();
foreach ($decoders as $decoder) {
$perms[$decoder->getName()] = ($mask & $decoder->getValue()) ? true: false;
}
return ... | php | public function decodeMask($mask, ResourceType $type)
{
$decoders = $this->maskRepo->findBy(array('resourceType' => $type));
$perms = array();
foreach ($decoders as $decoder) {
$perms[$decoder->getName()] = ($mask & $decoder->getValue()) ? true: false;
}
return ... | [
"public",
"function",
"decodeMask",
"(",
"$",
"mask",
",",
"ResourceType",
"$",
"type",
")",
"{",
"$",
"decoders",
"=",
"$",
"this",
"->",
"maskRepo",
"->",
"findBy",
"(",
"array",
"(",
"'resourceType'",
"=>",
"$",
"type",
")",
")",
";",
"$",
"perms",
... | Returns an array containing the permission for a mask and a resource type.
@param integer $mask
@param \Claroline\CoreBundle\Entity\Resource\ResourceType $type
@return array | [
"Returns",
"an",
"array",
"containing",
"the",
"permission",
"for",
"a",
"mask",
"and",
"a",
"resource",
"type",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/MaskManager.php#L56-L66 |
222,102 | claroline/CoreBundle | Manager/MaskManager.php | MaskManager.hasMenuAction | public function hasMenuAction(ResourceType $type)
{
$menuActions = $this->menuRepo->findBy(
array('resourceType' => $type)
);
return count($menuActions) > 0;
} | php | public function hasMenuAction(ResourceType $type)
{
$menuActions = $this->menuRepo->findBy(
array('resourceType' => $type)
);
return count($menuActions) > 0;
} | [
"public",
"function",
"hasMenuAction",
"(",
"ResourceType",
"$",
"type",
")",
"{",
"$",
"menuActions",
"=",
"$",
"this",
"->",
"menuRepo",
"->",
"findBy",
"(",
"array",
"(",
"'resourceType'",
"=>",
"$",
"type",
")",
")",
";",
"return",
"count",
"(",
"$",... | Checks if a resource type has any menu actions.
@param \Claroline\CoreBundle\Entity\Resource\ResourceType $type | [
"Checks",
"if",
"a",
"resource",
"type",
"has",
"any",
"menu",
"actions",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/MaskManager.php#L188-L195 |
222,103 | claroline/CoreBundle | Manager/IconManager.php | IconManager.searchIcon | public function searchIcon($mimeType)
{
$mimeElements = explode('/', $mimeType);
$icon = $this->repo->findOneByMimeType($mimeType);
if ($icon === null) {
$icon = $this->repo->findOneByMimeType($mimeElements[0]);
if ($icon === null) {
$icon = $this->... | php | public function searchIcon($mimeType)
{
$mimeElements = explode('/', $mimeType);
$icon = $this->repo->findOneByMimeType($mimeType);
if ($icon === null) {
$icon = $this->repo->findOneByMimeType($mimeElements[0]);
if ($icon === null) {
$icon = $this->... | [
"public",
"function",
"searchIcon",
"(",
"$",
"mimeType",
")",
"{",
"$",
"mimeElements",
"=",
"explode",
"(",
"'/'",
",",
"$",
"mimeType",
")",
";",
"$",
"icon",
"=",
"$",
"this",
"->",
"repo",
"->",
"findOneByMimeType",
"(",
"$",
"mimeType",
")",
";",... | Return the icon of a specified mimeType.
The most specific icon for the mime type will be returned.
@param string $mimeType
@return \Claroline\CoreBundle\Entity\Resource\ResourceIcon | [
"Return",
"the",
"icon",
"of",
"a",
"specified",
"mimeType",
".",
"The",
"most",
"specific",
"icon",
"for",
"the",
"mime",
"type",
"will",
"be",
"returned",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/IconManager.php#L137-L152 |
222,104 | claroline/CoreBundle | Manager/IconManager.php | IconManager.createShortcutIcon | public function createShortcutIcon(ResourceIcon $icon, Workspace $workspace = null)
{
$this->om->startFlushSuite();
$relativeUrl = $this->createShortcutFromRelativeUrl($icon->getRelativeUrl(), $workspace);
$shortcutIcon = new ResourceIcon();
$shortcutIcon->setRelativeUrl($relativeUr... | php | public function createShortcutIcon(ResourceIcon $icon, Workspace $workspace = null)
{
$this->om->startFlushSuite();
$relativeUrl = $this->createShortcutFromRelativeUrl($icon->getRelativeUrl(), $workspace);
$shortcutIcon = new ResourceIcon();
$shortcutIcon->setRelativeUrl($relativeUr... | [
"public",
"function",
"createShortcutIcon",
"(",
"ResourceIcon",
"$",
"icon",
",",
"Workspace",
"$",
"workspace",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"om",
"->",
"startFlushSuite",
"(",
")",
";",
"$",
"relativeUrl",
"=",
"$",
"this",
"->",
"createSho... | Creates the shortcut icon for an existing icon.
@param \Claroline\CoreBundle\Entity\Resource\ResourceIcon $icon
@return \Claroline\CoreBundle\Entity\Resource\ResourceIcon
@throws \RuntimeException | [
"Creates",
"the",
"shortcut",
"icon",
"for",
"an",
"existing",
"icon",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/IconManager.php#L163-L181 |
222,105 | claroline/CoreBundle | Manager/IconManager.php | IconManager.replace | public function replace(ResourceNode $resource, ResourceIcon $icon)
{
$this->om->startFlushSuite();
$oldIcon = $resource->getIcon();
if (!$oldIcon->isShortcut()) {
$oldShortcutIcon = $oldIcon->getShortcutIcon();
$shortcutIcon = $icon->getShortcutIcon();
... | php | public function replace(ResourceNode $resource, ResourceIcon $icon)
{
$this->om->startFlushSuite();
$oldIcon = $resource->getIcon();
if (!$oldIcon->isShortcut()) {
$oldShortcutIcon = $oldIcon->getShortcutIcon();
$shortcutIcon = $icon->getShortcutIcon();
... | [
"public",
"function",
"replace",
"(",
"ResourceNode",
"$",
"resource",
",",
"ResourceIcon",
"$",
"icon",
")",
"{",
"$",
"this",
"->",
"om",
"->",
"startFlushSuite",
"(",
")",
";",
"$",
"oldIcon",
"=",
"$",
"resource",
"->",
"getIcon",
"(",
")",
";",
"i... | Replace a node icon.
@param \Claroline\CoreBundle\Entity\Resource\ResourceNode $resource
@param \Claroline\CoreBundle\Entity\Resource\ResourceIcon $icon
@return \Claroline\CoreBundle\Entity\Resource\ResourceNode | [
"Replace",
"a",
"node",
"icon",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/IconManager.php#L295-L320 |
222,106 | claroline/CoreBundle | Listener/Log/LogListener.php | LogListener.isARepeat | public function isARepeat(LogGenericEvent $event)
{
if ($this->tokenStorage->getToken() === null) {
//Only if have a user session;
return false;
}
if ($event instanceof LogNotRepeatableInterface) {
$request = $this->container->get('request');
... | php | public function isARepeat(LogGenericEvent $event)
{
if ($this->tokenStorage->getToken() === null) {
//Only if have a user session;
return false;
}
if ($event instanceof LogNotRepeatableInterface) {
$request = $this->container->get('request');
... | [
"public",
"function",
"isARepeat",
"(",
"LogGenericEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"tokenStorage",
"->",
"getToken",
"(",
")",
"===",
"null",
")",
"{",
"//Only if have a user session;",
"return",
"false",
";",
"}",
"if",
"(",
... | Is a repeat if the session contains a same logSignature for the same action category | [
"Is",
"a",
"repeat",
"if",
"the",
"session",
"contains",
"a",
"same",
"logSignature",
"for",
"the",
"same",
"action",
"category"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Listener/Log/LogListener.php#L209-L261 |
222,107 | symlex/input-validation | src/Form/Factory.php | Factory.create | public function create(string $name, array $params = array())
{
if (empty($name)) {
throw new FactoryException ('create() requires a non-empty form name as first argument');
}
$className = $this->getFactoryNamespace() . '\\' . $name . $this->getFactoryPostfix();
if (!cl... | php | public function create(string $name, array $params = array())
{
if (empty($name)) {
throw new FactoryException ('create() requires a non-empty form name as first argument');
}
$className = $this->getFactoryNamespace() . '\\' . $name . $this->getFactoryPostfix();
if (!cl... | [
"public",
"function",
"create",
"(",
"string",
"$",
"name",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"FactoryException",
"(",
"'create() requires a non-empty form na... | Returns a new form instance of the given name
@param string $name Type of form
@param array $params Optional config parameters for init()
@throws FactoryException
@return Form | [
"Returns",
"a",
"new",
"form",
"instance",
"of",
"the",
"given",
"name"
] | a5f20c417d23eafd6be7acf9bad39bcbed24e9ff | https://github.com/symlex/input-validation/blob/a5f20c417d23eafd6be7acf9bad39bcbed24e9ff/src/Form/Factory.php#L66-L81 |
222,108 | symlex/input-validation | src/Form/Factory.php | Factory.getFactoryNamespace | public function getFactoryNamespace()
{
$result = $this->_factoryNamespace;
if ($result && strpos($result, '\\') !== 0) {
$result = '\\' . $result;
}
return $result;
} | php | public function getFactoryNamespace()
{
$result = $this->_factoryNamespace;
if ($result && strpos($result, '\\') !== 0) {
$result = '\\' . $result;
}
return $result;
} | [
"public",
"function",
"getFactoryNamespace",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"_factoryNamespace",
";",
"if",
"(",
"$",
"result",
"&&",
"strpos",
"(",
"$",
"result",
",",
"'\\\\'",
")",
"!==",
"0",
")",
"{",
"$",
"result",
"=",
"... | Returns absolute namespace
@return string | [
"Returns",
"absolute",
"namespace"
] | a5f20c417d23eafd6be7acf9bad39bcbed24e9ff | https://github.com/symlex/input-validation/blob/a5f20c417d23eafd6be7acf9bad39bcbed24e9ff/src/Form/Factory.php#L113-L122 |
222,109 | claroline/CoreBundle | Manager/ProfilePropertyManager.php | ProfilePropertyManager.addDefaultProperties | public function addDefaultProperties()
{
$properties = User::getEditableProperties();
$this->om->startFlushSuite();
foreach ($properties as $property => $editable) {
$this->addProperties($property, $editable);
}
$this->om->endFlushSuite();
} | php | public function addDefaultProperties()
{
$properties = User::getEditableProperties();
$this->om->startFlushSuite();
foreach ($properties as $property => $editable) {
$this->addProperties($property, $editable);
}
$this->om->endFlushSuite();
} | [
"public",
"function",
"addDefaultProperties",
"(",
")",
"{",
"$",
"properties",
"=",
"User",
"::",
"getEditableProperties",
"(",
")",
";",
"$",
"this",
"->",
"om",
"->",
"startFlushSuite",
"(",
")",
";",
"foreach",
"(",
"$",
"properties",
"as",
"$",
"prope... | Add the default properties accesses for each roles | [
"Add",
"the",
"default",
"properties",
"accesses",
"for",
"each",
"roles"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ProfilePropertyManager.php#L57-L67 |
222,110 | claroline/CoreBundle | Manager/ProfilePropertyManager.php | ProfilePropertyManager.addProperties | public function addProperties($property, $editable)
{
$platformRoles = $this->roleManager->getAllPlatformRoles();
foreach ($platformRoles as $role) {
$prop = $this->profilePropertyRepo
->findBy(array('property' => $property, 'role' => $role));
if (count($pro... | php | public function addProperties($property, $editable)
{
$platformRoles = $this->roleManager->getAllPlatformRoles();
foreach ($platformRoles as $role) {
$prop = $this->profilePropertyRepo
->findBy(array('property' => $property, 'role' => $role));
if (count($pro... | [
"public",
"function",
"addProperties",
"(",
"$",
"property",
",",
"$",
"editable",
")",
"{",
"$",
"platformRoles",
"=",
"$",
"this",
"->",
"roleManager",
"->",
"getAllPlatformRoles",
"(",
")",
";",
"foreach",
"(",
"$",
"platformRoles",
"as",
"$",
"role",
"... | Public function add a property for each roles
@param string $property
@param boolean $editable | [
"Public",
"function",
"add",
"a",
"property",
"for",
"each",
"roles"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ProfilePropertyManager.php#L75-L85 |
222,111 | claroline/CoreBundle | Manager/ProfilePropertyManager.php | ProfilePropertyManager.addProperty | public function addProperty($property, $editable, Role $role)
{
$propertyEntity = new ProfileProperty();
$propertyEntity->setProperty($property);
$propertyEntity->setIsEditable($editable);
$propertyEntity->setRole($role);
$this->om->persist($propertyEntity);
$this->om... | php | public function addProperty($property, $editable, Role $role)
{
$propertyEntity = new ProfileProperty();
$propertyEntity->setProperty($property);
$propertyEntity->setIsEditable($editable);
$propertyEntity->setRole($role);
$this->om->persist($propertyEntity);
$this->om... | [
"public",
"function",
"addProperty",
"(",
"$",
"property",
",",
"$",
"editable",
",",
"Role",
"$",
"role",
")",
"{",
"$",
"propertyEntity",
"=",
"new",
"ProfileProperty",
"(",
")",
";",
"$",
"propertyEntity",
"->",
"setProperty",
"(",
"$",
"property",
")",... | Create a property entity
@param string $property
@param boolean $editable
@param Role $role | [
"Create",
"a",
"property",
"entity"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ProfilePropertyManager.php#L94-L102 |
222,112 | claroline/CoreBundle | Controller/HomeController.php | HomeController.contentAction | public function contentAction(Content $content, Type $type, Content $father = null)
{
return $this->render(
'ClarolineCoreBundle:Home/types:'.(is_object($type) ? $type->getName() : 'home' ).'.html.twig',
$this->manager->getContent($content, $type, $father),
true
)... | php | public function contentAction(Content $content, Type $type, Content $father = null)
{
return $this->render(
'ClarolineCoreBundle:Home/types:'.(is_object($type) ? $type->getName() : 'home' ).'.html.twig',
$this->manager->getContent($content, $type, $father),
true
)... | [
"public",
"function",
"contentAction",
"(",
"Content",
"$",
"content",
",",
"Type",
"$",
"type",
",",
"Content",
"$",
"father",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"render",
"(",
"'ClarolineCoreBundle:Home/types:'",
".",
"(",
"is_object",
"("... | Get content by id
@Route(
"/content/{content}/{type}/{father}",
requirements={"content" = "\d+"},
name="claroline_get_content_by_id_and_type",
defaults={"type" = "home", "father" = null},
options = {"expose" = true}
)
@ParamConverter("content", class = "ClarolineCoreBundle:Content", options = {"id" = "content"})
@Par... | [
"Get",
"content",
"by",
"id"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Controller/HomeController.php#L92-L99 |
222,113 | claroline/CoreBundle | Controller/HomeController.php | HomeController.homeAction | public function homeAction($type)
{
$typeEntity = $this->manager->getType($type);
if (is_null($typeEntity)) {
throw new NotFoundHttpException("Page not found");
} else {
$typeTemplate = $typeEntity->getTemplate();
$template = is_null($typeTemplate) ?
... | php | public function homeAction($type)
{
$typeEntity = $this->manager->getType($type);
if (is_null($typeEntity)) {
throw new NotFoundHttpException("Page not found");
} else {
$typeTemplate = $typeEntity->getTemplate();
$template = is_null($typeTemplate) ?
... | [
"public",
"function",
"homeAction",
"(",
"$",
"type",
")",
"{",
"$",
"typeEntity",
"=",
"$",
"this",
"->",
"manager",
"->",
"getType",
"(",
"$",
"type",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"typeEntity",
")",
")",
"{",
"throw",
"new",
"NotFoundH... | Render the home page of the platform
@Route("/type/{type}", name="claro_get_content_by_type", options = {"expose" = true})
@Route("/", name="claro_index", defaults={"type" = "home"}, options = {"expose" = true})
@return \Symfony\Component\HttpFoundation\Response | [
"Render",
"the",
"home",
"page",
"of",
"the",
"platform"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Controller/HomeController.php#L109-L137 |
222,114 | claroline/CoreBundle | Controller/HomeController.php | HomeController.renameContentAction | public function renameContentAction($type, $name)
{
try {
$this->manager->renameType($type, $name);
return new Response('true');
} catch (\Exeption $e) {
return new Response('false'); //useful in ajax
}
} | php | public function renameContentAction($type, $name)
{
try {
$this->manager->renameType($type, $name);
return new Response('true');
} catch (\Exeption $e) {
return new Response('false'); //useful in ajax
}
} | [
"public",
"function",
"renameContentAction",
"(",
"$",
"type",
",",
"$",
"name",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"manager",
"->",
"renameType",
"(",
"$",
"type",
",",
"$",
"name",
")",
";",
"return",
"new",
"Response",
"(",
"'true'",
")",
";... | Rename a content form
@Route("/rename/type/{type}/{name}", name="claro_content_rename_type", options = {"expose" = true})
@Secure(roles="ROLE_HOME_MANAGER")
@ParamConverter("type", class = "ClarolineCoreBundle:home\Type", options = {"mapping" : {"type": "name"}})
@return \Symfony\Component\HttpFoundation\Response | [
"Rename",
"a",
"content",
"form"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Controller/HomeController.php#L228-L237 |
222,115 | claroline/CoreBundle | Controller/HomeController.php | HomeController.changeTemplateFormAction | public function changeTemplateFormAction(Type $type)
{
$form = $this->formFactory->create(
new HomeTemplateType($this->templatesDirectory),
$type
);
return array('form' => $form->createView(), 'type' => $type);
} | php | public function changeTemplateFormAction(Type $type)
{
$form = $this->formFactory->create(
new HomeTemplateType($this->templatesDirectory),
$type
);
return array('form' => $form->createView(), 'type' => $type);
} | [
"public",
"function",
"changeTemplateFormAction",
"(",
"Type",
"$",
"type",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"formFactory",
"->",
"create",
"(",
"new",
"HomeTemplateType",
"(",
"$",
"this",
"->",
"templatesDirectory",
")",
",",
"$",
"type",
"... | Edit template form
@Route(
"/type/{type}/change/template/form",
name="claro_content_change_template_form",
options = {"expose" = true}
)
@Secure(roles="ROLE_HOME_MANAGER")
@Template("ClarolineCoreBundle:Home:changeTemplateModalForm.html.twig")
@return \Symfony\Component\HttpFoundation\Response | [
"Edit",
"template",
"form"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Controller/HomeController.php#L253-L261 |
222,116 | claroline/CoreBundle | Controller/HomeController.php | HomeController.collapseAction | public function collapseAction($content, $type)
{
try {
$this->manager->collapse($content, $type);
return new Response('true');
} catch (\Exeption $e) {
return new Response('false');
}
} | php | public function collapseAction($content, $type)
{
try {
$this->manager->collapse($content, $type);
return new Response('true');
} catch (\Exeption $e) {
return new Response('false');
}
} | [
"public",
"function",
"collapseAction",
"(",
"$",
"content",
",",
"$",
"type",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"manager",
"->",
"collapse",
"(",
"$",
"content",
",",
"$",
"type",
")",
";",
"return",
"new",
"Response",
"(",
"'true'",
")",
";"... | Update the collapse attribute of a content
@Route(
"/content/collapse/{content}/{type}",
name="claroline_content_collapse",
options = {"expose" = true}
)
@Secure(roles="ROLE_HOME_MANAGER")
@ParamConverter("content", class = "ClarolineCoreBundle:Content", options = {"id" = "content"})
@ParamConverter("type", class = ... | [
"Update",
"the",
"collapse",
"attribute",
"of",
"a",
"content"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Controller/HomeController.php#L633-L642 |
222,117 | claroline/CoreBundle | Controller/HomeController.php | HomeController.canGenerateContentAction | public function canGenerateContentAction()
{
if ($this->manager->isValidUrl($this->request->get('url'))) {
$graph = $this->manager->getGraph($this->request->get('url'));
if (isset($graph['type'])) {
return $this->render(
'ClarolineCoreBundle:Home... | php | public function canGenerateContentAction()
{
if ($this->manager->isValidUrl($this->request->get('url'))) {
$graph = $this->manager->getGraph($this->request->get('url'));
if (isset($graph['type'])) {
return $this->render(
'ClarolineCoreBundle:Home... | [
"public",
"function",
"canGenerateContentAction",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"manager",
"->",
"isValidUrl",
"(",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"'url'",
")",
")",
")",
"{",
"$",
"graph",
"=",
"$",
"this",
"->",
"man... | Check if a string is a valid URL
@Route("/cangeneratecontent", name="claroline_can_generate_content")
@return \Symfony\Component\HttpFoundation\Response | [
"Check",
"if",
"a",
"string",
"is",
"a",
"valid",
"URL"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Controller/HomeController.php#L651-L667 |
222,118 | claroline/CoreBundle | Repository/OrderedToolRepository.php | OrderedToolRepository.findOrderedToolsLockedByAdmin | public function findOrderedToolsLockedByAdmin($orderedToolType = 0)
{
$dql = "
SELECT ot
FROM Claroline\CoreBundle\Entity\Tool\OrderedTool ot
JOIN ot.tool t
WHERE ot.user IS NULL
AND ot.workspace IS NULL
AND ot.type = :type
... | php | public function findOrderedToolsLockedByAdmin($orderedToolType = 0)
{
$dql = "
SELECT ot
FROM Claroline\CoreBundle\Entity\Tool\OrderedTool ot
JOIN ot.tool t
WHERE ot.user IS NULL
AND ot.workspace IS NULL
AND ot.type = :type
... | [
"public",
"function",
"findOrderedToolsLockedByAdmin",
"(",
"$",
"orderedToolType",
"=",
"0",
")",
"{",
"$",
"dql",
"=",
"\"\n SELECT ot\n FROM Claroline\\CoreBundle\\Entity\\Tool\\OrderedTool ot\n JOIN ot.tool t\n WHERE ot.user IS NULL\n ... | Returns the ordered tools locked by admin.
@return array[OrderedTool] | [
"Returns",
"the",
"ordered",
"tools",
"locked",
"by",
"admin",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/OrderedToolRepository.php#L309-L326 |
222,119 | claroline/CoreBundle | Library/Workspace/Configuration.php | Configuration.extract | private function extract($extractPath, $archive)
{
$res = $archive->extractTo($extractPath);
$archive->close();
$this->setExtractPath($extractPath);
$resolver = new Resolver($extractPath);
$this->data = $resolver->resolve();
} | php | private function extract($extractPath, $archive)
{
$res = $archive->extractTo($extractPath);
$archive->close();
$this->setExtractPath($extractPath);
$resolver = new Resolver($extractPath);
$this->data = $resolver->resolve();
} | [
"private",
"function",
"extract",
"(",
"$",
"extractPath",
",",
"$",
"archive",
")",
"{",
"$",
"res",
"=",
"$",
"archive",
"->",
"extractTo",
"(",
"$",
"extractPath",
")",
";",
"$",
"archive",
"->",
"close",
"(",
")",
";",
"$",
"this",
"->",
"setExtr... | Assume the archive is already opened.
@param $extractPath
@param $archive | [
"Assume",
"the",
"archive",
"is",
"already",
"opened",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Library/Workspace/Configuration.php#L67-L74 |
222,120 | sam002/yii2-otp | src/widgets/OtpInit.php | OtpInit.renderWidget | private function renderWidget()
{
$img = $this->getImageSource();
echo "<div>$img</div>";
if ($this->link || is_string($this->link)) {
echo Html::a($this->link, $this->otp->getProvisioningUri());
}
if ($this->hasModel()
&& $this->model->hasProperty(... | php | private function renderWidget()
{
$img = $this->getImageSource();
echo "<div>$img</div>";
if ($this->link || is_string($this->link)) {
echo Html::a($this->link, $this->otp->getProvisioningUri());
}
if ($this->hasModel()
&& $this->model->hasProperty(... | [
"private",
"function",
"renderWidget",
"(",
")",
"{",
"$",
"img",
"=",
"$",
"this",
"->",
"getImageSource",
"(",
")",
";",
"echo",
"\"<div>$img</div>\"",
";",
"if",
"(",
"$",
"this",
"->",
"link",
"||",
"is_string",
"(",
"$",
"this",
"->",
"link",
")",... | Render Image and link block | [
"Render",
"Image",
"and",
"link",
"block"
] | d98b7398eb64c8ce25560c82c85f7116128c913f | https://github.com/sam002/yii2-otp/blob/d98b7398eb64c8ce25560c82c85f7116128c913f/src/widgets/OtpInit.php#L91-L108 |
222,121 | claroline/CoreBundle | Repository/ProfilePropertyRepository.php | ProfilePropertyRepository.findAccessesByRoles | public function findAccessesByRoles(array $roles)
{
$dql = '
SELECT pp.property as property, MAX(pp.isEditable) as isEditable
FROM Claroline\CoreBundle\Entity\ProfileProperty pp
JOIN pp.role role
WHERE role.name in (:roleNames)
GROUP BY pp.property... | php | public function findAccessesByRoles(array $roles)
{
$dql = '
SELECT pp.property as property, MAX(pp.isEditable) as isEditable
FROM Claroline\CoreBundle\Entity\ProfileProperty pp
JOIN pp.role role
WHERE role.name in (:roleNames)
GROUP BY pp.property... | [
"public",
"function",
"findAccessesByRoles",
"(",
"array",
"$",
"roles",
")",
"{",
"$",
"dql",
"=",
"'\n SELECT pp.property as property, MAX(pp.isEditable) as isEditable\n FROM Claroline\\CoreBundle\\Entity\\ProfileProperty pp\n JOIN pp.role role\n ... | Returns the accesses for a list of roles | [
"Returns",
"the",
"accesses",
"for",
"a",
"list",
"of",
"roles"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/ProfilePropertyRepository.php#L21-L42 |
222,122 | claroline/CoreBundle | Manager/WorkspaceTagManager.php | WorkspaceTagManager.insert | public function insert(WorkspaceTag $tag)
{
$this->om->persist($tag);
$this->om->flush();
} | php | public function insert(WorkspaceTag $tag)
{
$this->om->persist($tag);
$this->om->flush();
} | [
"public",
"function",
"insert",
"(",
"WorkspaceTag",
"$",
"tag",
")",
"{",
"$",
"this",
"->",
"om",
"->",
"persist",
"(",
"$",
"tag",
")",
";",
"$",
"this",
"->",
"om",
"->",
"flush",
"(",
")",
";",
"}"
] | Persists and flush a tag.
@param \Claroline\CoreBundle\Entity\Workspace\WorkspaceTag $tag | [
"Persists",
"and",
"flush",
"a",
"tag",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/WorkspaceTagManager.php#L81-L85 |
222,123 | claroline/CoreBundle | Manager/WorkspaceTagManager.php | WorkspaceTagManager.isTagDisplayable | private function isTagDisplayable(WorkspaceTag $tag, array $tagWorkspaces, array $hierarchy)
{
$displayable = false;
$tagId = $tag->getId();
if ((isset($tagWorkspaces[$tagId]) && count($tagWorkspaces[$tagId]) > 0)
|| !is_null($tag->getWorkspace())) {
$displayable = ... | php | private function isTagDisplayable(WorkspaceTag $tag, array $tagWorkspaces, array $hierarchy)
{
$displayable = false;
$tagId = $tag->getId();
if ((isset($tagWorkspaces[$tagId]) && count($tagWorkspaces[$tagId]) > 0)
|| !is_null($tag->getWorkspace())) {
$displayable = ... | [
"private",
"function",
"isTagDisplayable",
"(",
"WorkspaceTag",
"$",
"tag",
",",
"array",
"$",
"tagWorkspaces",
",",
"array",
"$",
"hierarchy",
")",
"{",
"$",
"displayable",
"=",
"false",
";",
"$",
"tagId",
"=",
"$",
"tag",
"->",
"getId",
"(",
")",
";",
... | Checks if given tag or at least one of its children is associated to a workspace
@param integer $tagId
@param array $tagWorkspaces
@param array $hierarchy
@return boolean | [
"Checks",
"if",
"given",
"tag",
"or",
"at",
"least",
"one",
"of",
"its",
"children",
"is",
"associated",
"to",
"a",
"workspace"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/WorkspaceTagManager.php#L667-L693 |
222,124 | claroline/CoreBundle | Manager/ResourceManager.php | ResourceManager.haveSameParents | public function haveSameParents(array $nodes)
{
$firstRes = array_pop($nodes);
$tmp = $firstRes['parent_id'];
foreach ($nodes as $node) {
if ($tmp !== $node['parent_id']) {
return false;
}
}
return true;
} | php | public function haveSameParents(array $nodes)
{
$firstRes = array_pop($nodes);
$tmp = $firstRes['parent_id'];
foreach ($nodes as $node) {
if ($tmp !== $node['parent_id']) {
return false;
}
}
return true;
} | [
"public",
"function",
"haveSameParents",
"(",
"array",
"$",
"nodes",
")",
"{",
"$",
"firstRes",
"=",
"array_pop",
"(",
"$",
"nodes",
")",
";",
"$",
"tmp",
"=",
"$",
"firstRes",
"[",
"'parent_id'",
"]",
";",
"foreach",
"(",
"$",
"nodes",
"as",
"$",
"n... | Checks if an array of serialized resources share the same parent.
@param array nodes
@return array | [
"Checks",
"if",
"an",
"array",
"of",
"serialized",
"resources",
"share",
"the",
"same",
"parent",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ResourceManager.php#L322-L334 |
222,125 | claroline/CoreBundle | Manager/ResourceManager.php | ResourceManager.makeShortcut | public function makeShortcut(ResourceNode $target, ResourceNode $parent, User $creator, ResourceShortcut $shortcut)
{
$shortcut->setName($target->getName());
if (get_class($target) !== 'Claroline\CoreBundle\Entity\Resource\ResourceShortcut') {
$shortcut->setTarget($target);
} el... | php | public function makeShortcut(ResourceNode $target, ResourceNode $parent, User $creator, ResourceShortcut $shortcut)
{
$shortcut->setName($target->getName());
if (get_class($target) !== 'Claroline\CoreBundle\Entity\Resource\ResourceShortcut') {
$shortcut->setTarget($target);
} el... | [
"public",
"function",
"makeShortcut",
"(",
"ResourceNode",
"$",
"target",
",",
"ResourceNode",
"$",
"parent",
",",
"User",
"$",
"creator",
",",
"ResourceShortcut",
"$",
"shortcut",
")",
"{",
"$",
"shortcut",
"->",
"setName",
"(",
"$",
"target",
"->",
"getNam... | Creates a shortcut.
@param \Claroline\CoreBundle\Entity\Resource\ResourceNode $target
@param \Claroline\CoreBundle\Entity\Resource\ResourceNode $parent
@param \Claroline\CoreBundle\Entity\User $creator
@param \Claroline\CoreBundle\Entity\Resource\ResourceShortcut $shortcut
@return \Clarol... | [
"Creates",
"a",
"shortcut",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ResourceManager.php#L346-L368 |
222,126 | claroline/CoreBundle | Manager/ResourceManager.php | ResourceManager.checkResourcePrepared | public function checkResourcePrepared(AbstractResource $resource)
{
$stringErrors = '';
//null or '' shouldn't be valid
if ($resource->getName() == null) {
$stringErrors .= 'The resource name is missing' . PHP_EOL;
}
if ($stringErrors !== '') {
throw... | php | public function checkResourcePrepared(AbstractResource $resource)
{
$stringErrors = '';
//null or '' shouldn't be valid
if ($resource->getName() == null) {
$stringErrors .= 'The resource name is missing' . PHP_EOL;
}
if ($stringErrors !== '') {
throw... | [
"public",
"function",
"checkResourcePrepared",
"(",
"AbstractResource",
"$",
"resource",
")",
"{",
"$",
"stringErrors",
"=",
"''",
";",
"//null or '' shouldn't be valid",
"if",
"(",
"$",
"resource",
"->",
"getName",
"(",
")",
"==",
"null",
")",
"{",
"$",
"stri... | Checks if a resource already has a name.
@param \Claroline\CoreBundle\Entity\Resource\AbstractResource $resource
@throws MissingResourceNameException | [
"Checks",
"if",
"a",
"resource",
"already",
"has",
"a",
"name",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ResourceManager.php#L450-L462 |
222,127 | claroline/CoreBundle | Manager/ResourceManager.php | ResourceManager.move | public function move(ResourceNode $child, ResourceNode $parent)
{
if ($parent === $child) {
throw new ResourceMoveException("You cannot move a directory into itself");
}
$this->om->startFlushSuite();
$this->setLastIndex($parent, $child);
$child->setParent($parent)... | php | public function move(ResourceNode $child, ResourceNode $parent)
{
if ($parent === $child) {
throw new ResourceMoveException("You cannot move a directory into itself");
}
$this->om->startFlushSuite();
$this->setLastIndex($parent, $child);
$child->setParent($parent)... | [
"public",
"function",
"move",
"(",
"ResourceNode",
"$",
"child",
",",
"ResourceNode",
"$",
"parent",
")",
"{",
"if",
"(",
"$",
"parent",
"===",
"$",
"child",
")",
"{",
"throw",
"new",
"ResourceMoveException",
"(",
"\"You cannot move a directory into itself\"",
"... | Moves a resource.
@param ResourceNode $child currently treated node
@param ResourceNode $parent old parent
@throws ResourceMoveException
@return ResourceNode | [
"Moves",
"a",
"resource",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ResourceManager.php#L601-L620 |
222,128 | claroline/CoreBundle | Manager/ResourceManager.php | ResourceManager.hasLinkTo | public function hasLinkTo(ResourceNode $parent, ResourceNode $target)
{
$nodes = $this->resourceNodeRepo
->findBy(array('parent' => $parent, 'class' => 'Claroline\CoreBundle\Entity\Resource\ResourceShortcut'));
foreach ($nodes as $node) {
$shortcut = $this->getResourceFromNo... | php | public function hasLinkTo(ResourceNode $parent, ResourceNode $target)
{
$nodes = $this->resourceNodeRepo
->findBy(array('parent' => $parent, 'class' => 'Claroline\CoreBundle\Entity\Resource\ResourceShortcut'));
foreach ($nodes as $node) {
$shortcut = $this->getResourceFromNo... | [
"public",
"function",
"hasLinkTo",
"(",
"ResourceNode",
"$",
"parent",
",",
"ResourceNode",
"$",
"target",
")",
"{",
"$",
"nodes",
"=",
"$",
"this",
"->",
"resourceNodeRepo",
"->",
"findBy",
"(",
"array",
"(",
"'parent'",
"=>",
"$",
"parent",
",",
"'class'... | Checks if a resource in a node has a link to the target with a shortcut.
@param \Claroline\CoreBundle\Entity\Resource\ResourceNode $parent
@param \Claroline\CoreBundle\Entity\Resource\ResourceNode $target
@return boolean | [
"Checks",
"if",
"a",
"resource",
"in",
"a",
"node",
"has",
"a",
"link",
"to",
"the",
"target",
"with",
"a",
"shortcut",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ResourceManager.php#L655-L668 |
222,129 | claroline/CoreBundle | Manager/ResourceManager.php | ResourceManager.isPathValid | public function isPathValid(array $ancestors)
{
$continue = true;
for ($i = 0, $size = count($ancestors); $i < $size; $i++) {
if (isset($ancestors[$i + 1])) {
if ($ancestors[$i + 1]->getParent() === $ancestors[$i]) {
$continue = true;
... | php | public function isPathValid(array $ancestors)
{
$continue = true;
for ($i = 0, $size = count($ancestors); $i < $size; $i++) {
if (isset($ancestors[$i + 1])) {
if ($ancestors[$i + 1]->getParent() === $ancestors[$i]) {
$continue = true;
... | [
"public",
"function",
"isPathValid",
"(",
"array",
"$",
"ancestors",
")",
"{",
"$",
"continue",
"=",
"true",
";",
"for",
"(",
"$",
"i",
"=",
"0",
",",
"$",
"size",
"=",
"count",
"(",
"$",
"ancestors",
")",
";",
"$",
"i",
"<",
"$",
"size",
";",
... | Checks if a path is valid.
@param array $ancestors
@return boolean | [
"Checks",
"if",
"a",
"path",
"is",
"valid",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ResourceManager.php#L677-L696 |
222,130 | claroline/CoreBundle | Manager/ResourceManager.php | ResourceManager.areAncestorsDirectory | public function areAncestorsDirectory(array $ancestors)
{
array_pop($ancestors);
foreach ($ancestors as $ancestor) {
if ($ancestor->getResourceType()->getName() !== 'directory') {
return false;
}
}
return true;
} | php | public function areAncestorsDirectory(array $ancestors)
{
array_pop($ancestors);
foreach ($ancestors as $ancestor) {
if ($ancestor->getResourceType()->getName() !== 'directory') {
return false;
}
}
return true;
} | [
"public",
"function",
"areAncestorsDirectory",
"(",
"array",
"$",
"ancestors",
")",
"{",
"array_pop",
"(",
"$",
"ancestors",
")",
";",
"foreach",
"(",
"$",
"ancestors",
"as",
"$",
"ancestor",
")",
"{",
"if",
"(",
"$",
"ancestor",
"->",
"getResourceType",
"... | Checks if all the resource in the array are directories.
@param \Claroline\CoreBundle\Entity\Resource\ResourceNode[] $ancestors
@return boolean | [
"Checks",
"if",
"all",
"the",
"resource",
"in",
"the",
"array",
"are",
"directories",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ResourceManager.php#L705-L716 |
222,131 | claroline/CoreBundle | Manager/ResourceManager.php | ResourceManager.changeIcon | public function changeIcon(ResourceNode $node, File $file)
{
$this->om->startFlushSuite();
$icon = $this->iconManager->createCustomIcon($file, $node->getWorkspace());
$this->iconManager->replace($node, $icon);
$this->logChangeSet($node);
$this->om->endFlushSuite();
r... | php | public function changeIcon(ResourceNode $node, File $file)
{
$this->om->startFlushSuite();
$icon = $this->iconManager->createCustomIcon($file, $node->getWorkspace());
$this->iconManager->replace($node, $icon);
$this->logChangeSet($node);
$this->om->endFlushSuite();
r... | [
"public",
"function",
"changeIcon",
"(",
"ResourceNode",
"$",
"node",
",",
"File",
"$",
"file",
")",
"{",
"$",
"this",
"->",
"om",
"->",
"startFlushSuite",
"(",
")",
";",
"$",
"icon",
"=",
"$",
"this",
"->",
"iconManager",
"->",
"createCustomIcon",
"(",
... | Changes a node icon.
@param \Claroline\CoreBundle\Entity\Resource\ResourceNode $node
@param \Symfony\Component\HttpFoundation\File\File $file
@return \Claroline\CoreBundle\Entity\Resource\ResourceIcon | [
"Changes",
"a",
"node",
"icon",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ResourceManager.php#L1195-L1204 |
222,132 | claroline/CoreBundle | Manager/ResourceManager.php | ResourceManager.logChangeSet | public function logChangeSet(ResourceNode $node)
{
$uow = $this->om->getUnitOfWork();
$uow->computeChangeSets();
$changeSet = $uow->getEntityChangeSet($node);
if (count($changeSet) > 0) {
$this->dispatcher->dispatch(
'log',
'Log\LogResourc... | php | public function logChangeSet(ResourceNode $node)
{
$uow = $this->om->getUnitOfWork();
$uow->computeChangeSets();
$changeSet = $uow->getEntityChangeSet($node);
if (count($changeSet) > 0) {
$this->dispatcher->dispatch(
'log',
'Log\LogResourc... | [
"public",
"function",
"logChangeSet",
"(",
"ResourceNode",
"$",
"node",
")",
"{",
"$",
"uow",
"=",
"$",
"this",
"->",
"om",
"->",
"getUnitOfWork",
"(",
")",
";",
"$",
"uow",
"->",
"computeChangeSets",
"(",
")",
";",
"$",
"changeSet",
"=",
"$",
"uow",
... | Logs every change on a node.
@param \Claroline\CoreBundle\Entity\Resource\ResourceNode $node | [
"Logs",
"every",
"change",
"on",
"a",
"node",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ResourceManager.php#L1211-L1224 |
222,133 | claroline/CoreBundle | Manager/ResourceManager.php | ResourceManager.isWorkspaceOwnerOf | public function isWorkspaceOwnerOf(ResourceNode $node, TokenInterface $token)
{
$workspace = $node->getWorkspace();
$managerRoleName = 'ROLE_WS_MANAGER_' . $workspace->getGuid();
return in_array($managerRoleName, $this->secut->getRoles($token)) ? true: false;
} | php | public function isWorkspaceOwnerOf(ResourceNode $node, TokenInterface $token)
{
$workspace = $node->getWorkspace();
$managerRoleName = 'ROLE_WS_MANAGER_' . $workspace->getGuid();
return in_array($managerRoleName, $this->secut->getRoles($token)) ? true: false;
} | [
"public",
"function",
"isWorkspaceOwnerOf",
"(",
"ResourceNode",
"$",
"node",
",",
"TokenInterface",
"$",
"token",
")",
"{",
"$",
"workspace",
"=",
"$",
"node",
"->",
"getWorkspace",
"(",
")",
";",
"$",
"managerRoleName",
"=",
"'ROLE_WS_MANAGER_'",
".",
"$",
... | Returns true of the token owns the workspace of the resource node.
@param ResourceNode $node
@param TokenInterface $token
@return boolean | [
"Returns",
"true",
"of",
"the",
"token",
"owns",
"the",
"workspace",
"of",
"the",
"resource",
"node",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ResourceManager.php#L1523-L1529 |
222,134 | claroline/CoreBundle | Manager/ResourceManager.php | ResourceManager.changeAccessibilityDate | public function changeAccessibilityDate(
ResourceNode $node,
$accessibleFrom,
$accessibleUntil
)
{
if ($node->getResourceType()->getName() === 'directory') {
$descendants = $this->resourceNodeRepo->findDescendants($node);
foreach ($descendants as $descend... | php | public function changeAccessibilityDate(
ResourceNode $node,
$accessibleFrom,
$accessibleUntil
)
{
if ($node->getResourceType()->getName() === 'directory') {
$descendants = $this->resourceNodeRepo->findDescendants($node);
foreach ($descendants as $descend... | [
"public",
"function",
"changeAccessibilityDate",
"(",
"ResourceNode",
"$",
"node",
",",
"$",
"accessibleFrom",
",",
"$",
"accessibleUntil",
")",
"{",
"if",
"(",
"$",
"node",
"->",
"getResourceType",
"(",
")",
"->",
"getName",
"(",
")",
"===",
"'directory'",
... | Retrieves all descendants of given ResourceNode and updates their
accessibility dates.
@param ResourceNode $node A directory
@param datetime $accessibleFrom
@param datetime $accessibleUntil | [
"Retrieves",
"all",
"descendants",
"of",
"given",
"ResourceNode",
"and",
"updates",
"their",
"accessibility",
"dates",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ResourceManager.php#L1550-L1566 |
222,135 | claroline/CoreBundle | Manager/ResourceManager.php | ResourceManager.isResourceActionImplemented | public function isResourceActionImplemented(ResourceType $resourceType = null, $actionName)
{
if ($resourceType) {
$alwaysTrue = array('rename', 'edit-properties', 'edit-rights', 'open-tracking');
//first, directories can be downloaded even if there is no listener attached to it
... | php | public function isResourceActionImplemented(ResourceType $resourceType = null, $actionName)
{
if ($resourceType) {
$alwaysTrue = array('rename', 'edit-properties', 'edit-rights', 'open-tracking');
//first, directories can be downloaded even if there is no listener attached to it
... | [
"public",
"function",
"isResourceActionImplemented",
"(",
"ResourceType",
"$",
"resourceType",
"=",
"null",
",",
"$",
"actionName",
")",
"{",
"if",
"(",
"$",
"resourceType",
")",
"{",
"$",
"alwaysTrue",
"=",
"array",
"(",
"'rename'",
",",
"'edit-properties'",
... | Returns true if the listener is implemented for a resourceType and an action
@param ResourceType $resourceType
@param string $actionName | [
"Returns",
"true",
"if",
"the",
"listener",
"is",
"implemented",
"for",
"a",
"resourceType",
"and",
"an",
"action"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ResourceManager.php#L1574-L1588 |
222,136 | claroline/CoreBundle | Manager/ResourceManager.php | ResourceManager.addStorageExceededFormError | public function addStorageExceededFormError(Form $form, $fileSize, Workspace $workspace)
{
$filesize = $this->ut->getRealFileSize($fileSize);
//we want how many bites and well...
$maxSize = $this->ut->getRealFileSize($workspace->getMaxStorageSize());
//throw new \Exception($maxSize);... | php | public function addStorageExceededFormError(Form $form, $fileSize, Workspace $workspace)
{
$filesize = $this->ut->getRealFileSize($fileSize);
//we want how many bites and well...
$maxSize = $this->ut->getRealFileSize($workspace->getMaxStorageSize());
//throw new \Exception($maxSize);... | [
"public",
"function",
"addStorageExceededFormError",
"(",
"Form",
"$",
"form",
",",
"$",
"fileSize",
",",
"Workspace",
"$",
"workspace",
")",
"{",
"$",
"filesize",
"=",
"$",
"this",
"->",
"ut",
"->",
"getRealFileSize",
"(",
"$",
"fileSize",
")",
";",
"//we... | Adds the storage exceeded error in a form.
@param Form $form
@param integer $filesize | [
"Adds",
"the",
"storage",
"exceeded",
"error",
"in",
"a",
"form",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ResourceManager.php#L1664-L1685 |
222,137 | claroline/CoreBundle | Manager/ResourceManager.php | ResourceManager.getNodeScheduledForInsert | public function getNodeScheduledForInsert(Workspace $workspace, $name, $parent = null)
{
$scheduledForInsert = $this->om->getUnitOfWork()->getScheduledEntityInsertions();
$res = null;
foreach ($scheduledForInsert as $entity) {
if (get_class($entity) === 'Claroline\CoreBundle\Ent... | php | public function getNodeScheduledForInsert(Workspace $workspace, $name, $parent = null)
{
$scheduledForInsert = $this->om->getUnitOfWork()->getScheduledEntityInsertions();
$res = null;
foreach ($scheduledForInsert as $entity) {
if (get_class($entity) === 'Claroline\CoreBundle\Ent... | [
"public",
"function",
"getNodeScheduledForInsert",
"(",
"Workspace",
"$",
"workspace",
",",
"$",
"name",
",",
"$",
"parent",
"=",
"null",
")",
"{",
"$",
"scheduledForInsert",
"=",
"$",
"this",
"->",
"om",
"->",
"getUnitOfWork",
"(",
")",
"->",
"getScheduledE... | Search a ResourceNode wich is persisted but not flushed yet
@param Workspace $workspace
@param $name
@param ResourceNode $parent
@return ResourceNode | [
"Search",
"a",
"ResourceNode",
"wich",
"is",
"persisted",
"but",
"not",
"flushed",
"yet"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ResourceManager.php#L1696-L1713 |
222,138 | claroline/CoreBundle | Manager/ResourceManager.php | ResourceManager.getDefaultUploadDestinations | public function getDefaultUploadDestinations()
{
$user = $this->container->get('security.token_storage')->getToken()->getUser();
if ($user == 'anon.') return array();
$pws = $user->getPersonalWorkspace();
$defaults = [];
if ($pws) {
$defaults = array_merge(
... | php | public function getDefaultUploadDestinations()
{
$user = $this->container->get('security.token_storage')->getToken()->getUser();
if ($user == 'anon.') return array();
$pws = $user->getPersonalWorkspace();
$defaults = [];
if ($pws) {
$defaults = array_merge(
... | [
"public",
"function",
"getDefaultUploadDestinations",
"(",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'security.token_storage'",
")",
"->",
"getToken",
"(",
")",
"->",
"getUser",
"(",
")",
";",
"if",
"(",
"$",
"user",
... | Returns the list of file upload destination choices
@return array | [
"Returns",
"the",
"list",
"of",
"file",
"upload",
"destination",
"choices"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/ResourceManager.php#L1749-L1775 |
222,139 | claroline/CoreBundle | Entity/Resource/ResourceNode.php | ResourceNode.setName | public function setName($name)
{
if (strpos(self::PATH_SEPARATOR, $name) !== false) {
throw new \InvalidArgumentException(
'Invalid character "' . self::PATH_SEPARATOR . '" in resource name.'
);
}
$this->name = $name;
} | php | public function setName($name)
{
if (strpos(self::PATH_SEPARATOR, $name) !== false) {
throw new \InvalidArgumentException(
'Invalid character "' . self::PATH_SEPARATOR . '" in resource name.'
);
}
$this->name = $name;
} | [
"public",
"function",
"setName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"strpos",
"(",
"self",
"::",
"PATH_SEPARATOR",
",",
"$",
"name",
")",
"!==",
"false",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Invalid character \"'",
".",
"s... | Sets the resource name.
@param string $name
@throws an exception if the name contains the path separator ('/'). | [
"Sets",
"the",
"resource",
"name",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Entity/Resource/ResourceNode.php#L437-L446 |
222,140 | vihuvac/recaptcha-bundle | src/Validator/Constraints/IsTrueValidator.php | IsTrueValidator.checkAnswer | private function checkAnswer($secretKey, $remoteip, $response)
{
if ($remoteip == null || $remoteip == "") {
throw new ValidatorException("vihuvac_recaptcha.validator.remote_ip");
}
// discard spam submissions
if ($response == null || strlen($response) == 0) {
... | php | private function checkAnswer($secretKey, $remoteip, $response)
{
if ($remoteip == null || $remoteip == "") {
throw new ValidatorException("vihuvac_recaptcha.validator.remote_ip");
}
// discard spam submissions
if ($response == null || strlen($response) == 0) {
... | [
"private",
"function",
"checkAnswer",
"(",
"$",
"secretKey",
",",
"$",
"remoteip",
",",
"$",
"response",
")",
"{",
"if",
"(",
"$",
"remoteip",
"==",
"null",
"||",
"$",
"remoteip",
"==",
"\"\"",
")",
"{",
"throw",
"new",
"ValidatorException",
"(",
"\"vihu... | Calls an HTTP POST function to verify if the user's guess was correct.
@param String $secretKey
@param String $remoteip
@param String $response
@throws ValidatorException When missing remote ip
@return Boolean | [
"Calls",
"an",
"HTTP",
"POST",
"function",
"to",
"verify",
"if",
"the",
"user",
"s",
"guess",
"was",
"correct",
"."
] | a9b796c6bcc53b106a5ba206c1d7b6b25472f1e6 | https://github.com/vihuvac/recaptcha-bundle/blob/a9b796c6bcc53b106a5ba206c1d7b6b25472f1e6/src/Validator/Constraints/IsTrueValidator.php#L115-L134 |
222,141 | vihuvac/recaptcha-bundle | src/Validator/Constraints/IsTrueValidator.php | IsTrueValidator.httpGet | private function httpGet($host, $path, $data)
{
$host = sprintf("%s%s?%s", $host, $path, http_build_query($data, null, "&"));
$context = $this->getResourceContext();
return file_get_contents($host, false, $context);
} | php | private function httpGet($host, $path, $data)
{
$host = sprintf("%s%s?%s", $host, $path, http_build_query($data, null, "&"));
$context = $this->getResourceContext();
return file_get_contents($host, false, $context);
} | [
"private",
"function",
"httpGet",
"(",
"$",
"host",
",",
"$",
"path",
",",
"$",
"data",
")",
"{",
"$",
"host",
"=",
"sprintf",
"(",
"\"%s%s?%s\"",
",",
"$",
"host",
",",
"$",
"path",
",",
"http_build_query",
"(",
"$",
"data",
",",
"null",
",",
"\"&... | Submits an HTTP POST to a reCAPTCHA server.
@param String $host
@param String $path
@param Array $data
@return Array response | [
"Submits",
"an",
"HTTP",
"POST",
"to",
"a",
"reCAPTCHA",
"server",
"."
] | a9b796c6bcc53b106a5ba206c1d7b6b25472f1e6 | https://github.com/vihuvac/recaptcha-bundle/blob/a9b796c6bcc53b106a5ba206c1d7b6b25472f1e6/src/Validator/Constraints/IsTrueValidator.php#L145-L152 |
222,142 | vihuvac/recaptcha-bundle | src/Validator/Constraints/IsTrueValidator.php | IsTrueValidator.getResourceContext | private function getResourceContext()
{
if (null === $this->httpProxy["host"] || null === $this->httpProxy["port"]) {
return null;
}
$options = array();
foreach (array("http", "https") as $protocol) {
$options[$protocol] = array(
"method" ... | php | private function getResourceContext()
{
if (null === $this->httpProxy["host"] || null === $this->httpProxy["port"]) {
return null;
}
$options = array();
foreach (array("http", "https") as $protocol) {
$options[$protocol] = array(
"method" ... | [
"private",
"function",
"getResourceContext",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"httpProxy",
"[",
"\"host\"",
"]",
"||",
"null",
"===",
"$",
"this",
"->",
"httpProxy",
"[",
"\"port\"",
"]",
")",
"{",
"return",
"null",
";",
"}",... | Resource context.
@return resource context for HTTP Proxy. | [
"Resource",
"context",
"."
] | a9b796c6bcc53b106a5ba206c1d7b6b25472f1e6 | https://github.com/vihuvac/recaptcha-bundle/blob/a9b796c6bcc53b106a5ba206c1d7b6b25472f1e6/src/Validator/Constraints/IsTrueValidator.php#L159-L179 |
222,143 | claroline/CoreBundle | Library/Utilities/ThumbnailCreator.php | ThumbnailCreator.resize | private function resize($newWidth, $newHeight, $srcImg, $filename)
{
$oldX = imagesx($srcImg);
$oldY = imagesy($srcImg);
if ($oldX > $oldY) {
$thumbWidth = $newWidth;
$thumbHeight = $oldY * ($newHeight / $oldX);
} else {
if ($oldX <= $oldY) {
... | php | private function resize($newWidth, $newHeight, $srcImg, $filename)
{
$oldX = imagesx($srcImg);
$oldY = imagesy($srcImg);
if ($oldX > $oldY) {
$thumbWidth = $newWidth;
$thumbHeight = $oldY * ($newHeight / $oldX);
} else {
if ($oldX <= $oldY) {
... | [
"private",
"function",
"resize",
"(",
"$",
"newWidth",
",",
"$",
"newHeight",
",",
"$",
"srcImg",
",",
"$",
"filename",
")",
"{",
"$",
"oldX",
"=",
"imagesx",
"(",
"$",
"srcImg",
")",
";",
"$",
"oldY",
"=",
"imagesy",
"(",
"$",
"srcImg",
")",
";",
... | Create a copy of a resized image according to the parameters.
@param string $newWidth the new width
@param string $newHeight the new heigth
@param string $srcImg the path of the source
@param string $filename the path of the copy | [
"Create",
"a",
"copy",
"of",
"a",
"resized",
"image",
"according",
"to",
"the",
"parameters",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Library/Utilities/ThumbnailCreator.php#L137-L163 |
222,144 | claroline/CoreBundle | Manager/UserManager.php | UserManager.rename | public function rename(User $user, $username)
{
$userRole = $this->roleManager->getUserRoleByUser($user);
if ($userRole) $this->roleManager->renameUserRole($userRole, $user->getUsername());
$user->setUsername($username);
$personalWorkspaceName = $this->translator->trans('personal_wor... | php | public function rename(User $user, $username)
{
$userRole = $this->roleManager->getUserRoleByUser($user);
if ($userRole) $this->roleManager->renameUserRole($userRole, $user->getUsername());
$user->setUsername($username);
$personalWorkspaceName = $this->translator->trans('personal_wor... | [
"public",
"function",
"rename",
"(",
"User",
"$",
"user",
",",
"$",
"username",
")",
"{",
"$",
"userRole",
"=",
"$",
"this",
"->",
"roleManager",
"->",
"getUserRoleByUser",
"(",
"$",
"user",
")",
";",
"if",
"(",
"$",
"userRole",
")",
"$",
"this",
"->... | Rename a user.
@param User $user
@param $username | [
"Rename",
"a",
"user",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/UserManager.php#L249-L259 |
222,145 | claroline/CoreBundle | Manager/UserManager.php | UserManager.deleteUser | public function deleteUser(User $user)
{
/* When the api will identify a user, please uncomment this
if ($this->container->get('security.token_storage')->getToken()->getUser()->getId() === $user->getId()) {
throw new \Exception('A user cannot delete himself');
}*/
$userR... | php | public function deleteUser(User $user)
{
/* When the api will identify a user, please uncomment this
if ($this->container->get('security.token_storage')->getToken()->getUser()->getId() === $user->getId()) {
throw new \Exception('A user cannot delete himself');
}*/
$userR... | [
"public",
"function",
"deleteUser",
"(",
"User",
"$",
"user",
")",
"{",
"/* When the api will identify a user, please uncomment this\n if ($this->container->get('security.token_storage')->getToken()->getUser()->getId() === $user->getId()) {\n throw new \\Exception('A user cannot ... | Removes a user.
@param \Claroline\CoreBundle\Entity\User $user | [
"Removes",
"a",
"user",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/UserManager.php#L273-L312 |
222,146 | claroline/CoreBundle | Manager/UserManager.php | UserManager.convertUsersToArray | public function convertUsersToArray(array $users)
{
$content = array();
$i = 0;
foreach ($users as $user) {
$content[$i]['id'] = $user->getId();
$content[$i]['username'] = $user->getUsername();
$content[$i]['lastname'] = $user->getLastName();
... | php | public function convertUsersToArray(array $users)
{
$content = array();
$i = 0;
foreach ($users as $user) {
$content[$i]['id'] = $user->getId();
$content[$i]['username'] = $user->getUsername();
$content[$i]['lastname'] = $user->getLastName();
... | [
"public",
"function",
"convertUsersToArray",
"(",
"array",
"$",
"users",
")",
"{",
"$",
"content",
"=",
"array",
"(",
")",
";",
"$",
"i",
"=",
"0",
";",
"foreach",
"(",
"$",
"users",
"as",
"$",
"user",
")",
"{",
"$",
"content",
"[",
"$",
"i",
"]"... | Serialize a user. Use JMS serializer from entities instead
@param array $users
@return array
@deprecated | [
"Serialize",
"a",
"user",
".",
"Use",
"JMS",
"serializer",
"from",
"entities",
"instead"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/UserManager.php#L508-L538 |
222,147 | claroline/CoreBundle | Manager/UserManager.php | UserManager.logUser | public function logUser(User $user)
{
$this->strictEventDispatcher->dispatch('log', 'Log\LogUserLogin', array($user));
$token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());
$this->container->get('security.token_storage')->setToken($token);
} | php | public function logUser(User $user)
{
$this->strictEventDispatcher->dispatch('log', 'Log\LogUserLogin', array($user));
$token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());
$this->container->get('security.token_storage')->setToken($token);
} | [
"public",
"function",
"logUser",
"(",
"User",
"$",
"user",
")",
"{",
"$",
"this",
"->",
"strictEventDispatcher",
"->",
"dispatch",
"(",
"'log'",
",",
"'Log\\LogUserLogin'",
",",
"array",
"(",
"$",
"user",
")",
")",
";",
"$",
"token",
"=",
"new",
"Usernam... | Logs the current user | [
"Logs",
"the",
"current",
"user"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/UserManager.php#L1264-L1269 |
222,148 | claroline/CoreBundle | Controller/ResourceRightsController.php | ResourceRightsController.openPermsAction | public function openPermsAction(ResourceNode $node)
{
$collection = new ResourceCollection(array($node));
$this->checkAccess('ADMINISTRATE', $collection);
$this->rightsManager->editPerms(1, $this->roleManager->getRoleByName('ROLE_USER'), $node, false);
$this->rightsManager->editPerms... | php | public function openPermsAction(ResourceNode $node)
{
$collection = new ResourceCollection(array($node));
$this->checkAccess('ADMINISTRATE', $collection);
$this->rightsManager->editPerms(1, $this->roleManager->getRoleByName('ROLE_USER'), $node, false);
$this->rightsManager->editPerms... | [
"public",
"function",
"openPermsAction",
"(",
"ResourceNode",
"$",
"node",
")",
"{",
"$",
"collection",
"=",
"new",
"ResourceCollection",
"(",
"array",
"(",
"$",
"node",
")",
")",
";",
"$",
"this",
"->",
"checkAccess",
"(",
"'ADMINISTRATE'",
",",
"$",
"col... | Use only when create a new resource
@EXT\Route(
"/perms/open/{node}",
name="claro_resource_open_perms",
options={"expose"=true}
) | [
"Use",
"only",
"when",
"create",
"a",
"new",
"resource"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Controller/ResourceRightsController.php#L189-L197 |
222,149 | claroline/CoreBundle | Manager/LocaleManager.php | LocaleManager.setUserLocale | public function setUserLocale($locale)
{
$locales = $this->getAvailableLocales();
$this->userManager->setLocale($this->getCurrentUser(), $locale);
} | php | public function setUserLocale($locale)
{
$locales = $this->getAvailableLocales();
$this->userManager->setLocale($this->getCurrentUser(), $locale);
} | [
"public",
"function",
"setUserLocale",
"(",
"$",
"locale",
")",
"{",
"$",
"locales",
"=",
"$",
"this",
"->",
"getAvailableLocales",
"(",
")",
";",
"$",
"this",
"->",
"userManager",
"->",
"setLocale",
"(",
"$",
"this",
"->",
"getCurrentUser",
"(",
")",
",... | Set locale setting for current user if this locale is present in the platform
@param string $locale The locale string as en, fr, es, etc. | [
"Set",
"locale",
"setting",
"for",
"current",
"user",
"if",
"this",
"locale",
"is",
"present",
"in",
"the",
"platform"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/LocaleManager.php#L113-L117 |
222,150 | claroline/CoreBundle | Manager/LocaleManager.php | LocaleManager.getUserLocale | public function getUserLocale(Request $request)
{
$locales = $this->getAvailableLocales();
$preferred = explode('_', $request->getPreferredLanguage());
if ($request->attributes->get('_locale')) {
$locale = $request->attributes->get('_locale');
} elseif (($user = $this->g... | php | public function getUserLocale(Request $request)
{
$locales = $this->getAvailableLocales();
$preferred = explode('_', $request->getPreferredLanguage());
if ($request->attributes->get('_locale')) {
$locale = $request->attributes->get('_locale');
} elseif (($user = $this->g... | [
"public",
"function",
"getUserLocale",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"locales",
"=",
"$",
"this",
"->",
"getAvailableLocales",
"(",
")",
";",
"$",
"preferred",
"=",
"explode",
"(",
"'_'",
",",
"$",
"request",
"->",
"getPreferredLanguage",
... | This method returns the user locale and store it in session, if there is no user this method return default
language or the browser language if it is present in translations.
@param \Symfony\Component\HttpFoundation\Request $request
@return string The locale string as en, fr, es, etc. | [
"This",
"method",
"returns",
"the",
"user",
"locale",
"and",
"store",
"it",
"in",
"session",
"if",
"there",
"is",
"no",
"user",
"this",
"method",
"return",
"default",
"language",
"or",
"the",
"browser",
"language",
"if",
"it",
"is",
"present",
"in",
"trans... | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/LocaleManager.php#L126-L148 |
222,151 | claroline/CoreBundle | Listener/ToolListener.php | ToolListener.workspaceParameters | public function workspaceParameters($workspaceId)
{
$workspace = $this->workspaceManager->getWorkspaceById($workspaceId);
$tools = $this->toolManager->getToolByCriterias(
array('isConfigurableInWorkspace' => true, 'isDisplayableInWorkspace' => true)
);
$canOpenResRights ... | php | public function workspaceParameters($workspaceId)
{
$workspace = $this->workspaceManager->getWorkspaceById($workspaceId);
$tools = $this->toolManager->getToolByCriterias(
array('isConfigurableInWorkspace' => true, 'isDisplayableInWorkspace' => true)
);
$canOpenResRights ... | [
"public",
"function",
"workspaceParameters",
"(",
"$",
"workspaceId",
")",
"{",
"$",
"workspace",
"=",
"$",
"this",
"->",
"workspaceManager",
"->",
"getWorkspaceById",
"(",
"$",
"workspaceId",
")",
";",
"$",
"tools",
"=",
"$",
"this",
"->",
"toolManager",
"-... | Renders the workspace properties page.
@param integer $workspaceId
@return string | [
"Renders",
"the",
"workspace",
"properties",
"page",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Listener/ToolListener.php#L132-L151 |
222,152 | claroline/CoreBundle | Listener/ToolListener.php | ToolListener.desktopParameters | public function desktopParameters()
{
$desktopTools = $this->toolManager->getToolByCriterias(
array('isConfigurableInDesktop' => true, 'isDisplayableInDesktop' => true)
);
$tools = array();
foreach ($desktopTools as $desktopTool) {
$toolName = $desktopTool->g... | php | public function desktopParameters()
{
$desktopTools = $this->toolManager->getToolByCriterias(
array('isConfigurableInDesktop' => true, 'isDisplayableInDesktop' => true)
);
$tools = array();
foreach ($desktopTools as $desktopTool) {
$toolName = $desktopTool->g... | [
"public",
"function",
"desktopParameters",
"(",
")",
"{",
"$",
"desktopTools",
"=",
"$",
"this",
"->",
"toolManager",
"->",
"getToolByCriterias",
"(",
"array",
"(",
"'isConfigurableInDesktop'",
"=>",
"true",
",",
"'isDisplayableInDesktop'",
"=>",
"true",
")",
")",... | Displays the Info desktop tab.
@return \Symfony\Component\HttpFoundation\Response | [
"Displays",
"the",
"Info",
"desktop",
"tab",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Listener/ToolListener.php#L158-L191 |
222,153 | TransitScreen/php-heroku-client | src/Client.php | Client.execute | protected function execute($method, $path, $body = null, array $customHeaders = [])
{
// Clear state from the last call.
$this->lastHttpRequest = null;
$this->lastHttpResponse = null;
// Build the request.
$request = $this->buildRequest($method, $path, $body, $customHeaders)... | php | protected function execute($method, $path, $body = null, array $customHeaders = [])
{
// Clear state from the last call.
$this->lastHttpRequest = null;
$this->lastHttpResponse = null;
// Build the request.
$request = $this->buildRequest($method, $path, $body, $customHeaders)... | [
"protected",
"function",
"execute",
"(",
"$",
"method",
",",
"$",
"path",
",",
"$",
"body",
"=",
"null",
",",
"array",
"$",
"customHeaders",
"=",
"[",
"]",
")",
"{",
"// Clear state from the last call.",
"$",
"this",
"->",
"lastHttpRequest",
"=",
"null",
"... | Execute a call against the Heroku Platform API.
@param string $method The HTTP method: DELETE|GET|HEAD|PATCH|POST
@param string $path The API endpoint path
@param array|object $body Optional array or object to be sent in the request body as JSON
@param array $customHeaders Optional array of headers... | [
"Execute",
"a",
"call",
"against",
"the",
"Heroku",
"Platform",
"API",
"."
] | 49121e2351ded5b9ae00337cbdc865857d269aa5 | https://github.com/TransitScreen/php-heroku-client/blob/49121e2351ded5b9ae00337cbdc865857d269aa5/src/Client.php#L157-L178 |
222,154 | TransitScreen/php-heroku-client | src/Client.php | Client.buildRequest | protected function buildRequest($method, $path, $body = null, array $customHeaders = [])
{
$headers = [];
// If a body was included, add it to the request.
if (isset($body)) {
$headers['Content-Type'] = 'application/json';
$body = json_encode($body);
// C... | php | protected function buildRequest($method, $path, $body = null, array $customHeaders = [])
{
$headers = [];
// If a body was included, add it to the request.
if (isset($body)) {
$headers['Content-Type'] = 'application/json';
$body = json_encode($body);
// C... | [
"protected",
"function",
"buildRequest",
"(",
"$",
"method",
",",
"$",
"path",
",",
"$",
"body",
"=",
"null",
",",
"array",
"$",
"customHeaders",
"=",
"[",
"]",
")",
"{",
"$",
"headers",
"=",
"[",
"]",
";",
"// If a body was included, add it to the request."... | Build an API request.
@see Client::execute() For parameter definitions
@return RequestInterface PSR-7 Request object representing the desired interaction
@throws JsonEncodingException | [
"Build",
"an",
"API",
"request",
"."
] | 49121e2351ded5b9ae00337cbdc865857d269aa5 | https://github.com/TransitScreen/php-heroku-client/blob/49121e2351ded5b9ae00337cbdc865857d269aa5/src/Client.php#L188-L212 |
222,155 | TransitScreen/php-heroku-client | src/Client.php | Client.processResponse | protected function processResponse(ResponseInterface $httpResponse)
{
// Attempt to build the API response from the HTTP response body.
$apiResponse = json_decode($httpResponse->getBody()->getContents());
$httpResponse->getBody()->rewind(); // Rewind the stream to make future access easier.
... | php | protected function processResponse(ResponseInterface $httpResponse)
{
// Attempt to build the API response from the HTTP response body.
$apiResponse = json_decode($httpResponse->getBody()->getContents());
$httpResponse->getBody()->rewind(); // Rewind the stream to make future access easier.
... | [
"protected",
"function",
"processResponse",
"(",
"ResponseInterface",
"$",
"httpResponse",
")",
"{",
"// Attempt to build the API response from the HTTP response body.",
"$",
"apiResponse",
"=",
"json_decode",
"(",
"$",
"httpResponse",
"->",
"getBody",
"(",
")",
"->",
"ge... | Build the final return object from the raw HTTP response.
@see https://devcenter.heroku.com/articles/platform-api-reference#statuses
@see https://devcenter.heroku.com/articles/platform-api-reference#errors
@param ResponseInterface $httpResponse Heroku API response as a PSR-7 Response object
@return \stdClass ... | [
"Build",
"the",
"final",
"return",
"object",
"from",
"the",
"raw",
"HTTP",
"response",
"."
] | 49121e2351ded5b9ae00337cbdc865857d269aa5 | https://github.com/TransitScreen/php-heroku-client/blob/49121e2351ded5b9ae00337cbdc865857d269aa5/src/Client.php#L226-L252 |
222,156 | claroline/CoreBundle | Library/Security/Voter/UserVoter.php | UserVoter.isOrganizationManager | private function isOrganizationManager(TokenInterface $token, User $user)
{
$adminOrganizations = $token->getUser()->getAdministratedOrganizations();
$userOrganizations = $user->getOrganizations();
foreach ($adminOrganizations as $adminOrganization) {
foreach ($userOrganizations... | php | private function isOrganizationManager(TokenInterface $token, User $user)
{
$adminOrganizations = $token->getUser()->getAdministratedOrganizations();
$userOrganizations = $user->getOrganizations();
foreach ($adminOrganizations as $adminOrganization) {
foreach ($userOrganizations... | [
"private",
"function",
"isOrganizationManager",
"(",
"TokenInterface",
"$",
"token",
",",
"User",
"$",
"user",
")",
"{",
"$",
"adminOrganizations",
"=",
"$",
"token",
"->",
"getUser",
"(",
")",
"->",
"getAdministratedOrganizations",
"(",
")",
";",
"$",
"userOr... | I should find a way to speed that up | [
"I",
"should",
"find",
"a",
"way",
"to",
"speed",
"that",
"up"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Library/Security/Voter/UserVoter.php#L111-L123 |
222,157 | claroline/CoreBundle | DataFixtures/Required/Data/LoadWidgetData.php | LoadWidgetData.load | public function load(ObjectManager $manager)
{
$roles = $manager->getRepository('ClarolineCoreBundle:Role')
->findAllPlatformRoles();
//name, isConfigurable, isDisplayableInDesktop, isDisplayableInWorkspace
$items = array(
array('core_resource_logger', true, true, tr... | php | public function load(ObjectManager $manager)
{
$roles = $manager->getRepository('ClarolineCoreBundle:Role')
->findAllPlatformRoles();
//name, isConfigurable, isDisplayableInDesktop, isDisplayableInWorkspace
$items = array(
array('core_resource_logger', true, true, tr... | [
"public",
"function",
"load",
"(",
"ObjectManager",
"$",
"manager",
")",
"{",
"$",
"roles",
"=",
"$",
"manager",
"->",
"getRepository",
"(",
"'ClarolineCoreBundle:Role'",
")",
"->",
"findAllPlatformRoles",
"(",
")",
";",
"//name, isConfigurable, isDisplayableInDesktop... | Loads the core widgets.
@param ObjectManager $manager | [
"Loads",
"the",
"core",
"widgets",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/DataFixtures/Required/Data/LoadWidgetData.php#L28-L55 |
222,158 | claroline/CoreBundle | Manager/AuthenticationManager.php | AuthenticationManager.getDrivers | public function getDrivers()
{
$drivers = array();
$files = $this->finder->files()->in($this->driverPath)->name($this->fileTypes);
foreach ($files as $file) {
$driver = str_replace('.yml', '', $file->getRelativePathname());
$service = $this->getService($driver);
... | php | public function getDrivers()
{
$drivers = array();
$files = $this->finder->files()->in($this->driverPath)->name($this->fileTypes);
foreach ($files as $file) {
$driver = str_replace('.yml', '', $file->getRelativePathname());
$service = $this->getService($driver);
... | [
"public",
"function",
"getDrivers",
"(",
")",
"{",
"$",
"drivers",
"=",
"array",
"(",
")",
";",
"$",
"files",
"=",
"$",
"this",
"->",
"finder",
"->",
"files",
"(",
")",
"->",
"in",
"(",
"$",
"this",
"->",
"driverPath",
")",
"->",
"name",
"(",
"$"... | Get authentication drivers | [
"Get",
"authentication",
"drivers"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/AuthenticationManager.php#L45-L63 |
222,159 | claroline/CoreBundle | Manager/AuthenticationManager.php | AuthenticationManager.getService | public function getService($driver)
{
if ($driver = explode(':', $driver) and
isset($driver[0]) and
$driver = explode('.', $driver[0]) and
isset($driver[1])
) {
return $this->container->get($driver[0] . '.' . $driver[1] . '_bundle.manager.' . $driver[1... | php | public function getService($driver)
{
if ($driver = explode(':', $driver) and
isset($driver[0]) and
$driver = explode('.', $driver[0]) and
isset($driver[1])
) {
return $this->container->get($driver[0] . '.' . $driver[1] . '_bundle.manager.' . $driver[1... | [
"public",
"function",
"getService",
"(",
"$",
"driver",
")",
"{",
"if",
"(",
"$",
"driver",
"=",
"explode",
"(",
"':'",
",",
"$",
"driver",
")",
"and",
"isset",
"(",
"$",
"driver",
"[",
"0",
"]",
")",
"and",
"$",
"driver",
"=",
"explode",
"(",
"'... | Return authentication driver manager
@param $driver The name of the driver including the server, example: claroline.ldap:server1 | [
"Return",
"authentication",
"driver",
"manager"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/AuthenticationManager.php#L91-L100 |
222,160 | claroline/CoreBundle | Entity/AbstractRoleSubject.php | AbstractRoleSubject.getRoles | public function getRoles()
{
if (count($this->rolesStringAsArray) > 0) {
return $this->rolesStringAsArray;
}
$roleNames = array();
foreach ($this->getEntityRoles(true) as $role) {
$roleNames[] = $role->getName();
}
return $roleNames;
} | php | public function getRoles()
{
if (count($this->rolesStringAsArray) > 0) {
return $this->rolesStringAsArray;
}
$roleNames = array();
foreach ($this->getEntityRoles(true) as $role) {
$roleNames[] = $role->getName();
}
return $roleNames;
} | [
"public",
"function",
"getRoles",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"rolesStringAsArray",
")",
">",
"0",
")",
"{",
"return",
"$",
"this",
"->",
"rolesStringAsArray",
";",
"}",
"$",
"roleNames",
"=",
"array",
"(",
")",
";",
"f... | Returns the subject roles as an array of sting values | [
"Returns",
"the",
"subject",
"roles",
"as",
"an",
"array",
"of",
"sting",
"values"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Entity/AbstractRoleSubject.php#L80-L93 |
222,161 | claroline/CoreBundle | Controller/AuthenticationController.php | AuthenticationController.renderExternalAuthenticatonButtonAction | public function renderExternalAuthenticatonButtonAction()
{
$event = $this->dispatcher->dispatch('render_external_authentication_button', 'RenderAuthenticationButton');
$eventContent = $event->getContent();
if (!empty($eventContent)) {
$eventContent = '<div class="external_authe... | php | public function renderExternalAuthenticatonButtonAction()
{
$event = $this->dispatcher->dispatch('render_external_authentication_button', 'RenderAuthenticationButton');
$eventContent = $event->getContent();
if (!empty($eventContent)) {
$eventContent = '<div class="external_authe... | [
"public",
"function",
"renderExternalAuthenticatonButtonAction",
"(",
")",
"{",
"$",
"event",
"=",
"$",
"this",
"->",
"dispatcher",
"->",
"dispatch",
"(",
"'render_external_authentication_button'",
",",
"'RenderAuthenticationButton'",
")",
";",
"$",
"eventContent",
"=",... | not routed... | [
"not",
"routed",
"..."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Controller/AuthenticationController.php#L370-L380 |
222,162 | claroline/CoreBundle | Controller/WorkspaceController.php | WorkspaceController.createAction | public function createAction()
{
$this->assertIsGranted('ROLE_WS_CREATOR');
$user = $this->tokenStorage->getToken()->getUser();
$form = $this->formFactory->create(FormFactory::TYPE_WORKSPACE, array($user));
$form->handleRequest($this->request);
$ds = DIRECTORY_SEPARATOR;
... | php | public function createAction()
{
$this->assertIsGranted('ROLE_WS_CREATOR');
$user = $this->tokenStorage->getToken()->getUser();
$form = $this->formFactory->create(FormFactory::TYPE_WORKSPACE, array($user));
$form->handleRequest($this->request);
$ds = DIRECTORY_SEPARATOR;
... | [
"public",
"function",
"createAction",
"(",
")",
"{",
"$",
"this",
"->",
"assertIsGranted",
"(",
"'ROLE_WS_CREATOR'",
")",
";",
"$",
"user",
"=",
"$",
"this",
"->",
"tokenStorage",
"->",
"getToken",
"(",
")",
"->",
"getUser",
"(",
")",
";",
"$",
"form",
... | Creates a workspace from a form sent by POST.
@EXT\Route(
"/",
name="claro_workspace_create"
)
@EXT\Method("POST")
@EXT\Template("ClarolineCoreBundle:Workspace:creationForm.html.twig")
@return RedirectResponse | array | [
"Creates",
"a",
"workspace",
"from",
"a",
"form",
"sent",
"by",
"POST",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Controller/WorkspaceController.php#L345-L390 |
222,163 | claroline/CoreBundle | Library/Transfert/RichTextFormatter.php | RichTextFormatter.setPlaceHolders | public function setPlaceHolders(array $files, &$_data)
{
$formattedFiles = [];
foreach ($files as $key => $file) {
$ext = pathinfo($file, PATHINFO_EXTENSION);
$newFile = $file;
if ($ext === 'txt') {
$text = $this->setPlaceHolder($file, $_data, $f... | php | public function setPlaceHolders(array $files, &$_data)
{
$formattedFiles = [];
foreach ($files as $key => $file) {
$ext = pathinfo($file, PATHINFO_EXTENSION);
$newFile = $file;
if ($ext === 'txt') {
$text = $this->setPlaceHolder($file, $_data, $f... | [
"public",
"function",
"setPlaceHolders",
"(",
"array",
"$",
"files",
",",
"&",
"$",
"_data",
")",
"{",
"$",
"formattedFiles",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"key",
"=>",
"$",
"file",
")",
"{",
"$",
"ext",
"=",
"pathinf... | For now we only look parse .txt. in the archive.
It's way easier that way.
@param $_data
@param $files
@return array | [
"For",
"now",
"we",
"only",
"look",
"parse",
".",
"txt",
".",
"in",
"the",
"archive",
".",
"It",
"s",
"way",
"easier",
"that",
"way",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Library/Transfert/RichTextFormatter.php#L128-L146 |
222,164 | claroline/CoreBundle | Library/Transfert/RichTextFormatter.php | RichTextFormatter.setPlaceHolder | private function setPlaceHolder($file, &$_data, &$_files)
{
//urls to be matched...
//'/file/resource/media/([^']+)#'
//'/resource/open/([^/]+)/([^']+)'
$text = file_get_contents($file);
$baseUrl = $this->router->getContext()->getBaseUrl();
//first regex
$reg... | php | private function setPlaceHolder($file, &$_data, &$_files)
{
//urls to be matched...
//'/file/resource/media/([^']+)#'
//'/resource/open/([^/]+)/([^']+)'
$text = file_get_contents($file);
$baseUrl = $this->router->getContext()->getBaseUrl();
//first regex
$reg... | [
"private",
"function",
"setPlaceHolder",
"(",
"$",
"file",
",",
"&",
"$",
"_data",
",",
"&",
"$",
"_files",
")",
"{",
"//urls to be matched...",
"//'/file/resource/media/([^']+)#'",
"//'/resource/open/([^/]+)/([^']+)'",
"$",
"text",
"=",
"file_get_contents",
"(",
"$",... | If we find an resource id wich is a file and not in the export yet, then we
export is aswell. It's a link towards "something else". | [
"If",
"we",
"find",
"an",
"resource",
"id",
"wich",
"is",
"a",
"file",
"and",
"not",
"in",
"the",
"export",
"yet",
"then",
"we",
"export",
"is",
"aswell",
".",
"It",
"s",
"a",
"link",
"towards",
"something",
"else",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Library/Transfert/RichTextFormatter.php#L152-L207 |
222,165 | claroline/CoreBundle | Manager/GroupManager.php | GroupManager.removeAllUsersFromGroup | public function removeAllUsersFromGroup(Group $group)
{
$users = $group->getUsers();
foreach ($users as $user) {
$group->removeUser($user);
}
$this->om->persist($group);
$this->om->flush();
} | php | public function removeAllUsersFromGroup(Group $group)
{
$users = $group->getUsers();
foreach ($users as $user) {
$group->removeUser($user);
}
$this->om->persist($group);
$this->om->flush();
} | [
"public",
"function",
"removeAllUsersFromGroup",
"(",
"Group",
"$",
"group",
")",
"{",
"$",
"users",
"=",
"$",
"group",
"->",
"getUsers",
"(",
")",
";",
"foreach",
"(",
"$",
"users",
"as",
"$",
"user",
")",
"{",
"$",
"group",
"->",
"removeUser",
"(",
... | Removes all users from a group.
@param \Claroline\CoreBundle\Entity\Group $group | [
"Removes",
"all",
"users",
"from",
"a",
"group",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/GroupManager.php#L167-L177 |
222,166 | claroline/CoreBundle | Manager/GroupManager.php | GroupManager.removeUsersFromGroup | public function removeUsersFromGroup(Group $group, array $users)
{
foreach ($users as $user) {
$group->removeUser($user);
$this->eventDispatcher->dispatch('log', 'Log\LogGroupRemoveUser', array($group, $user));
}
$this->om->persist($group);
$this->om->flush()... | php | public function removeUsersFromGroup(Group $group, array $users)
{
foreach ($users as $user) {
$group->removeUser($user);
$this->eventDispatcher->dispatch('log', 'Log\LogGroupRemoveUser', array($group, $user));
}
$this->om->persist($group);
$this->om->flush()... | [
"public",
"function",
"removeUsersFromGroup",
"(",
"Group",
"$",
"group",
",",
"array",
"$",
"users",
")",
"{",
"foreach",
"(",
"$",
"users",
"as",
"$",
"user",
")",
"{",
"$",
"group",
"->",
"removeUser",
"(",
"$",
"user",
")",
";",
"$",
"this",
"->"... | Removes an array of user from a group.
@param \Claroline\CoreBundle\Entity\Group $group
@param User[] $users | [
"Removes",
"an",
"array",
"of",
"user",
"from",
"a",
"group",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/GroupManager.php#L185-L194 |
222,167 | claroline/CoreBundle | Manager/GroupManager.php | GroupManager.convertGroupsToArray | public function convertGroupsToArray(array $groups)
{
$content = array();
$i = 0;
foreach ($groups as $group) {
$content[$i]['id'] = $group->getId();
$content[$i]['name'] = $group->getName();
$rolesString = '';
$roles = $group->getEntityRoles()... | php | public function convertGroupsToArray(array $groups)
{
$content = array();
$i = 0;
foreach ($groups as $group) {
$content[$i]['id'] = $group->getId();
$content[$i]['name'] = $group->getName();
$rolesString = '';
$roles = $group->getEntityRoles()... | [
"public",
"function",
"convertGroupsToArray",
"(",
"array",
"$",
"groups",
")",
"{",
"$",
"content",
"=",
"array",
"(",
")",
";",
"$",
"i",
"=",
"0",
";",
"foreach",
"(",
"$",
"groups",
"as",
"$",
"group",
")",
"{",
"$",
"content",
"[",
"$",
"i",
... | Serialize a group array.
@param Group[] $groups
@return array | [
"Serialize",
"a",
"group",
"array",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/GroupManager.php#L507-L529 |
222,168 | claroline/CoreBundle | Manager/TransfertManager.php | TransfertManager.validate | public function validate(array $data, $validateProperties = true)
{
$groupsImporter = $this->getImporterByName('groups');
$rolesImporter = $this->getImporterByName('roles');
$toolsImporter = $this->getImporterByName('tools');
$importer = $this->getImporterByName('workspace_pr... | php | public function validate(array $data, $validateProperties = true)
{
$groupsImporter = $this->getImporterByName('groups');
$rolesImporter = $this->getImporterByName('roles');
$toolsImporter = $this->getImporterByName('tools');
$importer = $this->getImporterByName('workspace_pr... | [
"public",
"function",
"validate",
"(",
"array",
"$",
"data",
",",
"$",
"validateProperties",
"=",
"true",
")",
"{",
"$",
"groupsImporter",
"=",
"$",
"this",
"->",
"getImporterByName",
"(",
"'groups'",
")",
";",
"$",
"rolesImporter",
"=",
"$",
"this",
"->",... | Import a workspace | [
"Import",
"a",
"workspace"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/TransfertManager.php#L71-L97 |
222,169 | claroline/CoreBundle | Manager/TransfertManager.php | TransfertManager.populateWorkspace | public function populateWorkspace(
Workspace $workspace,
Configuration $configuration,
Directory $root,
array $entityRoles,
$isValidated = false,
$importRoles = true
)
{
$this->om->startFlushSuite();
$data = $configuration->getData();
$data... | php | public function populateWorkspace(
Workspace $workspace,
Configuration $configuration,
Directory $root,
array $entityRoles,
$isValidated = false,
$importRoles = true
)
{
$this->om->startFlushSuite();
$data = $configuration->getData();
$data... | [
"public",
"function",
"populateWorkspace",
"(",
"Workspace",
"$",
"workspace",
",",
"Configuration",
"$",
"configuration",
",",
"Directory",
"$",
"root",
",",
"array",
"$",
"entityRoles",
",",
"$",
"isValidated",
"=",
"false",
",",
"$",
"importRoles",
"=",
"tr... | Populates a workspace content with the content of an zip archive. In other words, it ignores the
many properties of the configuration object and use an existing workspace as base.
This will set the $this->data var
This will set the $this->workspace var
@param Workspace $workspace
@param Confuguration $configuration
@... | [
"Populates",
"a",
"workspace",
"content",
"with",
"the",
"content",
"of",
"an",
"zip",
"archive",
".",
"In",
"other",
"words",
"it",
"ignores",
"the",
"many",
"properties",
"of",
"the",
"configuration",
"object",
"and",
"use",
"an",
"existing",
"workspace",
... | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/TransfertManager.php#L130-L166 |
222,170 | claroline/CoreBundle | Manager/TransfertManager.php | TransfertManager.importRichText | public function importRichText()
{
$this->log('Parsing rich texts...');
//now we have to parse everything in case there is a rich text
//rich texts must be located in the tools section
$data = $this->data;
//@todo remove the line for claroline v6
$this->container->get... | php | public function importRichText()
{
$this->log('Parsing rich texts...');
//now we have to parse everything in case there is a rich text
//rich texts must be located in the tools section
$data = $this->data;
//@todo remove the line for claroline v6
$this->container->get... | [
"public",
"function",
"importRichText",
"(",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"'Parsing rich texts...'",
")",
";",
"//now we have to parse everything in case there is a rich text",
"//rich texts must be located in the tools section",
"$",
"data",
"=",
"$",
"this",
"... | refactor how workspace are created because this sucks | [
"refactor",
"how",
"workspace",
"are",
"created",
"because",
"this",
"sucks"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/TransfertManager.php#L277-L297 |
222,171 | claroline/CoreBundle | Manager/TransfertManager.php | TransfertManager.export | public function export(Workspace $workspace)
{
foreach ($this->listImporters as $importer) {
$importer->setListImporters($this->listImporters);
}
$data = [];
$files = [];
$data['roles'] = $this->getImporterByName('roles')->export($workspace, $files, null);
... | php | public function export(Workspace $workspace)
{
foreach ($this->listImporters as $importer) {
$importer->setListImporters($this->listImporters);
}
$data = [];
$files = [];
$data['roles'] = $this->getImporterByName('roles')->export($workspace, $files, null);
... | [
"public",
"function",
"export",
"(",
"Workspace",
"$",
"workspace",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"listImporters",
"as",
"$",
"importer",
")",
"{",
"$",
"importer",
"->",
"setListImporters",
"(",
"$",
"this",
"->",
"listImporters",
")",
";",... | Full workspace export | [
"Full",
"workspace",
"export"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/TransfertManager.php#L318-L364 |
222,172 | claroline/CoreBundle | Manager/TransfertManager.php | TransfertManager.setImporters | private function setImporters(Configuration $configuration, array $data)
{
foreach ($this->listImporters as $importer) {
$importer->setRootPath($configuration->getExtractPath());
if ($owner = $configuration->getOwner()) {
$importer->setOwner($owner);
} els... | php | private function setImporters(Configuration $configuration, array $data)
{
foreach ($this->listImporters as $importer) {
$importer->setRootPath($configuration->getExtractPath());
if ($owner = $configuration->getOwner()) {
$importer->setOwner($owner);
} els... | [
"private",
"function",
"setImporters",
"(",
"Configuration",
"$",
"configuration",
",",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"listImporters",
"as",
"$",
"importer",
")",
"{",
"$",
"importer",
"->",
"setRootPath",
"(",
"$",
"co... | Inject the rootPath
@param \Claroline\CoreBundle\Library\Workspace\Configuration $configuration
@param array $data
@param $isStrict | [
"Inject",
"the",
"rootPath"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Manager/TransfertManager.php#L431-L445 |
222,173 | claroline/CoreBundle | Library/Installation/Plugin/DatabaseWriter.php | DatabaseWriter.insert | public function insert(PluginBundle $pluginBundle, array $pluginConfiguration)
{
$pluginEntity = new Plugin();
$pluginEntity->setVendorName($pluginBundle->getVendorName());
$pluginEntity->setBundleName($pluginBundle->getBundleName());
$pluginEntity->setHasOptions($pluginConfiguration... | php | public function insert(PluginBundle $pluginBundle, array $pluginConfiguration)
{
$pluginEntity = new Plugin();
$pluginEntity->setVendorName($pluginBundle->getVendorName());
$pluginEntity->setBundleName($pluginBundle->getBundleName());
$pluginEntity->setHasOptions($pluginConfiguration... | [
"public",
"function",
"insert",
"(",
"PluginBundle",
"$",
"pluginBundle",
",",
"array",
"$",
"pluginConfiguration",
")",
"{",
"$",
"pluginEntity",
"=",
"new",
"Plugin",
"(",
")",
";",
"$",
"pluginEntity",
"->",
"setVendorName",
"(",
"$",
"pluginBundle",
"->",
... | Persists a plugin in the database.
@param PluginBundle $pluginBundle
@param array $pluginConfiguration | [
"Persists",
"a",
"plugin",
"in",
"the",
"database",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Library/Installation/Plugin/DatabaseWriter.php#L97-L107 |
222,174 | claroline/CoreBundle | Library/Security/Utilities.php | Utilities.addMissingRights | private function addMissingRights(array $permissions, $target)
{
$expectedKeys = $target === 'resource' ?
$this->expectedKeysForResource :
$this->expectedKeysForWorkspace;
foreach ($expectedKeys as $expected) {
if (!isset($permissions[$expected])) {
... | php | private function addMissingRights(array $permissions, $target)
{
$expectedKeys = $target === 'resource' ?
$this->expectedKeysForResource :
$this->expectedKeysForWorkspace;
foreach ($expectedKeys as $expected) {
if (!isset($permissions[$expected])) {
... | [
"private",
"function",
"addMissingRights",
"(",
"array",
"$",
"permissions",
",",
"$",
"target",
")",
"{",
"$",
"expectedKeys",
"=",
"$",
"target",
"===",
"'resource'",
"?",
"$",
"this",
"->",
"expectedKeysForResource",
":",
"$",
"this",
"->",
"expectedKeysFor... | Adds the missing permissions to an array of permissions, setting missing
ones to false.
@param array $permissions The array of permissions
@param string $target The target of the right ('resource' or 'workspace')
@return array | [
"Adds",
"the",
"missing",
"permissions",
"to",
"an",
"array",
"of",
"permissions",
"setting",
"missing",
"ones",
"to",
"false",
"."
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Library/Security/Utilities.php#L112-L125 |
222,175 | claroline/CoreBundle | Repository/WorkspaceTagRepository.php | WorkspaceTagRepository.findAdminChildrenFromTags | public function findAdminChildrenFromTags(array $tags)
{
if (count($tags) === 0) {
throw new \InvalidArgumentException('Array argument cannot be empty');
}
$index = 0;
$eol = PHP_EOL;
$tagsTest = '(';
foreach ($tags as $tag) {
$tagsTest .= $i... | php | public function findAdminChildrenFromTags(array $tags)
{
if (count($tags) === 0) {
throw new \InvalidArgumentException('Array argument cannot be empty');
}
$index = 0;
$eol = PHP_EOL;
$tagsTest = '(';
foreach ($tags as $tag) {
$tagsTest .= $i... | [
"public",
"function",
"findAdminChildrenFromTags",
"(",
"array",
"$",
"tags",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"tags",
")",
"===",
"0",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Array argument cannot be empty'",
")",
";",
"}",
... | Find all admin tags that are children of given tags id
Given admin tags are included | [
"Find",
"all",
"admin",
"tags",
"that",
"are",
"children",
"of",
"given",
"tags",
"id",
"Given",
"admin",
"tags",
"are",
"included"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/WorkspaceTagRepository.php#L307-L341 |
222,176 | claroline/CoreBundle | Repository/WorkspaceTagRepository.php | WorkspaceTagRepository.findChildrenFromTags | public function findChildrenFromTags(User $user, array $tags)
{
if (count($tags) === 0) {
throw new \InvalidArgumentException('Array argument cannot be empty');
}
$index = 0;
$eol = PHP_EOL;
$tagsTest = '(';
foreach ($tags as $tag) {
$tagsTes... | php | public function findChildrenFromTags(User $user, array $tags)
{
if (count($tags) === 0) {
throw new \InvalidArgumentException('Array argument cannot be empty');
}
$index = 0;
$eol = PHP_EOL;
$tagsTest = '(';
foreach ($tags as $tag) {
$tagsTes... | [
"public",
"function",
"findChildrenFromTags",
"(",
"User",
"$",
"user",
",",
"array",
"$",
"tags",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"tags",
")",
"===",
"0",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Array argument cannot be em... | Find all tags that are children of given tags id
Given tags are included | [
"Find",
"all",
"tags",
"that",
"are",
"children",
"of",
"given",
"tags",
"id",
"Given",
"tags",
"are",
"included"
] | dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3 | https://github.com/claroline/CoreBundle/blob/dec7daea24ec201cd54bfc0d5dd7c7160bbbdef3/Repository/WorkspaceTagRepository.php#L373-L408 |
222,177 | thedevsaddam/laravel-schema | src/Schema/BaseSchema.php | BaseSchema.getPaginatedData | public function getPaginatedData($tableName, $page = 1, $limit = 10, $orderAttribute = null, $order = 'ASC')
{
Paginator::currentPageResolver(function () use ($page) {
return $page;
});
$data = $this->database->table($tableName);
if (null === $orderAttribute) {
... | php | public function getPaginatedData($tableName, $page = 1, $limit = 10, $orderAttribute = null, $order = 'ASC')
{
Paginator::currentPageResolver(function () use ($page) {
return $page;
});
$data = $this->database->table($tableName);
if (null === $orderAttribute) {
... | [
"public",
"function",
"getPaginatedData",
"(",
"$",
"tableName",
",",
"$",
"page",
"=",
"1",
",",
"$",
"limit",
"=",
"10",
",",
"$",
"orderAttribute",
"=",
"null",
",",
"$",
"order",
"=",
"'ASC'",
")",
"{",
"Paginator",
"::",
"currentPageResolver",
"(",
... | Fetch data form table using pagination
@param $tableName
@param int $page
@param int $limit
@param null $orderAttribute
@param string $order
@return mixed | [
"Fetch",
"data",
"form",
"table",
"using",
"pagination"
] | ce787b3b5d6f558cd5fb615f373beabb1939e724 | https://github.com/thedevsaddam/laravel-schema/blob/ce787b3b5d6f558cd5fb615f373beabb1939e724/src/Schema/BaseSchema.php#L86-L96 |
222,178 | yii2mod/yii2-cron-log | components/ErrorHandler.php | ErrorHandler.logException | public function logException($exception)
{
$category = get_class($exception);
if ($exception instanceof HttpException) {
$category = 'yii\\web\\HttpException:' . $exception->statusCode;
} elseif ($exception instanceof \ErrorException) {
$category .= ':' . $exception->... | php | public function logException($exception)
{
$category = get_class($exception);
if ($exception instanceof HttpException) {
$category = 'yii\\web\\HttpException:' . $exception->statusCode;
} elseif ($exception instanceof \ErrorException) {
$category .= ':' . $exception->... | [
"public",
"function",
"logException",
"(",
"$",
"exception",
")",
"{",
"$",
"category",
"=",
"get_class",
"(",
"$",
"exception",
")",
";",
"if",
"(",
"$",
"exception",
"instanceof",
"HttpException",
")",
"{",
"$",
"category",
"=",
"'yii\\\\web\\\\HttpException... | Logs the given exception
@param \Exception $exception the exception to be logged | [
"Logs",
"the",
"given",
"exception"
] | 488d5907d6f9b26320e44078b08a8b5b6ed9b49c | https://github.com/yii2mod/yii2-cron-log/blob/488d5907d6f9b26320e44078b08a8b5b6ed9b49c/components/ErrorHandler.php#L26-L39 |
222,179 | peej/phpdoctor | classes/tag.php | tag.& | function &_getInlineTags($text)
{
$return = NULL;
$tagStrings = preg_split('/{(@.+)}/sU', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
if ($tagStrings) {
$inlineTags = NULL;
$phpdoctor =& $this->_root->phpdoctor();
foreach ($tagStrings as $tag) {
... | php | function &_getInlineTags($text)
{
$return = NULL;
$tagStrings = preg_split('/{(@.+)}/sU', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
if ($tagStrings) {
$inlineTags = NULL;
$phpdoctor =& $this->_root->phpdoctor();
foreach ($tagStrings as $tag) {
... | [
"function",
"&",
"_getInlineTags",
"(",
"$",
"text",
")",
"{",
"$",
"return",
"=",
"NULL",
";",
"$",
"tagStrings",
"=",
"preg_split",
"(",
"'/{(@.+)}/sU'",
",",
"$",
"text",
",",
"-",
"1",
",",
"PREG_SPLIT_DELIM_CAPTURE",
")",
";",
"if",
"(",
"$",
"tag... | Parse out inline tags from within a text string
@param str text
@return Tag[] | [
"Parse",
"out",
"inline",
"tags",
"from",
"within",
"a",
"text",
"string"
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/tag.php#L176-L206 |
222,180 | thedevsaddam/laravel-schema | src/Console/Commands/TableSchema.php | TableSchema.makeTableBody | private function makeTableBody($headers, $rows)
{
$body = [];
$tableCellWidth = ($this->option('w')) ? $this->option('w') : 10;
for ($i = 0; $i < count($rows); $i++) {
$row = [];
for ($j = 0; $j < count($headers); $j++) {
$column = $headers[$j];
... | php | private function makeTableBody($headers, $rows)
{
$body = [];
$tableCellWidth = ($this->option('w')) ? $this->option('w') : 10;
for ($i = 0; $i < count($rows); $i++) {
$row = [];
for ($j = 0; $j < count($headers); $j++) {
$column = $headers[$j];
... | [
"private",
"function",
"makeTableBody",
"(",
"$",
"headers",
",",
"$",
"rows",
")",
"{",
"$",
"body",
"=",
"[",
"]",
";",
"$",
"tableCellWidth",
"=",
"(",
"$",
"this",
"->",
"option",
"(",
"'w'",
")",
")",
"?",
"$",
"this",
"->",
"option",
"(",
"... | Make formatted body for table
@param $headers
@param $rows
@return array | [
"Make",
"formatted",
"body",
"for",
"table"
] | ce787b3b5d6f558cd5fb615f373beabb1939e724 | https://github.com/thedevsaddam/laravel-schema/blob/ce787b3b5d6f558cd5fb615f373beabb1939e724/src/Console/Commands/TableSchema.php#L133-L146 |
222,181 | petercoles/Betfair-Exchange | src/Api/BaseApi.php | BaseApi.execute | public function execute($params)
{
$this->method = array_shift($params);
$this->prepare($params);
return $this->httpClient
->setMethod('post')
->setEndPoint(static::ENDPOINT.$this->method.'/')
->authHeaders()
->addHeader([ 'Content-Type' => 'a... | php | public function execute($params)
{
$this->method = array_shift($params);
$this->prepare($params);
return $this->httpClient
->setMethod('post')
->setEndPoint(static::ENDPOINT.$this->method.'/')
->authHeaders()
->addHeader([ 'Content-Type' => 'a... | [
"public",
"function",
"execute",
"(",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"method",
"=",
"array_shift",
"(",
"$",
"params",
")",
";",
"$",
"this",
"->",
"prepare",
"(",
"$",
"params",
")",
";",
"return",
"$",
"this",
"->",
"httpClient",
"->",... | Invoke the HTTP client to Execute the API request
@param array $params
@return mixed | [
"Invoke",
"the",
"HTTP",
"client",
"to",
"Execute",
"the",
"API",
"request"
] | 58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2 | https://github.com/petercoles/Betfair-Exchange/blob/58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2/src/Api/BaseApi.php#L41-L53 |
222,182 | peej/phpdoctor | doclets/standard/packageIndexWriter.php | packageIndexWriter.packageIndexWriter | public function packageIndexWriter(&$doclet)
{
parent::htmlWriter($doclet);
$phpdoctor =& $this->_doclet->phpdoctor();
$this->_sections[0] = array('title' => 'Overview', 'selected' => TRUE);
$this->_sections[1] = array('title' => 'Namespace');
$this->_sections[2] = array('... | php | public function packageIndexWriter(&$doclet)
{
parent::htmlWriter($doclet);
$phpdoctor =& $this->_doclet->phpdoctor();
$this->_sections[0] = array('title' => 'Overview', 'selected' => TRUE);
$this->_sections[1] = array('title' => 'Namespace');
$this->_sections[2] = array('... | [
"public",
"function",
"packageIndexWriter",
"(",
"&",
"$",
"doclet",
")",
"{",
"parent",
"::",
"htmlWriter",
"(",
"$",
"doclet",
")",
";",
"$",
"phpdoctor",
"=",
"&",
"$",
"this",
"->",
"_doclet",
"->",
"phpdoctor",
"(",
")",
";",
"$",
"this",
"->",
... | Build the package index.
@param Doclet doclet | [
"Build",
"the",
"package",
"index",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/doclets/standard/packageIndexWriter.php#L33-L93 |
222,183 | webtoucher/yii2-amqp | components/Amqp.php | Amqp.getChannel | public function getChannel($channel_id = null)
{
$index = $channel_id ?: 'default';
if (!array_key_exists($index, $this->channels)) {
$this->channels[$index] = $this->connection->channel($channel_id);
}
return $this->channels[$index];
} | php | public function getChannel($channel_id = null)
{
$index = $channel_id ?: 'default';
if (!array_key_exists($index, $this->channels)) {
$this->channels[$index] = $this->connection->channel($channel_id);
}
return $this->channels[$index];
} | [
"public",
"function",
"getChannel",
"(",
"$",
"channel_id",
"=",
"null",
")",
"{",
"$",
"index",
"=",
"$",
"channel_id",
"?",
":",
"'default'",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"index",
",",
"$",
"this",
"->",
"channels",
")",
")",
... | Returns AMQP connection.
@param string $channel_id
@return AMQPChannel | [
"Returns",
"AMQP",
"connection",
"."
] | 7a060ce88f2e31d7324b036a6b1d113a0d75bf02 | https://github.com/webtoucher/yii2-amqp/blob/7a060ce88f2e31d7324b036a6b1d113a0d75bf02/components/Amqp.php#L105-L112 |
222,184 | webtoucher/yii2-amqp | components/Amqp.php | Amqp.listen | public function listen($exchange, $routing_key, $callback, $type = self::TYPE_TOPIC)
{
list ($queueName) = $this->channel->queue_declare();
if ($type == Amqp::TYPE_DIRECT) {
$this->channel->exchange_declare($exchange, $type, false, true, false);
}
$this->channel->queue_bi... | php | public function listen($exchange, $routing_key, $callback, $type = self::TYPE_TOPIC)
{
list ($queueName) = $this->channel->queue_declare();
if ($type == Amqp::TYPE_DIRECT) {
$this->channel->exchange_declare($exchange, $type, false, true, false);
}
$this->channel->queue_bi... | [
"public",
"function",
"listen",
"(",
"$",
"exchange",
",",
"$",
"routing_key",
",",
"$",
"callback",
",",
"$",
"type",
"=",
"self",
"::",
"TYPE_TOPIC",
")",
"{",
"list",
"(",
"$",
"queueName",
")",
"=",
"$",
"this",
"->",
"channel",
"->",
"queue_declar... | Listens the exchange for messages.
@param string $exchange
@param string $routing_key
@param callable $callback
@param string $type | [
"Listens",
"the",
"exchange",
"for",
"messages",
"."
] | 7a060ce88f2e31d7324b036a6b1d113a0d75bf02 | https://github.com/webtoucher/yii2-amqp/blob/7a060ce88f2e31d7324b036a6b1d113a0d75bf02/components/Amqp.php#L172-L187 |
222,185 | webtoucher/yii2-amqp | components/Amqp.php | Amqp.prepareMessage | public function prepareMessage($message, $properties = null)
{
if (empty($message)) {
throw new Exception('AMQP message can not be empty');
}
if (is_array($message) || is_object($message)) {
$message = Json::encode($message);
}
return new AMQPMessage($... | php | public function prepareMessage($message, $properties = null)
{
if (empty($message)) {
throw new Exception('AMQP message can not be empty');
}
if (is_array($message) || is_object($message)) {
$message = Json::encode($message);
}
return new AMQPMessage($... | [
"public",
"function",
"prepareMessage",
"(",
"$",
"message",
",",
"$",
"properties",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"message",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'AMQP message can not be empty'",
")",
";",
"}",
"if",
... | Returns prepaired AMQP message.
@param string|array|object $message
@param array $properties
@return AMQPMessage
@throws Exception If message is empty. | [
"Returns",
"prepaired",
"AMQP",
"message",
"."
] | 7a060ce88f2e31d7324b036a6b1d113a0d75bf02 | https://github.com/webtoucher/yii2-amqp/blob/7a060ce88f2e31d7324b036a6b1d113a0d75bf02/components/Amqp.php#L197-L206 |
222,186 | SmarchSoftware/watchtower | src/Controllers/RoleController.php | RoleController.editRolePermissions | public function editRolePermissions($id)
{
if ( Shinobi::can( config('watchtower.acl.role.permissions', false) ) ) {
$role = Role::findOrFail($id);
$permissions = $role->permissions;
$available_permissions = Permission::whereDoesntHave('roles', function ($query) use ($id) {
$query->where('role_i... | php | public function editRolePermissions($id)
{
if ( Shinobi::can( config('watchtower.acl.role.permissions', false) ) ) {
$role = Role::findOrFail($id);
$permissions = $role->permissions;
$available_permissions = Permission::whereDoesntHave('roles', function ($query) use ($id) {
$query->where('role_i... | [
"public",
"function",
"editRolePermissions",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"Shinobi",
"::",
"can",
"(",
"config",
"(",
"'watchtower.acl.role.permissions'",
",",
"false",
")",
")",
")",
"{",
"$",
"role",
"=",
"Role",
"::",
"findOrFail",
"(",
"$",
"... | Show the form for editing the role permissions.
@param int $id
@return Response | [
"Show",
"the",
"form",
"for",
"editing",
"the",
"role",
"permissions",
"."
] | 4ac9368ff98dfa88d4a4c4c8ce1ff92e4d35b5da | https://github.com/SmarchSoftware/watchtower/blob/4ac9368ff98dfa88d4a4c4c8ce1ff92e4d35b5da/src/Controllers/RoleController.php#L190-L205 |
222,187 | SmarchSoftware/watchtower | src/Controllers/RoleController.php | RoleController.updateRolePermissions | public function updateRolePermissions($id, Request $request)
{
$level = "danger";
$message = " You are not permitted to update role permissions.";
if ( Shinobi::can ( config('watchtower.acl.role.permissions', false) ) ) {
$role = Role::findOrFail($id);
if ($request->has('slug')) {
$role->permissions()... | php | public function updateRolePermissions($id, Request $request)
{
$level = "danger";
$message = " You are not permitted to update role permissions.";
if ( Shinobi::can ( config('watchtower.acl.role.permissions', false) ) ) {
$role = Role::findOrFail($id);
if ($request->has('slug')) {
$role->permissions()... | [
"public",
"function",
"updateRolePermissions",
"(",
"$",
"id",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"level",
"=",
"\"danger\"",
";",
"$",
"message",
"=",
"\" You are not permitted to update role permissions.\"",
";",
"if",
"(",
"Shinobi",
"::",
"can",
... | Sync roles and permissions.
@param int $id
@return Response | [
"Sync",
"roles",
"and",
"permissions",
"."
] | 4ac9368ff98dfa88d4a4c4c8ce1ff92e4d35b5da | https://github.com/SmarchSoftware/watchtower/blob/4ac9368ff98dfa88d4a4c4c8ce1ff92e4d35b5da/src/Controllers/RoleController.php#L213-L231 |
222,188 | SmarchSoftware/watchtower | src/Controllers/RoleController.php | RoleController.editRoleUsers | public function editRoleUsers($id)
{
if ( Shinobi::can( config('watchtower.acl.role.users', false) ) ) {
$role = Role::findOrFail($id);
$users = $role->users;
$available_users = User::whereDoesntHave('roles', function ($query) use ($id) {
$query->where('role_id', $id);
})->get();
return v... | php | public function editRoleUsers($id)
{
if ( Shinobi::can( config('watchtower.acl.role.users', false) ) ) {
$role = Role::findOrFail($id);
$users = $role->users;
$available_users = User::whereDoesntHave('roles', function ($query) use ($id) {
$query->where('role_id', $id);
})->get();
return v... | [
"public",
"function",
"editRoleUsers",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"Shinobi",
"::",
"can",
"(",
"config",
"(",
"'watchtower.acl.role.users'",
",",
"false",
")",
")",
")",
"{",
"$",
"role",
"=",
"Role",
"::",
"findOrFail",
"(",
"$",
"id",
")",
... | Show the form for editing the role users.
@param int $id
@return Response | [
"Show",
"the",
"form",
"for",
"editing",
"the",
"role",
"users",
"."
] | 4ac9368ff98dfa88d4a4c4c8ce1ff92e4d35b5da | https://github.com/SmarchSoftware/watchtower/blob/4ac9368ff98dfa88d4a4c4c8ce1ff92e4d35b5da/src/Controllers/RoleController.php#L239-L254 |
222,189 | SmarchSoftware/watchtower | src/Controllers/RoleController.php | RoleController.showRoleMatrix | public function showRoleMatrix()
{
if ( Shinobi::can( config('watchtower.acl.role.viewmatrix', false) ) ) {
$roles = Role::all();
$perms = Permission::all();
$prs = DB::table('permission_role')->select('role_id as r_id','permission_id as p_id')->get();
$pivot = [];
foreach($prs as $p) {
$pivot[] ... | php | public function showRoleMatrix()
{
if ( Shinobi::can( config('watchtower.acl.role.viewmatrix', false) ) ) {
$roles = Role::all();
$perms = Permission::all();
$prs = DB::table('permission_role')->select('role_id as r_id','permission_id as p_id')->get();
$pivot = [];
foreach($prs as $p) {
$pivot[] ... | [
"public",
"function",
"showRoleMatrix",
"(",
")",
"{",
"if",
"(",
"Shinobi",
"::",
"can",
"(",
"config",
"(",
"'watchtower.acl.role.viewmatrix'",
",",
"false",
")",
")",
")",
"{",
"$",
"roles",
"=",
"Role",
"::",
"all",
"(",
")",
";",
"$",
"perms",
"="... | A full matrix of roles and permissions.
@return Response | [
"A",
"full",
"matrix",
"of",
"roles",
"and",
"permissions",
"."
] | 4ac9368ff98dfa88d4a4c4c8ce1ff92e4d35b5da | https://github.com/SmarchSoftware/watchtower/blob/4ac9368ff98dfa88d4a4c4c8ce1ff92e4d35b5da/src/Controllers/RoleController.php#L286-L302 |
222,190 | peej/phpdoctor | classes/executableDoc.php | executableDoc.paramTags | public function paramTags()
{
if (isset($this->_tags['@param'])) {
if (is_array($this->_tags['@param'])) {
return $this->_tags['@param'];
} else {
return array($this->_tags['@param']);
}
} else {
return NULL;
}
... | php | public function paramTags()
{
if (isset($this->_tags['@param'])) {
if (is_array($this->_tags['@param'])) {
return $this->_tags['@param'];
} else {
return array($this->_tags['@param']);
}
} else {
return NULL;
}
... | [
"public",
"function",
"paramTags",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_tags",
"[",
"'@param'",
"]",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"_tags",
"[",
"'@param'",
"]",
")",
")",
"{",
"return",
"$"... | Return the param tags in this function.
@return Tag[] | [
"Return",
"the",
"param",
"tags",
"in",
"this",
"function",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/executableDoc.php#L88-L99 |
222,191 | peej/phpdoctor | classes/executableDoc.php | executableDoc.throwsTags | public function throwsTags()
{
if (isset($this->_tags['@throws'])) {
if (is_array($this->_tags['@throws'])) {
return $this->_tags['@throws'];
} else {
return array($this->_tags['@throws']);
}
} else {
return NULL;
... | php | public function throwsTags()
{
if (isset($this->_tags['@throws'])) {
if (is_array($this->_tags['@throws'])) {
return $this->_tags['@throws'];
} else {
return array($this->_tags['@throws']);
}
} else {
return NULL;
... | [
"public",
"function",
"throwsTags",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_tags",
"[",
"'@throws'",
"]",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"_tags",
"[",
"'@throws'",
"]",
")",
")",
"{",
"return",
... | Return the throws tags in this function.
@return Type | [
"Return",
"the",
"throws",
"tags",
"in",
"this",
"function",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/executableDoc.php#L105-L116 |
222,192 | peej/phpdoctor | classes/executableDoc.php | executableDoc.signature | public function signature()
{
$signature = '(';
$myPackage =& $this->containingPackage();
foreach ($this->_parameters as $param) {
$type = $param->type();
$classDoc =& $type->asClassDoc();
if ($classDoc) {
$packageDoc =& $classDoc->containi... | php | public function signature()
{
$signature = '(';
$myPackage =& $this->containingPackage();
foreach ($this->_parameters as $param) {
$type = $param->type();
$classDoc =& $type->asClassDoc();
if ($classDoc) {
$packageDoc =& $classDoc->containi... | [
"public",
"function",
"signature",
"(",
")",
"{",
"$",
"signature",
"=",
"'('",
";",
"$",
"myPackage",
"=",
"&",
"$",
"this",
"->",
"containingPackage",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_parameters",
"as",
"$",
"param",
")",
"{",
"$... | Get the signature. It is the parameter list, type is qualified.
<pre>for a function
mymethod(foo x, int y)
it will return
(bar.foo x, int y)</pre>
Recognised types are turned into HTML anchor tags to the documentation
page for the class defining them.
@return str | [
"Get",
"the",
"signature",
".",
"It",
"is",
"the",
"parameter",
"list",
"type",
"is",
"qualified",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/executableDoc.php#L130-L146 |
222,193 | petercoles/Betfair-Exchange | src/Http/Client.php | Client.authHeaders | public function authHeaders(array $headers = [ ])
{
if (count($headers) == 0) {
$headers = [ 'X-Application' => Auth::$appKey, 'X-Authentication' => Auth::$sessionToken ];
}
$this->options[ 'headers' ] = array_merge($this->options[ 'headers' ], $headers);
return $this;
... | php | public function authHeaders(array $headers = [ ])
{
if (count($headers) == 0) {
$headers = [ 'X-Application' => Auth::$appKey, 'X-Authentication' => Auth::$sessionToken ];
}
$this->options[ 'headers' ] = array_merge($this->options[ 'headers' ], $headers);
return $this;
... | [
"public",
"function",
"authHeaders",
"(",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"headers",
")",
"==",
"0",
")",
"{",
"$",
"headers",
"=",
"[",
"'X-Application'",
"=>",
"Auth",
"::",
"$",
"appKey",
",",
"'X-... | Setter for authentication headers.
@param array $headers
@return Client | [
"Setter",
"for",
"authentication",
"headers",
"."
] | 58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2 | https://github.com/petercoles/Betfair-Exchange/blob/58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2/src/Http/Client.php#L74-L81 |
222,194 | petercoles/Betfair-Exchange | src/Http/Client.php | Client.setParams | public function setParams($params)
{
if (!empty($params)) {
foreach ($params as $key => $value) {
$this->options[ 'json' ][ $key ] = $value;
}
}
return $this;
} | php | public function setParams($params)
{
if (!empty($params)) {
foreach ($params as $key => $value) {
$this->options[ 'json' ][ $key ] = $value;
}
}
return $this;
} | [
"public",
"function",
"setParams",
"(",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"params",
")",
")",
"{",
"foreach",
"(",
"$",
"params",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"options",
"[",
"'json'... | Setter for params.
@param array $params
@return Client | [
"Setter",
"for",
"params",
"."
] | 58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2 | https://github.com/petercoles/Betfair-Exchange/blob/58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2/src/Http/Client.php#L101-L109 |
222,195 | petercoles/Betfair-Exchange | src/Http/Client.php | Client.send | public function send()
{
try {
$response = $this->guzzleClient->request($this->method, $this->uri, $this->options);
} catch (ClientException $e) {
$this->handleApiException($e->getResponse()->getBody()->getContents());
}
return $this->getBody($response);
... | php | public function send()
{
try {
$response = $this->guzzleClient->request($this->method, $this->uri, $this->options);
} catch (ClientException $e) {
$this->handleApiException($e->getResponse()->getBody()->getContents());
}
return $this->getBody($response);
... | [
"public",
"function",
"send",
"(",
")",
"{",
"try",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"guzzleClient",
"->",
"request",
"(",
"$",
"this",
"->",
"method",
",",
"$",
"this",
"->",
"uri",
",",
"$",
"this",
"->",
"options",
")",
";",
"}",
... | Dispatch the request and provide hooks for error handling for the response.
@return mixed | [
"Dispatch",
"the",
"request",
"and",
"provide",
"hooks",
"for",
"error",
"handling",
"for",
"the",
"response",
"."
] | 58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2 | https://github.com/petercoles/Betfair-Exchange/blob/58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2/src/Http/Client.php#L116-L125 |
222,196 | peej/phpdoctor | classes/programElementDoc.php | programElementDoc.qualifiedName | public function qualifiedName()
{
$parent =& $this->containingClass();
if ($parent && $parent->name() != '' && $this->_package != $parent->name()) {
return $this->_package.'\\'.$parent->name().'\\'.$this->_name;
} else {
return $this->_package.'\\'.$this->_name;
... | php | public function qualifiedName()
{
$parent =& $this->containingClass();
if ($parent && $parent->name() != '' && $this->_package != $parent->name()) {
return $this->_package.'\\'.$parent->name().'\\'.$this->_name;
} else {
return $this->_package.'\\'.$this->_name;
... | [
"public",
"function",
"qualifiedName",
"(",
")",
"{",
"$",
"parent",
"=",
"&",
"$",
"this",
"->",
"containingClass",
"(",
")",
";",
"if",
"(",
"$",
"parent",
"&&",
"$",
"parent",
"->",
"name",
"(",
")",
"!=",
"''",
"&&",
"$",
"this",
"->",
"_packag... | Get the fully qualified name.
<pre>Example:
for the method bar() in class Foo in the package Baz, return:
Baz\Foo\bar()</pre>
@return str | [
"Get",
"the",
"fully",
"qualified",
"name",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/programElementDoc.php#L138-L146 |
222,197 | peej/phpdoctor | classes/programElementDoc.php | programElementDoc.modifiers | public function modifiers($showPublic = TRUE)
{
$modifiers = '';
if ($showPublic || $this->_access != 'public') {
$modifiers .= $this->_access.' ';
}
if ($this->_final) {
$modifiers .= 'final ';
}
if (isset($this->_abstract) && $this->_abstract... | php | public function modifiers($showPublic = TRUE)
{
$modifiers = '';
if ($showPublic || $this->_access != 'public') {
$modifiers .= $this->_access.' ';
}
if ($this->_final) {
$modifiers .= 'final ';
}
if (isset($this->_abstract) && $this->_abstract... | [
"public",
"function",
"modifiers",
"(",
"$",
"showPublic",
"=",
"TRUE",
")",
"{",
"$",
"modifiers",
"=",
"''",
";",
"if",
"(",
"$",
"showPublic",
"||",
"$",
"this",
"->",
"_access",
"!=",
"'public'",
")",
"{",
"$",
"modifiers",
".=",
"$",
"this",
"->... | Get modifiers string.
<pre> Example, for:
public abstract int foo() { ... }
modifiers() would return:
'public abstract'</pre>
@return str | [
"Get",
"modifiers",
"string",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/programElementDoc.php#L157-L174 |
222,198 | peej/phpdoctor | classes/programElementDoc.php | programElementDoc.asPath | public function asPath()
{
if ($this->isClass() || $this->isInterface() || $this->isTrait() || $this->isException()) {
return strtolower(str_replace('.', '/', str_replace('\\', '/', $this->_package)).'/'.$this->_name.'.html');
} elseif ($this->isField()) {
$class =& $this->co... | php | public function asPath()
{
if ($this->isClass() || $this->isInterface() || $this->isTrait() || $this->isException()) {
return strtolower(str_replace('.', '/', str_replace('\\', '/', $this->_package)).'/'.$this->_name.'.html');
} elseif ($this->isField()) {
$class =& $this->co... | [
"public",
"function",
"asPath",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isClass",
"(",
")",
"||",
"$",
"this",
"->",
"isInterface",
"(",
")",
"||",
"$",
"this",
"->",
"isTrait",
"(",
")",
"||",
"$",
"this",
"->",
"isException",
"(",
")",
")... | Return the element path.
@return str | [
"Return",
"the",
"element",
"path",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/programElementDoc.php#L258-L283 |
222,199 | peej/phpdoctor | doclets/standard/packageFrameWriter.php | packageFrameWriter.& | function &_allItems(&$rootDoc)
{
ob_start();
echo '<body id="frame">', "\n\n";
echo "<h1>All Items</h1>\n\n";
$classes =& $rootDoc->classes();
if ($classes) {
ksort($classes);
echo "<h2>Classes</h2>\n";
echo "<ul>\n";
foreach... | php | function &_allItems(&$rootDoc)
{
ob_start();
echo '<body id="frame">', "\n\n";
echo "<h1>All Items</h1>\n\n";
$classes =& $rootDoc->classes();
if ($classes) {
ksort($classes);
echo "<h2>Classes</h2>\n";
echo "<ul>\n";
foreach... | [
"function",
"&",
"_allItems",
"(",
"&",
"$",
"rootDoc",
")",
"{",
"ob_start",
"(",
")",
";",
"echo",
"'<body id=\"frame\">'",
",",
"\"\\n\\n\"",
";",
"echo",
"\"<h1>All Items</h1>\\n\\n\"",
";",
"$",
"classes",
"=",
"&",
"$",
"rootDoc",
"->",
"classes",
"(",... | Build all items frame
@return str | [
"Build",
"all",
"items",
"frame"
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/doclets/standard/packageFrameWriter.php#L148-L204 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.