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
sequence
docstring
stringlengths
3
47.2k
docstring_tokens
sequence
sha
stringlengths
40
40
url
stringlengths
91
247
1,000
tekkla/core-html
Core/Html/Bootstrap/Navbar/Navbar.php
Navbar.isCollapsible
public function isCollapsible($collapsible = null) { if (isset($collapsible)) { $this->collapsible = (bool) $collapsible; return $this; } else { return $this->collapsible; } }
php
public function isCollapsible($collapsible = null) { if (isset($collapsible)) { $this->collapsible = (bool) $collapsible; return $this; } else { return $this->collapsible; } }
[ "public", "function", "isCollapsible", "(", "$", "collapsible", "=", "null", ")", "{", "if", "(", "isset", "(", "$", "collapsible", ")", ")", "{", "$", "this", "->", "collapsible", "=", "(", "bool", ")", "$", "collapsible", ";", "return", "$", "this", ";", "}", "else", "{", "return", "$", "this", "->", "collapsible", ";", "}", "}" ]
Sets or gets collapsible flag. @param bool $collapsible @return \Core\Html\Bootstrap\Navbar\Navbar|boolean
[ "Sets", "or", "gets", "collapsible", "flag", "." ]
00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3
https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Bootstrap/Navbar/Navbar.php#L106-L114
1,001
tekkla/core-html
Core/Html/Bootstrap/Navbar/Navbar.php
Navbar.buildMenuItems
private function buildMenuItems(array $items) { $html = ''; foreach ($items as $item) { if ($this->multilevel && $item->hasChilds()) { $html .= ' <li class="navbar-parent"> <a href="' . $item->getUrl() . '">' . $item->getText() . '</a> <ul>'; $html .= $this->buildMenuItems($item->getChilds()); $html .= ' </ul> </li>'; } else { $url = $item->getUrl(); if ($url) { $html .= '<li><a href="' . $url . '">' . $item->getText() . '</a></li>'; } else { $html .= '<li><a href="#" onClick="return false">' . $item->getText() . '</a></li>'; } } } return $html; }
php
private function buildMenuItems(array $items) { $html = ''; foreach ($items as $item) { if ($this->multilevel && $item->hasChilds()) { $html .= ' <li class="navbar-parent"> <a href="' . $item->getUrl() . '">' . $item->getText() . '</a> <ul>'; $html .= $this->buildMenuItems($item->getChilds()); $html .= ' </ul> </li>'; } else { $url = $item->getUrl(); if ($url) { $html .= '<li><a href="' . $url . '">' . $item->getText() . '</a></li>'; } else { $html .= '<li><a href="#" onClick="return false">' . $item->getText() . '</a></li>'; } } } return $html; }
[ "private", "function", "buildMenuItems", "(", "array", "$", "items", ")", "{", "$", "html", "=", "''", ";", "foreach", "(", "$", "items", "as", "$", "item", ")", "{", "if", "(", "$", "this", "->", "multilevel", "&&", "$", "item", "->", "hasChilds", "(", ")", ")", "{", "$", "html", ".=", "'\n\t\t\t\t<li class=\"navbar-parent\">\n\t\t\t\t\t<a href=\"'", ".", "$", "item", "->", "getUrl", "(", ")", ".", "'\">'", ".", "$", "item", "->", "getText", "(", ")", ".", "'</a>\n\t\t\t\t\t<ul>'", ";", "$", "html", ".=", "$", "this", "->", "buildMenuItems", "(", "$", "item", "->", "getChilds", "(", ")", ")", ";", "$", "html", ".=", "'\n\t\t\t\t\t</ul>\n\t\t\t\t</li>'", ";", "}", "else", "{", "$", "url", "=", "$", "item", "->", "getUrl", "(", ")", ";", "if", "(", "$", "url", ")", "{", "$", "html", ".=", "'<li><a href=\"'", ".", "$", "url", ".", "'\">'", ".", "$", "item", "->", "getText", "(", ")", ".", "'</a></li>'", ";", "}", "else", "{", "$", "html", ".=", "'<li><a href=\"#\" onClick=\"return false\">'", ".", "$", "item", "->", "getText", "(", ")", ".", "'</a></li>'", ";", "}", "}", "}", "return", "$", "html", ";", "}" ]
Builds nav bar elements @param array $items @return string
[ "Builds", "nav", "bar", "elements" ]
00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3
https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Bootstrap/Navbar/Navbar.php#L205-L235
1,002
OWeb/OWeb-Framework
OWeb/manage/Headers.php
Headers.addHeader
public function addHeader($header, $type = -1){ if($header instanceof Header) $this->other_headers[] = $header; else $this->addAndCreateHeader($header, $type); }
php
public function addHeader($header, $type = -1){ if($header instanceof Header) $this->other_headers[] = $header; else $this->addAndCreateHeader($header, $type); }
[ "public", "function", "addHeader", "(", "$", "header", ",", "$", "type", "=", "-", "1", ")", "{", "if", "(", "$", "header", "instanceof", "Header", ")", "$", "this", "->", "other_headers", "[", "]", "=", "$", "header", ";", "else", "$", "this", "->", "addAndCreateHeader", "(", "$", "header", ",", "$", "type", ")", ";", "}" ]
Allows you to add a header to the we bpage @param $code The url to the css, js or the name of the css or js file. The path will be added automatically. @param int $type The type of the Header you want to add.
[ "Allows", "you", "to", "add", "a", "header", "to", "the", "we", "bpage" ]
fb441f51afb16860b0c946a55c36c789fbb125fa
https://github.com/OWeb/OWeb-Framework/blob/fb441f51afb16860b0c946a55c36c789fbb125fa/OWeb/manage/Headers.php#L95-L100
1,003
OWeb/OWeb-Framework
OWeb/manage/Headers.php
Headers.display
public function display(){ $this->eventM->sendEvent('Didplay_Prepare@OWeb\manage\Headers'); echo "\n<!--OWEB displays all CSS includes-->\n"; //DIsplaying all Css Headers foreach ($this->css_headers as $id => $h){ echo $h->getCode($id); } echo "\n<!--OWEB displays all JS includes and codes-->\n"; //Displaying Javascript Headers foreach ($this->js_headers as $id => $h){ echo $h->getCode($id); } echo "\n<!--OWEB displays personalized header codes-->\n"; //Displaying all other headers foreach ($this->other_headers as $id => $h){ echo $h->getCode($id); } $this->eventM->sendEvent('Didplay_Done@OWeb\manage\Headers'); }
php
public function display(){ $this->eventM->sendEvent('Didplay_Prepare@OWeb\manage\Headers'); echo "\n<!--OWEB displays all CSS includes-->\n"; //DIsplaying all Css Headers foreach ($this->css_headers as $id => $h){ echo $h->getCode($id); } echo "\n<!--OWEB displays all JS includes and codes-->\n"; //Displaying Javascript Headers foreach ($this->js_headers as $id => $h){ echo $h->getCode($id); } echo "\n<!--OWEB displays personalized header codes-->\n"; //Displaying all other headers foreach ($this->other_headers as $id => $h){ echo $h->getCode($id); } $this->eventM->sendEvent('Didplay_Done@OWeb\manage\Headers'); }
[ "public", "function", "display", "(", ")", "{", "$", "this", "->", "eventM", "->", "sendEvent", "(", "'Didplay_Prepare@OWeb\\manage\\Headers'", ")", ";", "echo", "\"\\n<!--OWEB displays all CSS includes-->\\n\"", ";", "//DIsplaying all Css Headers", "foreach", "(", "$", "this", "->", "css_headers", "as", "$", "id", "=>", "$", "h", ")", "{", "echo", "$", "h", "->", "getCode", "(", "$", "id", ")", ";", "}", "echo", "\"\\n<!--OWEB displays all JS includes and codes-->\\n\"", ";", "//Displaying Javascript Headers", "foreach", "(", "$", "this", "->", "js_headers", "as", "$", "id", "=>", "$", "h", ")", "{", "echo", "$", "h", "->", "getCode", "(", "$", "id", ")", ";", "}", "echo", "\"\\n<!--OWEB displays personalized header codes-->\\n\"", ";", "//Displaying all other headers", "foreach", "(", "$", "this", "->", "other_headers", "as", "$", "id", "=>", "$", "h", ")", "{", "echo", "$", "h", "->", "getCode", "(", "$", "id", ")", ";", "}", "$", "this", "->", "eventM", "->", "sendEvent", "(", "'Didplay_Done@OWeb\\manage\\Headers'", ")", ";", "}" ]
Display the Headers that has been added.
[ "Display", "the", "Headers", "that", "has", "been", "added", "." ]
fb441f51afb16860b0c946a55c36c789fbb125fa
https://github.com/OWeb/OWeb-Framework/blob/fb441f51afb16860b0c946a55c36c789fbb125fa/OWeb/manage/Headers.php#L154-L178
1,004
OWeb/OWeb-Framework
OWeb/manage/Headers.php
Headers.toString
public function toString(){ $s = "\n<!--OWEB displays all CSS includes-->\n"; //DIsplaying all Css Headers foreach ($this->css_headers as $id => $h){ $s .= $h->getCode($id); } $s .= "\n<!--OWEB displays all JS includes and codes-->\n"; //Displaying Javascript Headers foreach ($this->js_headers as $id => $h){ $s .= $h->getCode($id); } $s .= "\n<!--OWEB displays personalized header codes-->\n"; //Displaying all other headers foreach ($this->other_headers as $id => $h){ $s .= $h->getCode($id); } return $s; }
php
public function toString(){ $s = "\n<!--OWEB displays all CSS includes-->\n"; //DIsplaying all Css Headers foreach ($this->css_headers as $id => $h){ $s .= $h->getCode($id); } $s .= "\n<!--OWEB displays all JS includes and codes-->\n"; //Displaying Javascript Headers foreach ($this->js_headers as $id => $h){ $s .= $h->getCode($id); } $s .= "\n<!--OWEB displays personalized header codes-->\n"; //Displaying all other headers foreach ($this->other_headers as $id => $h){ $s .= $h->getCode($id); } return $s; }
[ "public", "function", "toString", "(", ")", "{", "$", "s", "=", "\"\\n<!--OWEB displays all CSS includes-->\\n\"", ";", "//DIsplaying all Css Headers", "foreach", "(", "$", "this", "->", "css_headers", "as", "$", "id", "=>", "$", "h", ")", "{", "$", "s", ".=", "$", "h", "->", "getCode", "(", "$", "id", ")", ";", "}", "$", "s", ".=", "\"\\n<!--OWEB displays all JS includes and codes-->\\n\"", ";", "//Displaying Javascript Headers", "foreach", "(", "$", "this", "->", "js_headers", "as", "$", "id", "=>", "$", "h", ")", "{", "$", "s", ".=", "$", "h", "->", "getCode", "(", "$", "id", ")", ";", "}", "$", "s", ".=", "\"\\n<!--OWEB displays personalized header codes-->\\n\"", ";", "//Displaying all other headers", "foreach", "(", "$", "this", "->", "other_headers", "as", "$", "id", "=>", "$", "h", ")", "{", "$", "s", ".=", "$", "h", "->", "getCode", "(", "$", "id", ")", ";", "}", "return", "$", "s", ";", "}" ]
Returns the string that the display function would display. @return String The headers that has been added as a String.
[ "Returns", "the", "string", "that", "the", "display", "function", "would", "display", "." ]
fb441f51afb16860b0c946a55c36c789fbb125fa
https://github.com/OWeb/OWeb-Framework/blob/fb441f51afb16860b0c946a55c36c789fbb125fa/OWeb/manage/Headers.php#L185-L207
1,005
sebardo/ecommerce
EcommerceBundle/Controller/InvoiceController.php
InvoiceController.listJsonAction
public function listJsonAction() { $em = $this->getDoctrine()->getManager(); /** @var \Kitchenit\AdminBundle\Services\DataTables\JsonList $jsonList */ $jsonList = $this->get('json_list'); $jsonList->setRepository($em->getRepository('EcommerceBundle:Invoice')); $response = $jsonList->get(); return new JsonResponse($response); }
php
public function listJsonAction() { $em = $this->getDoctrine()->getManager(); /** @var \Kitchenit\AdminBundle\Services\DataTables\JsonList $jsonList */ $jsonList = $this->get('json_list'); $jsonList->setRepository($em->getRepository('EcommerceBundle:Invoice')); $response = $jsonList->get(); return new JsonResponse($response); }
[ "public", "function", "listJsonAction", "(", ")", "{", "$", "em", "=", "$", "this", "->", "getDoctrine", "(", ")", "->", "getManager", "(", ")", ";", "/** @var \\Kitchenit\\AdminBundle\\Services\\DataTables\\JsonList $jsonList */", "$", "jsonList", "=", "$", "this", "->", "get", "(", "'json_list'", ")", ";", "$", "jsonList", "->", "setRepository", "(", "$", "em", "->", "getRepository", "(", "'EcommerceBundle:Invoice'", ")", ")", ";", "$", "response", "=", "$", "jsonList", "->", "get", "(", ")", ";", "return", "new", "JsonResponse", "(", "$", "response", ")", ";", "}" ]
Returns a list of Invoice entities in JSON format. @return JsonResponse @Route("/list.{_format}", requirements={ "_format" = "json" }, defaults={ "_format" = "json" }) @Method("GET")
[ "Returns", "a", "list", "of", "Invoice", "entities", "in", "JSON", "format", "." ]
3e17545e69993f10a1df17f9887810c7378fc7f9
https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/InvoiceController.php#L46-L57
1,006
sebardo/ecommerce
EcommerceBundle/Controller/InvoiceController.php
InvoiceController.showAction
public function showAction(Request $request, $id) { $em = $this->getDoctrine()->getManager(); /** @var Invoice $entity */ $invoice = $em->getRepository('EcommerceBundle:Invoice')->find($id); if (!$invoice) { throw $this->createNotFoundException('Unable to find Invoice entity.'); } // download invoice if (!$invoice || false === $this->container->get('checkout_manager')->isCurrentUserOwner($invoice->getTransaction())) { throw new AccessDeniedException(); } /** @var CheckoutManager $checkoutManager */ $checkoutManager = $this->container->get('checkout_manager'); $delivery = $invoice->getTransaction()->getDelivery(); $totals = $checkoutManager->calculateTotals($invoice->getTransaction(), $delivery); if ('true' === $request->get('download')) { $html = $this->container->get('templating')->render('EcommerceBundle:Profile:Invoice/download.html.twig', array( 'delivery' => $delivery, 'invoice' => $invoice, 'totals' => $totals, )); $html2pdf = $this->get('html2pdf_factory')->create(); $html2pdf->WriteHTML($html); return new Response( $html2pdf->Output('invoice'.$invoice->getInvoiceNumber().'.pdf'), 200, array( 'Content-Type' => 'application/pdf', 'Content-Disposition' => 'attachment; filename="invoice'.$invoice->getInvoiceNumber().'.pdf"' ) ); } return array( 'entity' => $invoice, 'totals' => $totals, ); }
php
public function showAction(Request $request, $id) { $em = $this->getDoctrine()->getManager(); /** @var Invoice $entity */ $invoice = $em->getRepository('EcommerceBundle:Invoice')->find($id); if (!$invoice) { throw $this->createNotFoundException('Unable to find Invoice entity.'); } // download invoice if (!$invoice || false === $this->container->get('checkout_manager')->isCurrentUserOwner($invoice->getTransaction())) { throw new AccessDeniedException(); } /** @var CheckoutManager $checkoutManager */ $checkoutManager = $this->container->get('checkout_manager'); $delivery = $invoice->getTransaction()->getDelivery(); $totals = $checkoutManager->calculateTotals($invoice->getTransaction(), $delivery); if ('true' === $request->get('download')) { $html = $this->container->get('templating')->render('EcommerceBundle:Profile:Invoice/download.html.twig', array( 'delivery' => $delivery, 'invoice' => $invoice, 'totals' => $totals, )); $html2pdf = $this->get('html2pdf_factory')->create(); $html2pdf->WriteHTML($html); return new Response( $html2pdf->Output('invoice'.$invoice->getInvoiceNumber().'.pdf'), 200, array( 'Content-Type' => 'application/pdf', 'Content-Disposition' => 'attachment; filename="invoice'.$invoice->getInvoiceNumber().'.pdf"' ) ); } return array( 'entity' => $invoice, 'totals' => $totals, ); }
[ "public", "function", "showAction", "(", "Request", "$", "request", ",", "$", "id", ")", "{", "$", "em", "=", "$", "this", "->", "getDoctrine", "(", ")", "->", "getManager", "(", ")", ";", "/** @var Invoice $entity */", "$", "invoice", "=", "$", "em", "->", "getRepository", "(", "'EcommerceBundle:Invoice'", ")", "->", "find", "(", "$", "id", ")", ";", "if", "(", "!", "$", "invoice", ")", "{", "throw", "$", "this", "->", "createNotFoundException", "(", "'Unable to find Invoice entity.'", ")", ";", "}", "// download invoice", "if", "(", "!", "$", "invoice", "||", "false", "===", "$", "this", "->", "container", "->", "get", "(", "'checkout_manager'", ")", "->", "isCurrentUserOwner", "(", "$", "invoice", "->", "getTransaction", "(", ")", ")", ")", "{", "throw", "new", "AccessDeniedException", "(", ")", ";", "}", "/** @var CheckoutManager $checkoutManager */", "$", "checkoutManager", "=", "$", "this", "->", "container", "->", "get", "(", "'checkout_manager'", ")", ";", "$", "delivery", "=", "$", "invoice", "->", "getTransaction", "(", ")", "->", "getDelivery", "(", ")", ";", "$", "totals", "=", "$", "checkoutManager", "->", "calculateTotals", "(", "$", "invoice", "->", "getTransaction", "(", ")", ",", "$", "delivery", ")", ";", "if", "(", "'true'", "===", "$", "request", "->", "get", "(", "'download'", ")", ")", "{", "$", "html", "=", "$", "this", "->", "container", "->", "get", "(", "'templating'", ")", "->", "render", "(", "'EcommerceBundle:Profile:Invoice/download.html.twig'", ",", "array", "(", "'delivery'", "=>", "$", "delivery", ",", "'invoice'", "=>", "$", "invoice", ",", "'totals'", "=>", "$", "totals", ",", ")", ")", ";", "$", "html2pdf", "=", "$", "this", "->", "get", "(", "'html2pdf_factory'", ")", "->", "create", "(", ")", ";", "$", "html2pdf", "->", "WriteHTML", "(", "$", "html", ")", ";", "return", "new", "Response", "(", "$", "html2pdf", "->", "Output", "(", "'invoice'", ".", "$", "invoice", "->", "getInvoiceNumber", "(", ")", ".", "'.pdf'", ")", ",", "200", ",", "array", "(", "'Content-Type'", "=>", "'application/pdf'", ",", "'Content-Disposition'", "=>", "'attachment; filename=\"invoice'", ".", "$", "invoice", "->", "getInvoiceNumber", "(", ")", ".", "'.pdf\"'", ")", ")", ";", "}", "return", "array", "(", "'entity'", "=>", "$", "invoice", ",", "'totals'", "=>", "$", "totals", ",", ")", ";", "}" ]
Finds and displays an Invoice entity. @param int $id The entity id @throws NotFoundHttpException @return array @Route("/{id}") @Method("GET") @Template()
[ "Finds", "and", "displays", "an", "Invoice", "entity", "." ]
3e17545e69993f10a1df17f9887810c7378fc7f9
https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/InvoiceController.php#L95-L141
1,007
slickframework/orm
src/Descriptor/Field/FieldDescriptor.php
FieldDescriptor.getField
public function getField() { $value = $this->name; if (null != $this->field) { $value = $this->field; } return $value; }
php
public function getField() { $value = $this->name; if (null != $this->field) { $value = $this->field; } return $value; }
[ "public", "function", "getField", "(", ")", "{", "$", "value", "=", "$", "this", "->", "name", ";", "if", "(", "null", "!=", "$", "this", "->", "field", ")", "{", "$", "value", "=", "$", "this", "->", "field", ";", "}", "return", "$", "value", ";", "}" ]
Gets the field name @return string
[ "Gets", "the", "field", "name" ]
c5c782f5e3a46cdc6c934eda4411cb9edc48f969
https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Descriptor/Field/FieldDescriptor.php#L101-L108
1,008
ischenko/yii2-jsloader
src/base/Config.php
Config.setAliases
public function setAliases(array $aliases) { foreach ($aliases as $name => $alias) { if (!($module = $this->getModule($name))) { $module = $this->addModule($name); } $module->setAlias($alias); } return $this; }
php
public function setAliases(array $aliases) { foreach ($aliases as $name => $alias) { if (!($module = $this->getModule($name))) { $module = $this->addModule($name); } $module->setAlias($alias); } return $this; }
[ "public", "function", "setAliases", "(", "array", "$", "aliases", ")", "{", "foreach", "(", "$", "aliases", "as", "$", "name", "=>", "$", "alias", ")", "{", "if", "(", "!", "(", "$", "module", "=", "$", "this", "->", "getModule", "(", "$", "name", ")", ")", ")", "{", "$", "module", "=", "$", "this", "->", "addModule", "(", "$", "name", ")", ";", "}", "$", "module", "->", "setAlias", "(", "$", "alias", ")", ";", "}", "return", "$", "this", ";", "}" ]
Sets aliases for modules @param array $aliases a list of aliases, where keys are modules name and value is an alias @return $this
[ "Sets", "aliases", "for", "modules" ]
873242c4ab80eb160519d8ba0c4afb92aa89edfb
https://github.com/ischenko/yii2-jsloader/blob/873242c4ab80eb160519d8ba0c4afb92aa89edfb/src/base/Config.php#L47-L58
1,009
ischenko/yii2-jsloader
src/base/Config.php
Config.addModule
public function addModule($module) { if (!($module instanceof ModuleInterface)) { $module = new Module($module); } return ($this->modules[$module->getName()] = $module); }
php
public function addModule($module) { if (!($module instanceof ModuleInterface)) { $module = new Module($module); } return ($this->modules[$module->getName()] = $module); }
[ "public", "function", "addModule", "(", "$", "module", ")", "{", "if", "(", "!", "(", "$", "module", "instanceof", "ModuleInterface", ")", ")", "{", "$", "module", "=", "new", "Module", "(", "$", "module", ")", ";", "}", "return", "(", "$", "this", "->", "modules", "[", "$", "module", "->", "getName", "(", ")", "]", "=", "$", "module", ")", ";", "}" ]
Adds new module into configuration If passed a string a new module will be created if it does not exist yet @param ModuleInterface|string $module an instance of module to be added or name of a module to be created and added @return ModuleInterface
[ "Adds", "new", "module", "into", "configuration" ]
873242c4ab80eb160519d8ba0c4afb92aa89edfb
https://github.com/ischenko/yii2-jsloader/blob/873242c4ab80eb160519d8ba0c4afb92aa89edfb/src/base/Config.php#L69-L76
1,010
viktor-melnikov/requester
src/Request.php
Request.setHeader
public function setHeader() { $args = func_get_args(); if (is_array($args[0])) { foreach ($args[0] as $key => $value) $this->headers['headers'][$key] = $value; } else { $this->headers['headers'][$args[0]] = $args[1]; } return $this; }
php
public function setHeader() { $args = func_get_args(); if (is_array($args[0])) { foreach ($args[0] as $key => $value) $this->headers['headers'][$key] = $value; } else { $this->headers['headers'][$args[0]] = $args[1]; } return $this; }
[ "public", "function", "setHeader", "(", ")", "{", "$", "args", "=", "func_get_args", "(", ")", ";", "if", "(", "is_array", "(", "$", "args", "[", "0", "]", ")", ")", "{", "foreach", "(", "$", "args", "[", "0", "]", "as", "$", "key", "=>", "$", "value", ")", "$", "this", "->", "headers", "[", "'headers'", "]", "[", "$", "key", "]", "=", "$", "value", ";", "}", "else", "{", "$", "this", "->", "headers", "[", "'headers'", "]", "[", "$", "args", "[", "0", "]", "]", "=", "$", "args", "[", "1", "]", ";", "}", "return", "$", "this", ";", "}" ]
Add an additional header to the request Can also use the cleaner syntax of @return $this
[ "Add", "an", "additional", "header", "to", "the", "request", "Can", "also", "use", "the", "cleaner", "syntax", "of" ]
e155bc422374ac4a9b32147bbe557f1b6d03e457
https://github.com/viktor-melnikov/requester/blob/e155bc422374ac4a9b32147bbe557f1b6d03e457/src/Request.php#L104-L116
1,011
viktor-melnikov/requester
src/Request.php
Request.setMime
public function setMime($mime) { if (!empty($mime)) { $this->setContentType( Mime::getFullMime($mime) ); } return $this; }
php
public function setMime($mime) { if (!empty($mime)) { $this->setContentType( Mime::getFullMime($mime) ); } return $this; }
[ "public", "function", "setMime", "(", "$", "mime", ")", "{", "if", "(", "!", "empty", "(", "$", "mime", ")", ")", "{", "$", "this", "->", "setContentType", "(", "Mime", "::", "getFullMime", "(", "$", "mime", ")", ")", ";", "}", "return", "$", "this", ";", "}" ]
Helper function to set the Content-Type and Expected as same in one swoop @return Request this @param string $mime mime type to use for content type and expected return type
[ "Helper", "function", "to", "set", "the", "Content", "-", "Type", "and", "Expected", "as", "same", "in", "one", "swoop" ]
e155bc422374ac4a9b32147bbe557f1b6d03e457
https://github.com/viktor-melnikov/requester/blob/e155bc422374ac4a9b32147bbe557f1b6d03e457/src/Request.php#L282-L291
1,012
canis-io/yii2-canis-lib
lib/db/behaviors/Date.php
Date.getHandle
public function getHandle() { $ownerClass = get_class($this->owner); $ownerTable = $ownerClass::tableName(); if (!isset(self::$_handle[$ownerTable])) { self::$_handle[$ownerTable] = []; $ownerClass = get_class($this->owner); $schema = $ownerClass::getTableSchema(); foreach ($schema->columns as $column) { switch ($column->dbType) { case 'date': self::$_handle[$ownerTable][$column->name] = 'date'; break; case 'time'; self::$_handle[$ownerTable][$column->name] = 'time'; break; case 'datetime': self::$_handle[$ownerTable][$column->name] = 'datetime'; break; } } } return self::$_handle[$ownerTable]; }
php
public function getHandle() { $ownerClass = get_class($this->owner); $ownerTable = $ownerClass::tableName(); if (!isset(self::$_handle[$ownerTable])) { self::$_handle[$ownerTable] = []; $ownerClass = get_class($this->owner); $schema = $ownerClass::getTableSchema(); foreach ($schema->columns as $column) { switch ($column->dbType) { case 'date': self::$_handle[$ownerTable][$column->name] = 'date'; break; case 'time'; self::$_handle[$ownerTable][$column->name] = 'time'; break; case 'datetime': self::$_handle[$ownerTable][$column->name] = 'datetime'; break; } } } return self::$_handle[$ownerTable]; }
[ "public", "function", "getHandle", "(", ")", "{", "$", "ownerClass", "=", "get_class", "(", "$", "this", "->", "owner", ")", ";", "$", "ownerTable", "=", "$", "ownerClass", "::", "tableName", "(", ")", ";", "if", "(", "!", "isset", "(", "self", "::", "$", "_handle", "[", "$", "ownerTable", "]", ")", ")", "{", "self", "::", "$", "_handle", "[", "$", "ownerTable", "]", "=", "[", "]", ";", "$", "ownerClass", "=", "get_class", "(", "$", "this", "->", "owner", ")", ";", "$", "schema", "=", "$", "ownerClass", "::", "getTableSchema", "(", ")", ";", "foreach", "(", "$", "schema", "->", "columns", "as", "$", "column", ")", "{", "switch", "(", "$", "column", "->", "dbType", ")", "{", "case", "'date'", ":", "self", "::", "$", "_handle", "[", "$", "ownerTable", "]", "[", "$", "column", "->", "name", "]", "=", "'date'", ";", "break", ";", "case", "'time'", ";", "self", "::", "$", "_handle", "[", "$", "ownerTable", "]", "[", "$", "column", "->", "name", "]", "=", "'time'", ";", "break", ";", "case", "'datetime'", ":", "self", "::", "$", "_handle", "[", "$", "ownerTable", "]", "[", "$", "column", "->", "name", "]", "=", "'datetime'", ";", "break", ";", "}", "}", "}", "return", "self", "::", "$", "_handle", "[", "$", "ownerTable", "]", ";", "}" ]
Get handle. @return [[@doctodo return_type:getHandle]] [[@doctodo return_description:getHandle]]
[ "Get", "handle", "." ]
97d533521f65b084dc805c5f312c364b469142d2
https://github.com/canis-io/yii2-canis-lib/blob/97d533521f65b084dc805c5f312c364b469142d2/lib/db/behaviors/Date.php#L231-L257
1,013
PSESD/chms-common
lib/Auth/AclGenerator.php
AclGenerator.loadModelRules
private function loadModelRules() { foreach ($this->rules['modelRules'] as $modelClass => $modelPolicy) { $resourceId = call_user_func_array($this->config['modelResourceGenerator'], [$modelClass]); $this->acl->addResource(new Resource($resourceId)); $modelAccessPolicy = []; if (isset($modelPolicy['access'])) { $modelAccessPolicy = $modelPolicy['access']; } foreach ($modelAccessPolicy as $ruleSet => $privileges) { foreach ($privileges as $privilege) { $this->enforceRuleset($ruleSet, ['privileges' => $privilege, 'resources' => $resourceId]); } } $this->loadModelFieldPolicy($modelClass, $modelPolicy); } }
php
private function loadModelRules() { foreach ($this->rules['modelRules'] as $modelClass => $modelPolicy) { $resourceId = call_user_func_array($this->config['modelResourceGenerator'], [$modelClass]); $this->acl->addResource(new Resource($resourceId)); $modelAccessPolicy = []; if (isset($modelPolicy['access'])) { $modelAccessPolicy = $modelPolicy['access']; } foreach ($modelAccessPolicy as $ruleSet => $privileges) { foreach ($privileges as $privilege) { $this->enforceRuleset($ruleSet, ['privileges' => $privilege, 'resources' => $resourceId]); } } $this->loadModelFieldPolicy($modelClass, $modelPolicy); } }
[ "private", "function", "loadModelRules", "(", ")", "{", "foreach", "(", "$", "this", "->", "rules", "[", "'modelRules'", "]", "as", "$", "modelClass", "=>", "$", "modelPolicy", ")", "{", "$", "resourceId", "=", "call_user_func_array", "(", "$", "this", "->", "config", "[", "'modelResourceGenerator'", "]", ",", "[", "$", "modelClass", "]", ")", ";", "$", "this", "->", "acl", "->", "addResource", "(", "new", "Resource", "(", "$", "resourceId", ")", ")", ";", "$", "modelAccessPolicy", "=", "[", "]", ";", "if", "(", "isset", "(", "$", "modelPolicy", "[", "'access'", "]", ")", ")", "{", "$", "modelAccessPolicy", "=", "$", "modelPolicy", "[", "'access'", "]", ";", "}", "foreach", "(", "$", "modelAccessPolicy", "as", "$", "ruleSet", "=>", "$", "privileges", ")", "{", "foreach", "(", "$", "privileges", "as", "$", "privilege", ")", "{", "$", "this", "->", "enforceRuleset", "(", "$", "ruleSet", ",", "[", "'privileges'", "=>", "$", "privilege", ",", "'resources'", "=>", "$", "resourceId", "]", ")", ";", "}", "}", "$", "this", "->", "loadModelFieldPolicy", "(", "$", "modelClass", ",", "$", "modelPolicy", ")", ";", "}", "}" ]
Load model rules
[ "Load", "model", "rules" ]
dba29f95de57cb6b1113c169ccb911152b18e288
https://github.com/PSESD/chms-common/blob/dba29f95de57cb6b1113c169ccb911152b18e288/lib/Auth/AclGenerator.php#L148-L164
1,014
PSESD/chms-common
lib/Auth/AclGenerator.php
AclGenerator.loadRouteRules
private function loadRouteRules() { foreach ($this->rules['routeRules'] as $routeAlias => $routeRuleSets) { $resourceId = call_user_func_array($this->config['routeResourceGenerator'], [$routeAlias]); $this->acl->addResource(new Resource($resourceId)); foreach ($routeRuleSets as $ruleSet) { $this->enforceRuleset($ruleSet, ['resources' => $resourceId, 'privileges' => $this->config['routePrivilege']]); } } }
php
private function loadRouteRules() { foreach ($this->rules['routeRules'] as $routeAlias => $routeRuleSets) { $resourceId = call_user_func_array($this->config['routeResourceGenerator'], [$routeAlias]); $this->acl->addResource(new Resource($resourceId)); foreach ($routeRuleSets as $ruleSet) { $this->enforceRuleset($ruleSet, ['resources' => $resourceId, 'privileges' => $this->config['routePrivilege']]); } } }
[ "private", "function", "loadRouteRules", "(", ")", "{", "foreach", "(", "$", "this", "->", "rules", "[", "'routeRules'", "]", "as", "$", "routeAlias", "=>", "$", "routeRuleSets", ")", "{", "$", "resourceId", "=", "call_user_func_array", "(", "$", "this", "->", "config", "[", "'routeResourceGenerator'", "]", ",", "[", "$", "routeAlias", "]", ")", ";", "$", "this", "->", "acl", "->", "addResource", "(", "new", "Resource", "(", "$", "resourceId", ")", ")", ";", "foreach", "(", "$", "routeRuleSets", "as", "$", "ruleSet", ")", "{", "$", "this", "->", "enforceRuleset", "(", "$", "ruleSet", ",", "[", "'resources'", "=>", "$", "resourceId", ",", "'privileges'", "=>", "$", "this", "->", "config", "[", "'routePrivilege'", "]", "]", ")", ";", "}", "}", "}" ]
Load route rules
[ "Load", "route", "rules" ]
dba29f95de57cb6b1113c169ccb911152b18e288
https://github.com/PSESD/chms-common/blob/dba29f95de57cb6b1113c169ccb911152b18e288/lib/Auth/AclGenerator.php#L174-L183
1,015
nirix/radium
src/Util/Inflector.php
Inflector.singularise
public static function singularise($word) { // Run each rule over the word foreach (static::$singularRules as $rule => $replacement) { if (preg_match($rule, $word)) { return preg_replace($rule, $replacement, $word); } } return $word; }
php
public static function singularise($word) { // Run each rule over the word foreach (static::$singularRules as $rule => $replacement) { if (preg_match($rule, $word)) { return preg_replace($rule, $replacement, $word); } } return $word; }
[ "public", "static", "function", "singularise", "(", "$", "word", ")", "{", "// Run each rule over the word", "foreach", "(", "static", "::", "$", "singularRules", "as", "$", "rule", "=>", "$", "replacement", ")", "{", "if", "(", "preg_match", "(", "$", "rule", ",", "$", "word", ")", ")", "{", "return", "preg_replace", "(", "$", "rule", ",", "$", "replacement", ",", "$", "word", ")", ";", "}", "}", "return", "$", "word", ";", "}" ]
Converts the word to singular form. @param string $word @return string
[ "Converts", "the", "word", "to", "singular", "form", "." ]
cc6907bfee296b64a7630b0b188e233d7cdb86fd
https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Util/Inflector.php#L191-L201
1,016
nirix/radium
src/Util/Inflector.php
Inflector.pluralise
public static function pluralise($word) { // Run each rule over the word foreach (static::$pluralRules as $rule => $replacement) { if (preg_match($rule, $word)) { return preg_replace($rule, $replacement, $word); } } return $word; }
php
public static function pluralise($word) { // Run each rule over the word foreach (static::$pluralRules as $rule => $replacement) { if (preg_match($rule, $word)) { return preg_replace($rule, $replacement, $word); } } return $word; }
[ "public", "static", "function", "pluralise", "(", "$", "word", ")", "{", "// Run each rule over the word", "foreach", "(", "static", "::", "$", "pluralRules", "as", "$", "rule", "=>", "$", "replacement", ")", "{", "if", "(", "preg_match", "(", "$", "rule", ",", "$", "word", ")", ")", "{", "return", "preg_replace", "(", "$", "rule", ",", "$", "replacement", ",", "$", "word", ")", ";", "}", "}", "return", "$", "word", ";", "}" ]
Converts the word to plural form. @param string $word @return string
[ "Converts", "the", "word", "to", "plural", "form", "." ]
cc6907bfee296b64a7630b0b188e233d7cdb86fd
https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Util/Inflector.php#L210-L220
1,017
Dhii/data-state-abstract
src/StateAwareAwareTrait.php
StateAwareAwareTrait._setStateAware
protected function _setStateAware($stateAware) { if ($stateAware !== null && !($stateAware instanceof StateAwareInterface)) { throw $this->_createInvalidArgumentException( $this->__('Argument is not a state aware object'), null, null, $stateAware ); } $this->stateAware = $stateAware; }
php
protected function _setStateAware($stateAware) { if ($stateAware !== null && !($stateAware instanceof StateAwareInterface)) { throw $this->_createInvalidArgumentException( $this->__('Argument is not a state aware object'), null, null, $stateAware ); } $this->stateAware = $stateAware; }
[ "protected", "function", "_setStateAware", "(", "$", "stateAware", ")", "{", "if", "(", "$", "stateAware", "!==", "null", "&&", "!", "(", "$", "stateAware", "instanceof", "StateAwareInterface", ")", ")", "{", "throw", "$", "this", "->", "_createInvalidArgumentException", "(", "$", "this", "->", "__", "(", "'Argument is not a state aware object'", ")", ",", "null", ",", "null", ",", "$", "stateAware", ")", ";", "}", "$", "this", "->", "stateAware", "=", "$", "stateAware", ";", "}" ]
Sets the state-aware subject for with this instance. @since [*next-version*] @param StateAwareInterface|null $stateAware The state-aware subject instance.
[ "Sets", "the", "state", "-", "aware", "subject", "for", "with", "this", "instance", "." ]
c335c37a939861659e657b995cfc657bb3bb2733
https://github.com/Dhii/data-state-abstract/blob/c335c37a939861659e657b995cfc657bb3bb2733/src/StateAwareAwareTrait.php#L44-L56
1,018
axypro/magic
ArrayWrapper.php
ArrayWrapper.get
protected function get($key) { if (!array_key_exists($key, $this->source)) { if ($this->errProp) { throw new FieldNotExist($key, $this); } return null; } return $this->source[$key]; }
php
protected function get($key) { if (!array_key_exists($key, $this->source)) { if ($this->errProp) { throw new FieldNotExist($key, $this); } return null; } return $this->source[$key]; }
[ "protected", "function", "get", "(", "$", "key", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "source", ")", ")", "{", "if", "(", "$", "this", "->", "errProp", ")", "{", "throw", "new", "FieldNotExist", "(", "$", "key", ",", "$", "this", ")", ";", "}", "return", "null", ";", "}", "return", "$", "this", "->", "source", "[", "$", "key", "]", ";", "}" ]
Returns an item from the source @param string $key @return mixed @throws \axy\magic\errors\FieldNotExist
[ "Returns", "an", "item", "from", "the", "source" ]
df5c3411d29206c4da80e7e5843d6d876c4e696f
https://github.com/axypro/magic/blob/df5c3411d29206c4da80e7e5843d6d876c4e696f/ArrayWrapper.php#L192-L201
1,019
axypro/magic
ArrayWrapper.php
ArrayWrapper.set
protected function set($key, $value) { if ($this->readonly) { throw new ContainerReadOnly($this); } if ($this->fixed && (!array_key_exists($key, $this->source))) { throw new FieldNotExist($key, $this); } $this->source[$key] = $value; }
php
protected function set($key, $value) { if ($this->readonly) { throw new ContainerReadOnly($this); } if ($this->fixed && (!array_key_exists($key, $this->source))) { throw new FieldNotExist($key, $this); } $this->source[$key] = $value; }
[ "protected", "function", "set", "(", "$", "key", ",", "$", "value", ")", "{", "if", "(", "$", "this", "->", "readonly", ")", "{", "throw", "new", "ContainerReadOnly", "(", "$", "this", ")", ";", "}", "if", "(", "$", "this", "->", "fixed", "&&", "(", "!", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "source", ")", ")", ")", "{", "throw", "new", "FieldNotExist", "(", "$", "key", ",", "$", "this", ")", ";", "}", "$", "this", "->", "source", "[", "$", "key", "]", "=", "$", "value", ";", "}" ]
Sets an item value @param string $key @param mixed $value @throws \axy\magic\errors\ContainerReadOnly @throws \axy\magic\errors\FieldNotExist
[ "Sets", "an", "item", "value" ]
df5c3411d29206c4da80e7e5843d6d876c4e696f
https://github.com/axypro/magic/blob/df5c3411d29206c4da80e7e5843d6d876c4e696f/ArrayWrapper.php#L222-L231
1,020
axypro/magic
ArrayWrapper.php
ArrayWrapper.remove
protected function remove($key) { if ($this->readonly) { throw new ContainerReadOnly($this); } if ($this->errProp) { if (!array_key_exists($key, $this->source)) { throw new FieldNotExist($key, $this); } } if ($this->fixed) { throw new FieldNotExist($key, $this); } unset($this->source[$key]); }
php
protected function remove($key) { if ($this->readonly) { throw new ContainerReadOnly($this); } if ($this->errProp) { if (!array_key_exists($key, $this->source)) { throw new FieldNotExist($key, $this); } } if ($this->fixed) { throw new FieldNotExist($key, $this); } unset($this->source[$key]); }
[ "protected", "function", "remove", "(", "$", "key", ")", "{", "if", "(", "$", "this", "->", "readonly", ")", "{", "throw", "new", "ContainerReadOnly", "(", "$", "this", ")", ";", "}", "if", "(", "$", "this", "->", "errProp", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "source", ")", ")", "{", "throw", "new", "FieldNotExist", "(", "$", "key", ",", "$", "this", ")", ";", "}", "}", "if", "(", "$", "this", "->", "fixed", ")", "{", "throw", "new", "FieldNotExist", "(", "$", "key", ",", "$", "this", ")", ";", "}", "unset", "(", "$", "this", "->", "source", "[", "$", "key", "]", ")", ";", "}" ]
Removes an item from the source array @param string $key @throws \axy\magic\errors\ContainerReadOnly @throws \axy\magic\errors\FieldNotExist
[ "Removes", "an", "item", "from", "the", "source", "array" ]
df5c3411d29206c4da80e7e5843d6d876c4e696f
https://github.com/axypro/magic/blob/df5c3411d29206c4da80e7e5843d6d876c4e696f/ArrayWrapper.php#L240-L254
1,021
znframework/package-generator
File.php
File.getEncapsulationType
protected function getEncapsulationType(&$variable, &$priority, &$static) { $static = NULL; if( preg_match('/^((?<type>public|protected|private)(?<access>\sstatic)*\:)/', $variable, $match) ) { $priority = $match['type']; $static = $match['access'] ?? $static; $variable = str_ireplace($match[1], NULL, $variable); } else { $priority = 'public'; } }
php
protected function getEncapsulationType(&$variable, &$priority, &$static) { $static = NULL; if( preg_match('/^((?<type>public|protected|private)(?<access>\sstatic)*\:)/', $variable, $match) ) { $priority = $match['type']; $static = $match['access'] ?? $static; $variable = str_ireplace($match[1], NULL, $variable); } else { $priority = 'public'; } }
[ "protected", "function", "getEncapsulationType", "(", "&", "$", "variable", ",", "&", "$", "priority", ",", "&", "$", "static", ")", "{", "$", "static", "=", "NULL", ";", "if", "(", "preg_match", "(", "'/^((?<type>public|protected|private)(?<access>\\sstatic)*\\:)/'", ",", "$", "variable", ",", "$", "match", ")", ")", "{", "$", "priority", "=", "$", "match", "[", "'type'", "]", ";", "$", "static", "=", "$", "match", "[", "'access'", "]", "??", "$", "static", ";", "$", "variable", "=", "str_ireplace", "(", "$", "match", "[", "1", "]", ",", "NULL", ",", "$", "variable", ")", ";", "}", "else", "{", "$", "priority", "=", "'public'", ";", "}", "}" ]
Protected get encapsulation type
[ "Protected", "get", "encapsulation", "type" ]
4524c28c607d8a5799b60bd39bee8be4fd1e7fba
https://github.com/znframework/package-generator/blob/4524c28c607d8a5799b60bd39bee8be4fd1e7fba/File.php#L408-L422
1,022
cityware/city-snmp
src/MIBS/Cisco/SMST.php
SMST.vlansMapped
public function vlansMapped( $instanceID = false ) { $vlansMapped = []; $instances1k2k = $this->getSNMP()->walk1d( self::OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_1K2K ); $instances3k4k = $this->getSNMP()->walk1d( self::OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_3K4K ); if( $instanceID ) { foreach( $instances1k2k as $id => $instances ) if( $id != $instanceID ) unset( $instances1k2k[ $id ] ); foreach( $instances3k4k as $id => $instances ) if( $id != $instanceID ) unset( $instances3k4k[ $id ] ); } foreach( [ -1 => $instances1k2k, 2047 => $instances3k4k ] as $offset => $instances ) { foreach( $instances as $instanceId => $mapped ) { $mapped = $this->getSNMP()->ppHexStringFlags( $mapped ); foreach( $mapped as $vlanid => $flag ) { // Cisco seems to be returning some crud. Strip it out: if( $vlanid + $offset <= 0 || $vlanid + $offset > 4094 ) continue; $vlansMapped[ $instanceId ][ $vlanid + $offset ] = $flag; } } } if( $instanceID ) $vlansMapped = $vlansMapped[ $instanceID ]; return $vlansMapped; }
php
public function vlansMapped( $instanceID = false ) { $vlansMapped = []; $instances1k2k = $this->getSNMP()->walk1d( self::OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_1K2K ); $instances3k4k = $this->getSNMP()->walk1d( self::OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_3K4K ); if( $instanceID ) { foreach( $instances1k2k as $id => $instances ) if( $id != $instanceID ) unset( $instances1k2k[ $id ] ); foreach( $instances3k4k as $id => $instances ) if( $id != $instanceID ) unset( $instances3k4k[ $id ] ); } foreach( [ -1 => $instances1k2k, 2047 => $instances3k4k ] as $offset => $instances ) { foreach( $instances as $instanceId => $mapped ) { $mapped = $this->getSNMP()->ppHexStringFlags( $mapped ); foreach( $mapped as $vlanid => $flag ) { // Cisco seems to be returning some crud. Strip it out: if( $vlanid + $offset <= 0 || $vlanid + $offset > 4094 ) continue; $vlansMapped[ $instanceId ][ $vlanid + $offset ] = $flag; } } } if( $instanceID ) $vlansMapped = $vlansMapped[ $instanceID ]; return $vlansMapped; }
[ "public", "function", "vlansMapped", "(", "$", "instanceID", "=", "false", ")", "{", "$", "vlansMapped", "=", "[", "]", ";", "$", "instances1k2k", "=", "$", "this", "->", "getSNMP", "(", ")", "->", "walk1d", "(", "self", "::", "OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_1K2K", ")", ";", "$", "instances3k4k", "=", "$", "this", "->", "getSNMP", "(", ")", "->", "walk1d", "(", "self", "::", "OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_3K4K", ")", ";", "if", "(", "$", "instanceID", ")", "{", "foreach", "(", "$", "instances1k2k", "as", "$", "id", "=>", "$", "instances", ")", "if", "(", "$", "id", "!=", "$", "instanceID", ")", "unset", "(", "$", "instances1k2k", "[", "$", "id", "]", ")", ";", "foreach", "(", "$", "instances3k4k", "as", "$", "id", "=>", "$", "instances", ")", "if", "(", "$", "id", "!=", "$", "instanceID", ")", "unset", "(", "$", "instances3k4k", "[", "$", "id", "]", ")", ";", "}", "foreach", "(", "[", "-", "1", "=>", "$", "instances1k2k", ",", "2047", "=>", "$", "instances3k4k", "]", "as", "$", "offset", "=>", "$", "instances", ")", "{", "foreach", "(", "$", "instances", "as", "$", "instanceId", "=>", "$", "mapped", ")", "{", "$", "mapped", "=", "$", "this", "->", "getSNMP", "(", ")", "->", "ppHexStringFlags", "(", "$", "mapped", ")", ";", "foreach", "(", "$", "mapped", "as", "$", "vlanid", "=>", "$", "flag", ")", "{", "// Cisco seems to be returning some crud. Strip it out:", "if", "(", "$", "vlanid", "+", "$", "offset", "<=", "0", "||", "$", "vlanid", "+", "$", "offset", ">", "4094", ")", "continue", ";", "$", "vlansMapped", "[", "$", "instanceId", "]", "[", "$", "vlanid", "+", "$", "offset", "]", "=", "$", "flag", ";", "}", "}", "}", "if", "(", "$", "instanceID", ")", "$", "vlansMapped", "=", "$", "vlansMapped", "[", "$", "instanceID", "]", ";", "return", "$", "vlansMapped", ";", "}" ]
Return array of MST instances containing an array of mapped VLANs The form of the returned array is: [ $mstInstanceId => [ $vlanTag => true / false, $vlanTag => true / false, ... ], ... ] If a VLAN tag is not present in the array of VLANs, then it is not a member of that MST instance. @see vlansMappedAsRanges() @param int $instanceId Limit results to a single instance ID (returned array is just vlans) @return Array as described above.
[ "Return", "array", "of", "MST", "instances", "containing", "an", "array", "of", "mapped", "VLANs" ]
831b7485b6c932a84f081d5ceeb9c5f4e7a8641d
https://github.com/cityware/city-snmp/blob/831b7485b6c932a84f081d5ceeb9c5f4e7a8641d/src/MIBS/Cisco/SMST.php#L82-L120
1,023
cityware/city-snmp
src/MIBS/Cisco/SMST.php
SMST.vlansMappedAsRanges
public function vlansMappedAsRanges( $instanceID = false ) { $vlansMapped = $this->vlansMapped( $instanceID ); if ( $instanceID ) $vlansMapped[ $instanceID ] = $vlansMapped; $ranges = []; // big loop to turn sequential VLANs into ranges // FIXME extract as utility function? foreach( $vlansMapped as $id => $mapped ) { $start = false; $inc = false; foreach( $mapped as $vid => $flag ) { if( $flag ) { if( !$start ) { $start = $vid; $inc = $vid; continue; } if( $vid - $inc == 1 ) { $inc++; continue; } if( $vid - $inc != 1 ) { if( $start == $inc ) $ranges[ $id ][] = $start; else $ranges[ $id ][] = "{$start}-{$inc}"; $start = false; continue; } } else { if( !$start ) continue; else { if( $start == $inc ) $ranges[ $id ][] = $start; else $ranges[ $id ][] = "{$start}-{$inc}"; $start = false; continue; } } } if( $start ) { if( $start == $inc ) $ranges[ $id ][] = $start; else $ranges[ $id ][] = "{$start}-{$inc}"; } } if( $instanceID ) return $ranges[ $instanceID ]; return $ranges; }
php
public function vlansMappedAsRanges( $instanceID = false ) { $vlansMapped = $this->vlansMapped( $instanceID ); if ( $instanceID ) $vlansMapped[ $instanceID ] = $vlansMapped; $ranges = []; // big loop to turn sequential VLANs into ranges // FIXME extract as utility function? foreach( $vlansMapped as $id => $mapped ) { $start = false; $inc = false; foreach( $mapped as $vid => $flag ) { if( $flag ) { if( !$start ) { $start = $vid; $inc = $vid; continue; } if( $vid - $inc == 1 ) { $inc++; continue; } if( $vid - $inc != 1 ) { if( $start == $inc ) $ranges[ $id ][] = $start; else $ranges[ $id ][] = "{$start}-{$inc}"; $start = false; continue; } } else { if( !$start ) continue; else { if( $start == $inc ) $ranges[ $id ][] = $start; else $ranges[ $id ][] = "{$start}-{$inc}"; $start = false; continue; } } } if( $start ) { if( $start == $inc ) $ranges[ $id ][] = $start; else $ranges[ $id ][] = "{$start}-{$inc}"; } } if( $instanceID ) return $ranges[ $instanceID ]; return $ranges; }
[ "public", "function", "vlansMappedAsRanges", "(", "$", "instanceID", "=", "false", ")", "{", "$", "vlansMapped", "=", "$", "this", "->", "vlansMapped", "(", "$", "instanceID", ")", ";", "if", "(", "$", "instanceID", ")", "$", "vlansMapped", "[", "$", "instanceID", "]", "=", "$", "vlansMapped", ";", "$", "ranges", "=", "[", "]", ";", "// big loop to turn sequential VLANs into ranges", "// FIXME extract as utility function?", "foreach", "(", "$", "vlansMapped", "as", "$", "id", "=>", "$", "mapped", ")", "{", "$", "start", "=", "false", ";", "$", "inc", "=", "false", ";", "foreach", "(", "$", "mapped", "as", "$", "vid", "=>", "$", "flag", ")", "{", "if", "(", "$", "flag", ")", "{", "if", "(", "!", "$", "start", ")", "{", "$", "start", "=", "$", "vid", ";", "$", "inc", "=", "$", "vid", ";", "continue", ";", "}", "if", "(", "$", "vid", "-", "$", "inc", "==", "1", ")", "{", "$", "inc", "++", ";", "continue", ";", "}", "if", "(", "$", "vid", "-", "$", "inc", "!=", "1", ")", "{", "if", "(", "$", "start", "==", "$", "inc", ")", "$", "ranges", "[", "$", "id", "]", "[", "]", "=", "$", "start", ";", "else", "$", "ranges", "[", "$", "id", "]", "[", "]", "=", "\"{$start}-{$inc}\"", ";", "$", "start", "=", "false", ";", "continue", ";", "}", "}", "else", "{", "if", "(", "!", "$", "start", ")", "continue", ";", "else", "{", "if", "(", "$", "start", "==", "$", "inc", ")", "$", "ranges", "[", "$", "id", "]", "[", "]", "=", "$", "start", ";", "else", "$", "ranges", "[", "$", "id", "]", "[", "]", "=", "\"{$start}-{$inc}\"", ";", "$", "start", "=", "false", ";", "continue", ";", "}", "}", "}", "if", "(", "$", "start", ")", "{", "if", "(", "$", "start", "==", "$", "inc", ")", "$", "ranges", "[", "$", "id", "]", "[", "]", "=", "$", "start", ";", "else", "$", "ranges", "[", "$", "id", "]", "[", "]", "=", "\"{$start}-{$inc}\"", ";", "}", "}", "if", "(", "$", "instanceID", ")", "return", "$", "ranges", "[", "$", "instanceID", "]", ";", "return", "$", "ranges", ";", "}" ]
Return array of MST instances containing an array of mapped VLAN ranges The form of the returned array is: [ $mstInstanceId => [ 500-599, 3000-4094, ... ], ... ] Example usage: foreach( $ports as $id => $portConf ) { echo sprintf( "%-16s - %-8s:\t", $portConf['host'], $portConf['port'] ); echo $hosts[ $portConf['host'] ]->useIface()->operationStates( true )[ $portNameToIndex[ $portConf['host'] ][ $portConf['port'] ] ] . "\n"; } Which results in (for example): MST0 vlans mapped: 1-299,400-499,600-799,900-999,1800-4094 MST1 vlans mapped: 300-399 MST2 vlans mapped: 500-599,800-899,1000-1099,1300-1499 MST3 vlans mapped: 1500-1599 MST4 vlans mapped: 1100-1199 MST5 vlans mapped: 1200-1299 MST6 vlans mapped: 1600-1799 @see vlansMapped() @param int $instanceId Limit results to a single instance ID (returned array is one dimensional) @return Array as described above.
[ "Return", "array", "of", "MST", "instances", "containing", "an", "array", "of", "mapped", "VLAN", "ranges" ]
831b7485b6c932a84f081d5ceeb9c5f4e7a8641d
https://github.com/cityware/city-snmp/blob/831b7485b6c932a84f081d5ceeb9c5f4e7a8641d/src/MIBS/Cisco/SMST.php#L160-L236
1,024
cityware/city-snmp
src/MIBS/Cisco/SMST.php
SMST.instances
public function instances( $name = null ) { if( $name === null ) $name = $this->getSNMP()->useCisco_MST()->regionName() . '.'; $hops = $this->remainingHopCount(); $instances = []; foreach( $hops as $i => $h ) if( $h != -1 ) $instances[ $i ] = "{$name}{$i}"; return $instances; }
php
public function instances( $name = null ) { if( $name === null ) $name = $this->getSNMP()->useCisco_MST()->regionName() . '.'; $hops = $this->remainingHopCount(); $instances = []; foreach( $hops as $i => $h ) if( $h != -1 ) $instances[ $i ] = "{$name}{$i}"; return $instances; }
[ "public", "function", "instances", "(", "$", "name", "=", "null", ")", "{", "if", "(", "$", "name", "===", "null", ")", "$", "name", "=", "$", "this", "->", "getSNMP", "(", ")", "->", "useCisco_MST", "(", ")", "->", "regionName", "(", ")", ".", "'.'", ";", "$", "hops", "=", "$", "this", "->", "remainingHopCount", "(", ")", ";", "$", "instances", "=", "[", "]", ";", "foreach", "(", "$", "hops", "as", "$", "i", "=>", "$", "h", ")", "if", "(", "$", "h", "!=", "-", "1", ")", "$", "instances", "[", "$", "i", "]", "=", "\"{$name}{$i}\"", ";", "return", "$", "instances", ";", "}" ]
Returns an array of running MST instances. This is a hack on the remainingHopCount() as the MIB of this is empty on my test box (.1.3.6.1.4.1.9.9.82.1.14.5.1.1) We name the instances as well based on the region name / use specified string. @param string $name If null, then instances are named using the MST region name. Else this is the root of the name. @return array The running MST instances
[ "Returns", "an", "array", "of", "running", "MST", "instances", "." ]
831b7485b6c932a84f081d5ceeb9c5f4e7a8641d
https://github.com/cityware/city-snmp/blob/831b7485b6c932a84f081d5ceeb9c5f4e7a8641d/src/MIBS/Cisco/SMST.php#L266-L279
1,025
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.throwServiceExceptionIfDetected
public static function throwServiceExceptionIfDetected($e) { // Check to make sure that there actually response! // This can happen if the connection dies before the request // completes. (See ZF-5949) $response = $e->getResponse(); if (!$response) { require_once('Zend/Gdata/App/IOException.php'); throw new Zend_Gdata_App_IOException('No HTTP response received (possible connection failure)'); } try { // Check to see if there is an AppsForYourDomainErrors // datastructure in the response. If so, convert it to // an exception and throw it. require_once 'Zend/Gdata/Gapps/ServiceException.php'; $error = new Zend_Gdata_Gapps_ServiceException(); $error->importFromString($response->getBody()); throw $error; } catch (Zend_Gdata_App_Exception $e2) { // Unable to convert the response to a ServiceException, // most likely because the server didn't return an // AppsForYourDomainErrors document. Throw the original // exception. throw $e; } }
php
public static function throwServiceExceptionIfDetected($e) { // Check to make sure that there actually response! // This can happen if the connection dies before the request // completes. (See ZF-5949) $response = $e->getResponse(); if (!$response) { require_once('Zend/Gdata/App/IOException.php'); throw new Zend_Gdata_App_IOException('No HTTP response received (possible connection failure)'); } try { // Check to see if there is an AppsForYourDomainErrors // datastructure in the response. If so, convert it to // an exception and throw it. require_once 'Zend/Gdata/Gapps/ServiceException.php'; $error = new Zend_Gdata_Gapps_ServiceException(); $error->importFromString($response->getBody()); throw $error; } catch (Zend_Gdata_App_Exception $e2) { // Unable to convert the response to a ServiceException, // most likely because the server didn't return an // AppsForYourDomainErrors document. Throw the original // exception. throw $e; } }
[ "public", "static", "function", "throwServiceExceptionIfDetected", "(", "$", "e", ")", "{", "// Check to make sure that there actually response!", "// This can happen if the connection dies before the request", "// completes. (See ZF-5949)", "$", "response", "=", "$", "e", "->", "getResponse", "(", ")", ";", "if", "(", "!", "$", "response", ")", "{", "require_once", "(", "'Zend/Gdata/App/IOException.php'", ")", ";", "throw", "new", "Zend_Gdata_App_IOException", "(", "'No HTTP response received (possible connection failure)'", ")", ";", "}", "try", "{", "// Check to see if there is an AppsForYourDomainErrors", "// datastructure in the response. If so, convert it to", "// an exception and throw it.", "require_once", "'Zend/Gdata/Gapps/ServiceException.php'", ";", "$", "error", "=", "new", "Zend_Gdata_Gapps_ServiceException", "(", ")", ";", "$", "error", "->", "importFromString", "(", "$", "response", "->", "getBody", "(", ")", ")", ";", "throw", "$", "error", ";", "}", "catch", "(", "Zend_Gdata_App_Exception", "$", "e2", ")", "{", "// Unable to convert the response to a ServiceException,", "// most likely because the server didn't return an", "// AppsForYourDomainErrors document. Throw the original", "// exception.", "throw", "$", "e", ";", "}", "}" ]
Convert an exception to an ServiceException if an AppsForYourDomain XML document is contained within the original exception's HTTP response. If conversion fails, throw the original error. @param Zend_Gdata_Exception $e The exception to convert. @throws Zend_Gdata_Gapps_ServiceException @throws mixed
[ "Convert", "an", "exception", "to", "an", "ServiceException", "if", "an", "AppsForYourDomain", "XML", "document", "is", "contained", "within", "the", "original", "exception", "s", "HTTP", "response", ".", "If", "conversion", "fails", "throw", "the", "original", "error", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L156-L181
1,026
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.get
public function get($uri, $extraHeaders = array()) { try { return parent::get($uri, $extraHeaders); } catch (Zend_Gdata_App_HttpException $e) { self::throwServiceExceptionIfDetected($e); } }
php
public function get($uri, $extraHeaders = array()) { try { return parent::get($uri, $extraHeaders); } catch (Zend_Gdata_App_HttpException $e) { self::throwServiceExceptionIfDetected($e); } }
[ "public", "function", "get", "(", "$", "uri", ",", "$", "extraHeaders", "=", "array", "(", ")", ")", "{", "try", "{", "return", "parent", "::", "get", "(", "$", "uri", ",", "$", "extraHeaders", ")", ";", "}", "catch", "(", "Zend_Gdata_App_HttpException", "$", "e", ")", "{", "self", "::", "throwServiceExceptionIfDetected", "(", "$", "e", ")", ";", "}", "}" ]
GET a URI using client object. This method overrides the default behavior of Zend_Gdata_App, providing support for Zend_Gdata_Gapps_ServiceException. @param string $uri GET URI @param array $extraHeaders Extra headers to add to the request, as an array of string-based key/value pairs. @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException @return Zend_Http_Response
[ "GET", "a", "URI", "using", "client", "object", ".", "This", "method", "overrides", "the", "default", "behavior", "of", "Zend_Gdata_App", "providing", "support", "for", "Zend_Gdata_Gapps_ServiceException", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L219-L226
1,027
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.post
public function post($data, $uri = null, $remainingRedirects = null, $contentType = null, $extraHeaders = null) { try { return parent::post($data, $uri, $remainingRedirects, $contentType, $extraHeaders); } catch (Zend_Gdata_App_HttpException $e) { self::throwServiceExceptionIfDetected($e); } }
php
public function post($data, $uri = null, $remainingRedirects = null, $contentType = null, $extraHeaders = null) { try { return parent::post($data, $uri, $remainingRedirects, $contentType, $extraHeaders); } catch (Zend_Gdata_App_HttpException $e) { self::throwServiceExceptionIfDetected($e); } }
[ "public", "function", "post", "(", "$", "data", ",", "$", "uri", "=", "null", ",", "$", "remainingRedirects", "=", "null", ",", "$", "contentType", "=", "null", ",", "$", "extraHeaders", "=", "null", ")", "{", "try", "{", "return", "parent", "::", "post", "(", "$", "data", ",", "$", "uri", ",", "$", "remainingRedirects", ",", "$", "contentType", ",", "$", "extraHeaders", ")", ";", "}", "catch", "(", "Zend_Gdata_App_HttpException", "$", "e", ")", "{", "self", "::", "throwServiceExceptionIfDetected", "(", "$", "e", ")", ";", "}", "}" ]
POST data with client object. This method overrides the default behavior of Zend_Gdata_App, providing support for Zend_Gdata_Gapps_ServiceException. @param mixed $data The Zend_Gdata_App_Entry or XML to post @param string $uri (optional) POST URI @param integer $remainingRedirects (optional) @param string $contentType Content-type of the data @param array $extraHaders Extra headers to add tot he request @return Zend_Http_Response @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_App_InvalidArgumentException @throws Zend_Gdata_Gapps_ServiceException
[ "POST", "data", "with", "client", "object", ".", "This", "method", "overrides", "the", "default", "behavior", "of", "Zend_Gdata_App", "providing", "support", "for", "Zend_Gdata_Gapps_ServiceException", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L243-L251
1,028
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.delete
public function delete($data, $remainingRedirects = null) { try { return parent::delete($data, $remainingRedirects); } catch (Zend_Gdata_App_HttpException $e) { self::throwServiceExceptionIfDetected($e); } }
php
public function delete($data, $remainingRedirects = null) { try { return parent::delete($data, $remainingRedirects); } catch (Zend_Gdata_App_HttpException $e) { self::throwServiceExceptionIfDetected($e); } }
[ "public", "function", "delete", "(", "$", "data", ",", "$", "remainingRedirects", "=", "null", ")", "{", "try", "{", "return", "parent", "::", "delete", "(", "$", "data", ",", "$", "remainingRedirects", ")", ";", "}", "catch", "(", "Zend_Gdata_App_HttpException", "$", "e", ")", "{", "self", "::", "throwServiceExceptionIfDetected", "(", "$", "e", ")", ";", "}", "}" ]
DELETE entry with client object This method overrides the default behavior of Zend_Gdata_App, providing support for Zend_Gdata_Gapps_ServiceException. @param mixed $data The Zend_Gdata_App_Entry or URL to delete @param integer $remainingRedirects (optional) @return void @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_App_InvalidArgumentException @throws Zend_Gdata_Gapps_ServiceException
[ "DELETE", "entry", "with", "client", "object", "This", "method", "overrides", "the", "default", "behavior", "of", "Zend_Gdata_App", "providing", "support", "for", "Zend_Gdata_Gapps_ServiceException", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L290-L297
1,029
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.getUserFeed
public function getUserFeed($location = null) { if ($location === null) { $uri = $this->getBaseUrl() . self::APPS_USER_PATH; } else if ($location instanceof Zend_Gdata_Query) { $uri = $location->getQueryUrl(); } else { $uri = $location; } return parent::getFeed($uri, 'Zend_Gdata_Gapps_UserFeed'); }
php
public function getUserFeed($location = null) { if ($location === null) { $uri = $this->getBaseUrl() . self::APPS_USER_PATH; } else if ($location instanceof Zend_Gdata_Query) { $uri = $location->getQueryUrl(); } else { $uri = $location; } return parent::getFeed($uri, 'Zend_Gdata_Gapps_UserFeed'); }
[ "public", "function", "getUserFeed", "(", "$", "location", "=", "null", ")", "{", "if", "(", "$", "location", "===", "null", ")", "{", "$", "uri", "=", "$", "this", "->", "getBaseUrl", "(", ")", ".", "self", "::", "APPS_USER_PATH", ";", "}", "else", "if", "(", "$", "location", "instanceof", "Zend_Gdata_Query", ")", "{", "$", "uri", "=", "$", "location", "->", "getQueryUrl", "(", ")", ";", "}", "else", "{", "$", "uri", "=", "$", "location", ";", "}", "return", "parent", "::", "getFeed", "(", "$", "uri", ",", "'Zend_Gdata_Gapps_UserFeed'", ")", ";", "}" ]
Retrieve a UserFeed containing multiple UserEntry objects. @param mixed $location (optional) The location for the feed, as a URL or Query. @return Zend_Gdata_Gapps_UserFeed @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Retrieve", "a", "UserFeed", "containing", "multiple", "UserEntry", "objects", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L360-L370
1,030
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.getNicknameFeed
public function getNicknameFeed($location = null) { if ($location === null) { $uri = $this->getBaseUrl() . self::APPS_NICKNAME_PATH; } else if ($location instanceof Zend_Gdata_Query) { $uri = $location->getQueryUrl(); } else { $uri = $location; } return parent::getFeed($uri, 'Zend_Gdata_Gapps_NicknameFeed'); }
php
public function getNicknameFeed($location = null) { if ($location === null) { $uri = $this->getBaseUrl() . self::APPS_NICKNAME_PATH; } else if ($location instanceof Zend_Gdata_Query) { $uri = $location->getQueryUrl(); } else { $uri = $location; } return parent::getFeed($uri, 'Zend_Gdata_Gapps_NicknameFeed'); }
[ "public", "function", "getNicknameFeed", "(", "$", "location", "=", "null", ")", "{", "if", "(", "$", "location", "===", "null", ")", "{", "$", "uri", "=", "$", "this", "->", "getBaseUrl", "(", ")", ".", "self", "::", "APPS_NICKNAME_PATH", ";", "}", "else", "if", "(", "$", "location", "instanceof", "Zend_Gdata_Query", ")", "{", "$", "uri", "=", "$", "location", "->", "getQueryUrl", "(", ")", ";", "}", "else", "{", "$", "uri", "=", "$", "location", ";", "}", "return", "parent", "::", "getFeed", "(", "$", "uri", ",", "'Zend_Gdata_Gapps_NicknameFeed'", ")", ";", "}" ]
Retreive NicknameFeed object containing multiple NicknameEntry objects. @param mixed $location (optional) The location for the feed, as a URL or Query. @return Zend_Gdata_Gapps_NicknameFeed @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Retreive", "NicknameFeed", "object", "containing", "multiple", "NicknameEntry", "objects", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L382-L392
1,031
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.getGroupFeed
public function getGroupFeed($location = null) { if ($location === null) { $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain(); } else if ($location instanceof Zend_Gdata_Query) { $uri = $location->getQueryUrl(); } else { $uri = $location; } return parent::getFeed($uri, 'Zend_Gdata_Gapps_GroupFeed'); }
php
public function getGroupFeed($location = null) { if ($location === null) { $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain(); } else if ($location instanceof Zend_Gdata_Query) { $uri = $location->getQueryUrl(); } else { $uri = $location; } return parent::getFeed($uri, 'Zend_Gdata_Gapps_GroupFeed'); }
[ "public", "function", "getGroupFeed", "(", "$", "location", "=", "null", ")", "{", "if", "(", "$", "location", "===", "null", ")", "{", "$", "uri", "=", "self", "::", "APPS_BASE_FEED_URI", ".", "self", "::", "APPS_GROUP_PATH", ".", "'/'", ";", "$", "uri", ".=", "$", "this", "->", "getDomain", "(", ")", ";", "}", "else", "if", "(", "$", "location", "instanceof", "Zend_Gdata_Query", ")", "{", "$", "uri", "=", "$", "location", "->", "getQueryUrl", "(", ")", ";", "}", "else", "{", "$", "uri", "=", "$", "location", ";", "}", "return", "parent", "::", "getFeed", "(", "$", "uri", ",", "'Zend_Gdata_Gapps_GroupFeed'", ")", ";", "}" ]
Retreive GroupFeed object containing multiple GroupEntry objects. @param mixed $location (optional) The location for the feed, as a URL or Query. @return Zend_Gdata_Gapps_GroupFeed @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Retreive", "GroupFeed", "object", "containing", "multiple", "GroupEntry", "objects", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L405-L416
1,032
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.getMemberFeed
public function getMemberFeed($location = null) { if ($location === null) { require_once 'Zend/Gdata/App/InvalidArgumentException.php'; throw new Zend_Gdata_App_InvalidArgumentException( 'Location must not be null'); } else if ($location instanceof Zend_Gdata_Query) { $uri = $location->getQueryUrl(); } else { $uri = $location; } return parent::getFeed($uri, 'Zend_Gdata_Gapps_MemberFeed'); }
php
public function getMemberFeed($location = null) { if ($location === null) { require_once 'Zend/Gdata/App/InvalidArgumentException.php'; throw new Zend_Gdata_App_InvalidArgumentException( 'Location must not be null'); } else if ($location instanceof Zend_Gdata_Query) { $uri = $location->getQueryUrl(); } else { $uri = $location; } return parent::getFeed($uri, 'Zend_Gdata_Gapps_MemberFeed'); }
[ "public", "function", "getMemberFeed", "(", "$", "location", "=", "null", ")", "{", "if", "(", "$", "location", "===", "null", ")", "{", "require_once", "'Zend/Gdata/App/InvalidArgumentException.php'", ";", "throw", "new", "Zend_Gdata_App_InvalidArgumentException", "(", "'Location must not be null'", ")", ";", "}", "else", "if", "(", "$", "location", "instanceof", "Zend_Gdata_Query", ")", "{", "$", "uri", "=", "$", "location", "->", "getQueryUrl", "(", ")", ";", "}", "else", "{", "$", "uri", "=", "$", "location", ";", "}", "return", "parent", "::", "getFeed", "(", "$", "uri", ",", "'Zend_Gdata_Gapps_MemberFeed'", ")", ";", "}" ]
Retreive MemberFeed object containing multiple MemberEntry objects. @param mixed $location (optional) The location for the feed, as a URL or Query. @return Zend_Gdata_Gapps_MemberFeed @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Retreive", "MemberFeed", "object", "containing", "multiple", "MemberEntry", "objects", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L429-L441
1,033
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.insertUser
public function insertUser($user, $uri = null) { if ($uri === null) { $uri = $this->getBaseUrl() . self::APPS_USER_PATH; } $newEntry = $this->insertEntry($user, $uri, 'Zend_Gdata_Gapps_UserEntry'); return $newEntry; }
php
public function insertUser($user, $uri = null) { if ($uri === null) { $uri = $this->getBaseUrl() . self::APPS_USER_PATH; } $newEntry = $this->insertEntry($user, $uri, 'Zend_Gdata_Gapps_UserEntry'); return $newEntry; }
[ "public", "function", "insertUser", "(", "$", "user", ",", "$", "uri", "=", "null", ")", "{", "if", "(", "$", "uri", "===", "null", ")", "{", "$", "uri", "=", "$", "this", "->", "getBaseUrl", "(", ")", ".", "self", "::", "APPS_USER_PATH", ";", "}", "$", "newEntry", "=", "$", "this", "->", "insertEntry", "(", "$", "user", ",", "$", "uri", ",", "'Zend_Gdata_Gapps_UserEntry'", ")", ";", "return", "$", "newEntry", ";", "}" ]
Create a new user from a UserEntry. @param Zend_Gdata_Gapps_UserEntry $user The user entry to insert. @param string $uri (optional) The URI where the user should be uploaded to. If null, the default user creation URI for this domain will be used. @return Zend_Gdata_Gapps_UserEntry The inserted user entry as returned by the server. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Create", "a", "new", "user", "from", "a", "UserEntry", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L689-L696
1,034
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.insertNickname
public function insertNickname($nickname, $uri = null) { if ($uri === null) { $uri = $this->getBaseUrl() . self::APPS_NICKNAME_PATH; } $newEntry = $this->insertEntry($nickname, $uri, 'Zend_Gdata_Gapps_NicknameEntry'); return $newEntry; }
php
public function insertNickname($nickname, $uri = null) { if ($uri === null) { $uri = $this->getBaseUrl() . self::APPS_NICKNAME_PATH; } $newEntry = $this->insertEntry($nickname, $uri, 'Zend_Gdata_Gapps_NicknameEntry'); return $newEntry; }
[ "public", "function", "insertNickname", "(", "$", "nickname", ",", "$", "uri", "=", "null", ")", "{", "if", "(", "$", "uri", "===", "null", ")", "{", "$", "uri", "=", "$", "this", "->", "getBaseUrl", "(", ")", ".", "self", "::", "APPS_NICKNAME_PATH", ";", "}", "$", "newEntry", "=", "$", "this", "->", "insertEntry", "(", "$", "nickname", ",", "$", "uri", ",", "'Zend_Gdata_Gapps_NicknameEntry'", ")", ";", "return", "$", "newEntry", ";", "}" ]
Create a new nickname from a NicknameEntry. @param Zend_Gdata_Gapps_NicknameEntry $nickname The nickname entry to insert. @param string $uri (optional) The URI where the nickname should be uploaded to. If null, the default nickname creation URI for this domain will be used. @return Zend_Gdata_Gapps_NicknameEntry The inserted nickname entry as returned by the server. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Create", "a", "new", "nickname", "from", "a", "NicknameEntry", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L712-L719
1,035
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.insertGroup
public function insertGroup($group, $uri = null) { if ($uri === null) { $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain(); } $newEntry = $this->insertEntry($group, $uri, 'Zend_Gdata_Gapps_GroupEntry'); return $newEntry; }
php
public function insertGroup($group, $uri = null) { if ($uri === null) { $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain(); } $newEntry = $this->insertEntry($group, $uri, 'Zend_Gdata_Gapps_GroupEntry'); return $newEntry; }
[ "public", "function", "insertGroup", "(", "$", "group", ",", "$", "uri", "=", "null", ")", "{", "if", "(", "$", "uri", "===", "null", ")", "{", "$", "uri", "=", "self", "::", "APPS_BASE_FEED_URI", ".", "self", "::", "APPS_GROUP_PATH", ".", "'/'", ";", "$", "uri", ".=", "$", "this", "->", "getDomain", "(", ")", ";", "}", "$", "newEntry", "=", "$", "this", "->", "insertEntry", "(", "$", "group", ",", "$", "uri", ",", "'Zend_Gdata_Gapps_GroupEntry'", ")", ";", "return", "$", "newEntry", ";", "}" ]
Create a new group from a GroupEntry. @param Zend_Gdata_Gapps_GroupEntry $group The group entry to insert. @param string $uri (optional) The URI where the group should be uploaded to. If null, the default user creation URI for this domain will be used. @return Zend_Gdata_Gapps_GroupEntry The inserted group entry as returned by the server. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Create", "a", "new", "group", "from", "a", "GroupEntry", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L734-L742
1,036
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.insertMember
public function insertMember($member, $uri = null) { if ($uri === null) { require_once 'Zend/Gdata/App/InvalidArgumentException.php'; throw new Zend_Gdata_App_InvalidArgumentException( 'URI must not be null'); } $newEntry = $this->insertEntry($member, $uri, 'Zend_Gdata_Gapps_MemberEntry'); return $newEntry; }
php
public function insertMember($member, $uri = null) { if ($uri === null) { require_once 'Zend/Gdata/App/InvalidArgumentException.php'; throw new Zend_Gdata_App_InvalidArgumentException( 'URI must not be null'); } $newEntry = $this->insertEntry($member, $uri, 'Zend_Gdata_Gapps_MemberEntry'); return $newEntry; }
[ "public", "function", "insertMember", "(", "$", "member", ",", "$", "uri", "=", "null", ")", "{", "if", "(", "$", "uri", "===", "null", ")", "{", "require_once", "'Zend/Gdata/App/InvalidArgumentException.php'", ";", "throw", "new", "Zend_Gdata_App_InvalidArgumentException", "(", "'URI must not be null'", ")", ";", "}", "$", "newEntry", "=", "$", "this", "->", "insertEntry", "(", "$", "member", ",", "$", "uri", ",", "'Zend_Gdata_Gapps_MemberEntry'", ")", ";", "return", "$", "newEntry", ";", "}" ]
Create a new member from a MemberEntry. @param Zend_Gdata_Gapps_MemberEntry $member The member entry to insert. @param string $uri (optional) The URI where the group should be uploaded to. If null, the default user creation URI for this domain will be used. @return Zend_Gdata_Gapps_MemberEntry The inserted member entry as returned by the server. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Create", "a", "new", "member", "from", "a", "MemberEntry", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L757-L766
1,037
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.insertOwner
public function insertOwner($owner, $uri = null) { if ($uri === null) { require_once 'Zend/Gdata/App/InvalidArgumentException.php'; throw new Zend_Gdata_App_InvalidArgumentException( 'URI must not be null'); } $newEntry = $this->insertEntry($owner, $uri, 'Zend_Gdata_Gapps_OwnerEntry'); return $newEntry; }
php
public function insertOwner($owner, $uri = null) { if ($uri === null) { require_once 'Zend/Gdata/App/InvalidArgumentException.php'; throw new Zend_Gdata_App_InvalidArgumentException( 'URI must not be null'); } $newEntry = $this->insertEntry($owner, $uri, 'Zend_Gdata_Gapps_OwnerEntry'); return $newEntry; }
[ "public", "function", "insertOwner", "(", "$", "owner", ",", "$", "uri", "=", "null", ")", "{", "if", "(", "$", "uri", "===", "null", ")", "{", "require_once", "'Zend/Gdata/App/InvalidArgumentException.php'", ";", "throw", "new", "Zend_Gdata_App_InvalidArgumentException", "(", "'URI must not be null'", ")", ";", "}", "$", "newEntry", "=", "$", "this", "->", "insertEntry", "(", "$", "owner", ",", "$", "uri", ",", "'Zend_Gdata_Gapps_OwnerEntry'", ")", ";", "return", "$", "newEntry", ";", "}" ]
Create a new group from a OwnerEntry. @param Zend_Gdata_Gapps_OwnerEntry $owner The owner entry to insert. @param string $uri (optional) The URI where the owner should be uploaded to. If null, the default user creation URI for this domain will be used. @return Zend_Gdata_Gapps_OwnerEntry The inserted owner entry as returned by the server. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Create", "a", "new", "group", "from", "a", "OwnerEntry", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L781-L790
1,038
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.insertEmailList
public function insertEmailList($emailList, $uri = null) { if ($uri === null) { $uri = $this->getBaseUrl() . self::APPS_EMAIL_LIST_PATH; } $newEntry = $this->insertEntry($emailList, $uri, 'Zend_Gdata_Gapps_EmailListEntry'); return $newEntry; }
php
public function insertEmailList($emailList, $uri = null) { if ($uri === null) { $uri = $this->getBaseUrl() . self::APPS_EMAIL_LIST_PATH; } $newEntry = $this->insertEntry($emailList, $uri, 'Zend_Gdata_Gapps_EmailListEntry'); return $newEntry; }
[ "public", "function", "insertEmailList", "(", "$", "emailList", ",", "$", "uri", "=", "null", ")", "{", "if", "(", "$", "uri", "===", "null", ")", "{", "$", "uri", "=", "$", "this", "->", "getBaseUrl", "(", ")", ".", "self", "::", "APPS_EMAIL_LIST_PATH", ";", "}", "$", "newEntry", "=", "$", "this", "->", "insertEntry", "(", "$", "emailList", ",", "$", "uri", ",", "'Zend_Gdata_Gapps_EmailListEntry'", ")", ";", "return", "$", "newEntry", ";", "}" ]
Create a new email list from an EmailListEntry. @param Zend_Gdata_Gapps_EmailListEntry $emailList The email list entry to insert. @param string $uri (optional) The URI where the email list should be uploaded to. If null, the default email list creation URI for this domain will be used. @return Zend_Gdata_Gapps_EmailListEntry The inserted email list entry as returned by the server. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Create", "a", "new", "email", "list", "from", "an", "EmailListEntry", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L806-L813
1,039
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.insertEmailListRecipient
public function insertEmailListRecipient($recipient, $uri = null) { if ($uri === null) { require_once 'Zend/Gdata/App/InvalidArgumentException.php'; throw new Zend_Gdata_App_InvalidArgumentException( 'URI must not be null'); } elseif ($uri instanceof Zend_Gdata_Gapps_EmailListEntry) { $uri = $uri->getLink('edit')->href; } $newEntry = $this->insertEntry($recipient, $uri, 'Zend_Gdata_Gapps_EmailListRecipientEntry'); return $newEntry; }
php
public function insertEmailListRecipient($recipient, $uri = null) { if ($uri === null) { require_once 'Zend/Gdata/App/InvalidArgumentException.php'; throw new Zend_Gdata_App_InvalidArgumentException( 'URI must not be null'); } elseif ($uri instanceof Zend_Gdata_Gapps_EmailListEntry) { $uri = $uri->getLink('edit')->href; } $newEntry = $this->insertEntry($recipient, $uri, 'Zend_Gdata_Gapps_EmailListRecipientEntry'); return $newEntry; }
[ "public", "function", "insertEmailListRecipient", "(", "$", "recipient", ",", "$", "uri", "=", "null", ")", "{", "if", "(", "$", "uri", "===", "null", ")", "{", "require_once", "'Zend/Gdata/App/InvalidArgumentException.php'", ";", "throw", "new", "Zend_Gdata_App_InvalidArgumentException", "(", "'URI must not be null'", ")", ";", "}", "elseif", "(", "$", "uri", "instanceof", "Zend_Gdata_Gapps_EmailListEntry", ")", "{", "$", "uri", "=", "$", "uri", "->", "getLink", "(", "'edit'", ")", "->", "href", ";", "}", "$", "newEntry", "=", "$", "this", "->", "insertEntry", "(", "$", "recipient", ",", "$", "uri", ",", "'Zend_Gdata_Gapps_EmailListRecipientEntry'", ")", ";", "return", "$", "newEntry", ";", "}" ]
Create a new email list recipient from an EmailListRecipientEntry. @param Zend_Gdata_Gapps_EmailListRecipientEntry $recipient The recipient entry to insert. @param string $uri (optional) The URI where the recipient should be uploaded to. If null, the default recipient creation URI for this domain will be used. @return Zend_Gdata_Gapps_EmailListRecipientEntry The inserted recipient entry as returned by the server. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Create", "a", "new", "email", "list", "recipient", "from", "an", "EmailListRecipientEntry", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L829-L840
1,040
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.createUser
public function createUser ($username, $givenName, $familyName, $password, $passwordHashFunction = null, $quotaLimitInMB = null) { $user = $this->newUserEntry(); $user->login = $this->newLogin(); $user->login->username = $username; $user->login->password = $password; $user->login->hashFunctionName = $passwordHashFunction; $user->name = $this->newName(); $user->name->givenName = $givenName; $user->name->familyName = $familyName; if ($quotaLimitInMB !== null) { $user->quota = $this->newQuota(); $user->quota->limit = $quotaLimitInMB; } return $this->insertUser($user); }
php
public function createUser ($username, $givenName, $familyName, $password, $passwordHashFunction = null, $quotaLimitInMB = null) { $user = $this->newUserEntry(); $user->login = $this->newLogin(); $user->login->username = $username; $user->login->password = $password; $user->login->hashFunctionName = $passwordHashFunction; $user->name = $this->newName(); $user->name->givenName = $givenName; $user->name->familyName = $familyName; if ($quotaLimitInMB !== null) { $user->quota = $this->newQuota(); $user->quota->limit = $quotaLimitInMB; } return $this->insertUser($user); }
[ "public", "function", "createUser", "(", "$", "username", ",", "$", "givenName", ",", "$", "familyName", ",", "$", "password", ",", "$", "passwordHashFunction", "=", "null", ",", "$", "quotaLimitInMB", "=", "null", ")", "{", "$", "user", "=", "$", "this", "->", "newUserEntry", "(", ")", ";", "$", "user", "->", "login", "=", "$", "this", "->", "newLogin", "(", ")", ";", "$", "user", "->", "login", "->", "username", "=", "$", "username", ";", "$", "user", "->", "login", "->", "password", "=", "$", "password", ";", "$", "user", "->", "login", "->", "hashFunctionName", "=", "$", "passwordHashFunction", ";", "$", "user", "->", "name", "=", "$", "this", "->", "newName", "(", ")", ";", "$", "user", "->", "name", "->", "givenName", "=", "$", "givenName", ";", "$", "user", "->", "name", "->", "familyName", "=", "$", "familyName", ";", "if", "(", "$", "quotaLimitInMB", "!==", "null", ")", "{", "$", "user", "->", "quota", "=", "$", "this", "->", "newQuota", "(", ")", ";", "$", "user", "->", "quota", "->", "limit", "=", "$", "quotaLimitInMB", ";", "}", "return", "$", "this", "->", "insertUser", "(", "$", "user", ")", ";", "}" ]
Create a new user entry and send it to the Google Apps servers. @param string $username The username for the new user. @param string $givenName The given name for the new user. @param string $familyName The family name for the new user. @param string $password The password for the new user as a plaintext string (if $passwordHashFunction is null) or a SHA-1 hashed value (if $passwordHashFunction = 'SHA-1'). @param string $quotaLimitInMB (optional) The quota limit for the new user in MB. @return Zend_Gdata_Gapps_UserEntry (optional) The new user entry as returned by server. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Create", "a", "new", "user", "entry", "and", "send", "it", "to", "the", "Google", "Apps", "servers", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L909-L924
1,041
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.retrieveUser
public function retrieveUser ($username) { $query = $this->newUserQuery($username); try { $user = $this->getUserEntry($query); } catch (Zend_Gdata_Gapps_ServiceException $e) { // Set the user to null if not found if ($e->hasError(Zend_Gdata_Gapps_Error::ENTITY_DOES_NOT_EXIST)) { $user = null; } else { throw $e; } } return $user; }
php
public function retrieveUser ($username) { $query = $this->newUserQuery($username); try { $user = $this->getUserEntry($query); } catch (Zend_Gdata_Gapps_ServiceException $e) { // Set the user to null if not found if ($e->hasError(Zend_Gdata_Gapps_Error::ENTITY_DOES_NOT_EXIST)) { $user = null; } else { throw $e; } } return $user; }
[ "public", "function", "retrieveUser", "(", "$", "username", ")", "{", "$", "query", "=", "$", "this", "->", "newUserQuery", "(", "$", "username", ")", ";", "try", "{", "$", "user", "=", "$", "this", "->", "getUserEntry", "(", "$", "query", ")", ";", "}", "catch", "(", "Zend_Gdata_Gapps_ServiceException", "$", "e", ")", "{", "// Set the user to null if not found", "if", "(", "$", "e", "->", "hasError", "(", "Zend_Gdata_Gapps_Error", "::", "ENTITY_DOES_NOT_EXIST", ")", ")", "{", "$", "user", "=", "null", ";", "}", "else", "{", "throw", "$", "e", ";", "}", "}", "return", "$", "user", ";", "}" ]
Retrieve a user based on their username. @param string $username The username to search for. @return Zend_Gdata_Gapps_UserEntry The username to search for, or null if no match found. @throws Zend_Gdata_App_InvalidArgumentException @throws Zend_Gdata_App_HttpException
[ "Retrieve", "a", "user", "based", "on", "their", "username", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L935-L948
1,042
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.retrievePageOfUsers
public function retrievePageOfUsers ($startUsername = null) { $query = $this->newUserQuery(); $query->setStartUsername($startUsername); return $this->getUserFeed($query); }
php
public function retrievePageOfUsers ($startUsername = null) { $query = $this->newUserQuery(); $query->setStartUsername($startUsername); return $this->getUserFeed($query); }
[ "public", "function", "retrievePageOfUsers", "(", "$", "startUsername", "=", "null", ")", "{", "$", "query", "=", "$", "this", "->", "newUserQuery", "(", ")", ";", "$", "query", "->", "setStartUsername", "(", "$", "startUsername", ")", ";", "return", "$", "this", "->", "getUserFeed", "(", "$", "query", ")", ";", "}" ]
Retrieve a page of users in alphabetical order, starting with the provided username. @param string $startUsername (optional) The first username to retrieve. If null or not declared, the page will begin with the first user in the domain. @return Zend_Gdata_Gapps_UserFeed Collection of Zend_Gdata_UserEntry objects representing all users in the domain. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Retrieve", "a", "page", "of", "users", "in", "alphabetical", "order", "starting", "with", "the", "provided", "username", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L963-L967
1,043
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.updateUser
public function updateUser($username, $userEntry) { return $this->updateEntry($userEntry, $this->getBaseUrl() . self::APPS_USER_PATH . '/' . $username); }
php
public function updateUser($username, $userEntry) { return $this->updateEntry($userEntry, $this->getBaseUrl() . self::APPS_USER_PATH . '/' . $username); }
[ "public", "function", "updateUser", "(", "$", "username", ",", "$", "userEntry", ")", "{", "return", "$", "this", "->", "updateEntry", "(", "$", "userEntry", ",", "$", "this", "->", "getBaseUrl", "(", ")", ".", "self", "::", "APPS_USER_PATH", ".", "'/'", ".", "$", "username", ")", ";", "}" ]
Overwrite a specified username with the provided UserEntry. The UserEntry does not need to contain an edit link. This method is provided for compliance with the Google Apps Provisioning API specification. Normally users will instead want to call UserEntry::save() instead. @see Zend_Gdata_App_Entry::save @param string $username The username whose data will be overwritten. @param Zend_Gdata_Gapps_UserEntry $userEntry The user entry which will be overwritten. @return Zend_Gdata_Gapps_UserEntry The UserEntry returned by the server. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Overwrite", "a", "specified", "username", "with", "the", "provided", "UserEntry", ".", "The", "UserEntry", "does", "not", "need", "to", "contain", "an", "edit", "link", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1003-L1006
1,044
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.suspendUser
public function suspendUser($username) { $user = $this->retrieveUser($username); $user->login->suspended = true; return $user->save(); }
php
public function suspendUser($username) { $user = $this->retrieveUser($username); $user->login->suspended = true; return $user->save(); }
[ "public", "function", "suspendUser", "(", "$", "username", ")", "{", "$", "user", "=", "$", "this", "->", "retrieveUser", "(", "$", "username", ")", ";", "$", "user", "->", "login", "->", "suspended", "=", "true", ";", "return", "$", "user", "->", "save", "(", ")", ";", "}" ]
Mark a given user as suspended. @param string $username The username associated with the user who should be suspended. @return Zend_Gdata_Gapps_UserEntry The UserEntry for the modified user. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Mark", "a", "given", "user", "as", "suspended", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1019-L1023
1,045
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.restoreUser
public function restoreUser($username) { $user = $this->retrieveUser($username); $user->login->suspended = false; return $user->save(); }
php
public function restoreUser($username) { $user = $this->retrieveUser($username); $user->login->suspended = false; return $user->save(); }
[ "public", "function", "restoreUser", "(", "$", "username", ")", "{", "$", "user", "=", "$", "this", "->", "retrieveUser", "(", "$", "username", ")", ";", "$", "user", "->", "login", "->", "suspended", "=", "false", ";", "return", "$", "user", "->", "save", "(", ")", ";", "}" ]
Mark a given user as not suspended. @param string $username The username associated with the user who should be restored. @return Zend_Gdata_Gapps_UserEntry The UserEntry for the modified user. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Mark", "a", "given", "user", "as", "not", "suspended", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1036-L1040
1,046
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.createNickname
public function createNickname($username, $nickname) { $entry = $this->newNicknameEntry(); $nickname = $this->newNickname($nickname); $login = $this->newLogin($username); $entry->nickname = $nickname; $entry->login = $login; return $this->insertNickname($entry); }
php
public function createNickname($username, $nickname) { $entry = $this->newNicknameEntry(); $nickname = $this->newNickname($nickname); $login = $this->newLogin($username); $entry->nickname = $nickname; $entry->login = $login; return $this->insertNickname($entry); }
[ "public", "function", "createNickname", "(", "$", "username", ",", "$", "nickname", ")", "{", "$", "entry", "=", "$", "this", "->", "newNicknameEntry", "(", ")", ";", "$", "nickname", "=", "$", "this", "->", "newNickname", "(", "$", "nickname", ")", ";", "$", "login", "=", "$", "this", "->", "newLogin", "(", "$", "username", ")", ";", "$", "entry", "->", "nickname", "=", "$", "nickname", ";", "$", "entry", "->", "login", "=", "$", "login", ";", "return", "$", "this", "->", "insertNickname", "(", "$", "entry", ")", ";", "}" ]
Create a nickname for a given user. @param string $username The username to which the new nickname should be associated. @param string $nickname The new nickname to be created. @return Zend_Gdata_Gapps_NicknameEntry The nickname entry which was created by the server. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Create", "a", "nickname", "for", "a", "given", "user", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1068-L1075
1,047
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.retrieveNickname
public function retrieveNickname($nickname) { $query = $this->newNicknameQuery(); $query->setNickname($nickname); try { $nickname = $this->getNicknameEntry($query); } catch (Zend_Gdata_Gapps_ServiceException $e) { // Set the nickname to null if not found if ($e->hasError(Zend_Gdata_Gapps_Error::ENTITY_DOES_NOT_EXIST)) { $nickname = null; } else { throw $e; } } return $nickname; }
php
public function retrieveNickname($nickname) { $query = $this->newNicknameQuery(); $query->setNickname($nickname); try { $nickname = $this->getNicknameEntry($query); } catch (Zend_Gdata_Gapps_ServiceException $e) { // Set the nickname to null if not found if ($e->hasError(Zend_Gdata_Gapps_Error::ENTITY_DOES_NOT_EXIST)) { $nickname = null; } else { throw $e; } } return $nickname; }
[ "public", "function", "retrieveNickname", "(", "$", "nickname", ")", "{", "$", "query", "=", "$", "this", "->", "newNicknameQuery", "(", ")", ";", "$", "query", "->", "setNickname", "(", "$", "nickname", ")", ";", "try", "{", "$", "nickname", "=", "$", "this", "->", "getNicknameEntry", "(", "$", "query", ")", ";", "}", "catch", "(", "Zend_Gdata_Gapps_ServiceException", "$", "e", ")", "{", "// Set the nickname to null if not found", "if", "(", "$", "e", "->", "hasError", "(", "Zend_Gdata_Gapps_Error", "::", "ENTITY_DOES_NOT_EXIST", ")", ")", "{", "$", "nickname", "=", "null", ";", "}", "else", "{", "throw", "$", "e", ";", "}", "}", "return", "$", "nickname", ";", "}" ]
Retrieve the entry for a specified nickname. @param string $nickname The nickname to be retrieved. @return Zend_Gdata_Gapps_NicknameEntry The requested nickname entry. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Retrieve", "the", "entry", "for", "a", "specified", "nickname", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1086-L1100
1,048
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.retrieveNicknames
public function retrieveNicknames($username) { $query = $this->newNicknameQuery(); $query->setUsername($username); $nicknameFeed = $this->retrieveAllEntriesForFeed( $this->getNicknameFeed($query)); return $nicknameFeed; }
php
public function retrieveNicknames($username) { $query = $this->newNicknameQuery(); $query->setUsername($username); $nicknameFeed = $this->retrieveAllEntriesForFeed( $this->getNicknameFeed($query)); return $nicknameFeed; }
[ "public", "function", "retrieveNicknames", "(", "$", "username", ")", "{", "$", "query", "=", "$", "this", "->", "newNicknameQuery", "(", ")", ";", "$", "query", "->", "setUsername", "(", "$", "username", ")", ";", "$", "nicknameFeed", "=", "$", "this", "->", "retrieveAllEntriesForFeed", "(", "$", "this", "->", "getNicknameFeed", "(", "$", "query", ")", ")", ";", "return", "$", "nicknameFeed", ";", "}" ]
Retrieve all nicknames associated with a specific username. @param string $username The username whose nicknames should be returned. @return Zend_Gdata_Gapps_NicknameFeed A feed containing all nicknames for the given user, or null if @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Retrieve", "all", "nicknames", "associated", "with", "a", "specific", "username", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1113-L1119
1,049
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.retrievePageOfNicknames
public function retrievePageOfNicknames ($startNickname = null) { $query = $this->newNicknameQuery(); $query->setStartNickname($startNickname); return $this->getNicknameFeed($query); }
php
public function retrievePageOfNicknames ($startNickname = null) { $query = $this->newNicknameQuery(); $query->setStartNickname($startNickname); return $this->getNicknameFeed($query); }
[ "public", "function", "retrievePageOfNicknames", "(", "$", "startNickname", "=", "null", ")", "{", "$", "query", "=", "$", "this", "->", "newNicknameQuery", "(", ")", ";", "$", "query", "->", "setStartNickname", "(", "$", "startNickname", ")", ";", "return", "$", "this", "->", "getNicknameFeed", "(", "$", "query", ")", ";", "}" ]
Retrieve a page of nicknames in alphabetical order, starting with the provided nickname. @param string $startNickname (optional) The first nickname to retrieve. If null or not declared, the page will begin with the first nickname in the domain. @return Zend_Gdata_Gapps_NicknameFeed Collection of Zend_Gdata_NicknameEntry objects representing all nicknames in the domain. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Retrieve", "a", "page", "of", "nicknames", "in", "alphabetical", "order", "starting", "with", "the", "provided", "nickname", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1134-L1138
1,050
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.retrieveGroup
public function retrieveGroup($groupId) { $query = $this->newGroupQuery($groupId); //$query->setGroupId($groupId); try { $group = $this->getGroupEntry($query); } catch (Zend_Gdata_Gapps_ServiceException $e) { // Set the group to null if not found if ($e->hasError(Zend_Gdata_Gapps_Error::ENTITY_DOES_NOT_EXIST)) { $group = null; } else { throw $e; } } return $group; }
php
public function retrieveGroup($groupId) { $query = $this->newGroupQuery($groupId); //$query->setGroupId($groupId); try { $group = $this->getGroupEntry($query); } catch (Zend_Gdata_Gapps_ServiceException $e) { // Set the group to null if not found if ($e->hasError(Zend_Gdata_Gapps_Error::ENTITY_DOES_NOT_EXIST)) { $group = null; } else { throw $e; } } return $group; }
[ "public", "function", "retrieveGroup", "(", "$", "groupId", ")", "{", "$", "query", "=", "$", "this", "->", "newGroupQuery", "(", "$", "groupId", ")", ";", "//$query->setGroupId($groupId);", "try", "{", "$", "group", "=", "$", "this", "->", "getGroupEntry", "(", "$", "query", ")", ";", "}", "catch", "(", "Zend_Gdata_Gapps_ServiceException", "$", "e", ")", "{", "// Set the group to null if not found", "if", "(", "$", "e", "->", "hasError", "(", "Zend_Gdata_Gapps_Error", "::", "ENTITY_DOES_NOT_EXIST", ")", ")", "{", "$", "group", "=", "null", ";", "}", "else", "{", "throw", "$", "e", ";", "}", "}", "return", "$", "group", ";", "}" ]
Retrieves a group based on group id @param string $groupId The unique identifier for the group @return Zend_Gdata_Gapps_GroupEntry The group entry as returned by the server.
[ "Retrieves", "a", "group", "based", "on", "group", "id" ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1216-L1232
1,051
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.isMember
public function isMember($memberId, $groupId) { $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId . '/member/' . $memberId; //if the enitiy is not a member, an exception is thrown try { $results = $this->get($uri); } catch (Exception $e) { $results = false; } if($results) { return TRUE; } else { return FALSE; } }
php
public function isMember($memberId, $groupId) { $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId . '/member/' . $memberId; //if the enitiy is not a member, an exception is thrown try { $results = $this->get($uri); } catch (Exception $e) { $results = false; } if($results) { return TRUE; } else { return FALSE; } }
[ "public", "function", "isMember", "(", "$", "memberId", ",", "$", "groupId", ")", "{", "$", "uri", "=", "self", "::", "APPS_BASE_FEED_URI", ".", "self", "::", "APPS_GROUP_PATH", ".", "'/'", ";", "$", "uri", ".=", "$", "this", "->", "getDomain", "(", ")", ".", "'/'", ".", "$", "groupId", ".", "'/member/'", ".", "$", "memberId", ";", "//if the enitiy is not a member, an exception is thrown", "try", "{", "$", "results", "=", "$", "this", "->", "get", "(", "$", "uri", ")", ";", "}", "catch", "(", "Exception", "$", "e", ")", "{", "$", "results", "=", "false", ";", "}", "if", "(", "$", "results", ")", "{", "return", "TRUE", ";", "}", "else", "{", "return", "FALSE", ";", "}", "}" ]
Check to see if a member id or group id is a member of group @param string $memberId Member id or group group id @param string $groupId Group to be checked for @return bool True, if given entity is a member
[ "Check", "to", "see", "if", "a", "member", "id", "or", "group", "id", "is", "a", "member", "of", "group" ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1268-L1285
1,052
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.addMemberToGroup
public function addMemberToGroup($recipientAddress, $groupId) { $member = $this->newMemberEntry(); $properties[] = $this->newProperty(); $properties[0]->name = 'memberId'; $properties[0]->value = $recipientAddress; $member->property = $properties; $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId . '/member'; return $this->insertMember($member, $uri); }
php
public function addMemberToGroup($recipientAddress, $groupId) { $member = $this->newMemberEntry(); $properties[] = $this->newProperty(); $properties[0]->name = 'memberId'; $properties[0]->value = $recipientAddress; $member->property = $properties; $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId . '/member'; return $this->insertMember($member, $uri); }
[ "public", "function", "addMemberToGroup", "(", "$", "recipientAddress", ",", "$", "groupId", ")", "{", "$", "member", "=", "$", "this", "->", "newMemberEntry", "(", ")", ";", "$", "properties", "[", "]", "=", "$", "this", "->", "newProperty", "(", ")", ";", "$", "properties", "[", "0", "]", "->", "name", "=", "'memberId'", ";", "$", "properties", "[", "0", "]", "->", "value", "=", "$", "recipientAddress", ";", "$", "member", "->", "property", "=", "$", "properties", ";", "$", "uri", "=", "self", "::", "APPS_BASE_FEED_URI", ".", "self", "::", "APPS_GROUP_PATH", ".", "'/'", ";", "$", "uri", ".=", "$", "this", "->", "getDomain", "(", ")", ".", "'/'", ".", "$", "groupId", ".", "'/member'", ";", "return", "$", "this", "->", "insertMember", "(", "$", "member", ",", "$", "uri", ")", ";", "}" ]
Add an email address to a group as a member @param string $recipientAddress Email address, member id, or group id @param string $groupId The unique id of the group @return Zend_Gdata_Gapps_MemberEntry The member entry returned by the server
[ "Add", "an", "email", "address", "to", "a", "group", "as", "a", "member" ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1294-L1308
1,053
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.removeMemberFromGroup
public function removeMemberFromGroup($memberId, $groupId) { $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId . '/member/' . $memberId; return $this->delete($uri); }
php
public function removeMemberFromGroup($memberId, $groupId) { $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId . '/member/' . $memberId; return $this->delete($uri); }
[ "public", "function", "removeMemberFromGroup", "(", "$", "memberId", ",", "$", "groupId", ")", "{", "$", "uri", "=", "self", "::", "APPS_BASE_FEED_URI", ".", "self", "::", "APPS_GROUP_PATH", ".", "'/'", ";", "$", "uri", ".=", "$", "this", "->", "getDomain", "(", ")", ".", "'/'", ".", "$", "groupId", ".", "'/member/'", ".", "$", "memberId", ";", "return", "$", "this", "->", "delete", "(", "$", "uri", ")", ";", "}" ]
Remove a member id from a group @param string $memberId Member id or group id @param string $groupId The unique id of the group
[ "Remove", "a", "member", "id", "from", "a", "group" ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1316-L1322
1,054
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.addOwnerToGroup
public function addOwnerToGroup($email, $groupId) { $owner = $this->newOwnerEntry(); $properties[] = $this->newProperty(); $properties[0]->name = 'email'; $properties[0]->value = $email; $owner->property = $properties; $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId . '/owner'; return $this->insertOwner($owner, $uri); }
php
public function addOwnerToGroup($email, $groupId) { $owner = $this->newOwnerEntry(); $properties[] = $this->newProperty(); $properties[0]->name = 'email'; $properties[0]->value = $email; $owner->property = $properties; $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId . '/owner'; return $this->insertOwner($owner, $uri); }
[ "public", "function", "addOwnerToGroup", "(", "$", "email", ",", "$", "groupId", ")", "{", "$", "owner", "=", "$", "this", "->", "newOwnerEntry", "(", ")", ";", "$", "properties", "[", "]", "=", "$", "this", "->", "newProperty", "(", ")", ";", "$", "properties", "[", "0", "]", "->", "name", "=", "'email'", ";", "$", "properties", "[", "0", "]", "->", "value", "=", "$", "email", ";", "$", "owner", "->", "property", "=", "$", "properties", ";", "$", "uri", "=", "self", "::", "APPS_BASE_FEED_URI", ".", "self", "::", "APPS_GROUP_PATH", ".", "'/'", ";", "$", "uri", ".=", "$", "this", "->", "getDomain", "(", ")", ".", "'/'", ".", "$", "groupId", ".", "'/owner'", ";", "return", "$", "this", "->", "insertOwner", "(", "$", "owner", ",", "$", "uri", ")", ";", "}" ]
Add an email as an owner of a group @param string $email Owner's email @param string $groupId Group ownership to be checked for @return Zend_Gdata_Gapps_OwnerEntry The OwnerEntry returned by the server
[ "Add", "an", "email", "as", "an", "owner", "of", "a", "group" ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1344-L1358
1,055
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.retrieveGroupOwners
public function retrieveGroupOwners($groupId) { $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId . '/owner'; return $this->getOwnerFeed($uri); }
php
public function retrieveGroupOwners($groupId) { $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId . '/owner'; return $this->getOwnerFeed($uri); }
[ "public", "function", "retrieveGroupOwners", "(", "$", "groupId", ")", "{", "$", "uri", "=", "self", "::", "APPS_BASE_FEED_URI", ".", "self", "::", "APPS_GROUP_PATH", ".", "'/'", ";", "$", "uri", ".=", "$", "this", "->", "getDomain", "(", ")", ".", "'/'", ".", "$", "groupId", ".", "'/owner'", ";", "return", "$", "this", "->", "getOwnerFeed", "(", "$", "uri", ")", ";", "}" ]
Retrieves all the owners of a group @param string $groupId The unique identifier for the group @return Zend_Gdata_Gapps_OwnerFeed Collection of Zend_Gdata_OwnerEntry objects representing all owners apart of the group.
[ "Retrieves", "all", "the", "owners", "of", "a", "group" ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1367-L1373
1,056
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.isOwner
public function isOwner($email, $groupId) { $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId . '/owner/' . $email; //if the enitiy is not an owner of the group, an exception is thrown try { $results = $this->get($uri); } catch (Exception $e) { $results = false; } if($results) { return TRUE; } else { return FALSE; } }
php
public function isOwner($email, $groupId) { $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId . '/owner/' . $email; //if the enitiy is not an owner of the group, an exception is thrown try { $results = $this->get($uri); } catch (Exception $e) { $results = false; } if($results) { return TRUE; } else { return FALSE; } }
[ "public", "function", "isOwner", "(", "$", "email", ",", "$", "groupId", ")", "{", "$", "uri", "=", "self", "::", "APPS_BASE_FEED_URI", ".", "self", "::", "APPS_GROUP_PATH", ".", "'/'", ";", "$", "uri", ".=", "$", "this", "->", "getDomain", "(", ")", ".", "'/'", ".", "$", "groupId", ".", "'/owner/'", ".", "$", "email", ";", "//if the enitiy is not an owner of the group, an exception is thrown", "try", "{", "$", "results", "=", "$", "this", "->", "get", "(", "$", "uri", ")", ";", "}", "catch", "(", "Exception", "$", "e", ")", "{", "$", "results", "=", "false", ";", "}", "if", "(", "$", "results", ")", "{", "return", "TRUE", ";", "}", "else", "{", "return", "FALSE", ";", "}", "}" ]
Checks to see if an email is an owner of a group @param string $email Owner's email @param string $groupId Group ownership to be checked for @return bool True, if given entity is an owner
[ "Checks", "to", "see", "if", "an", "email", "is", "an", "owner", "of", "a", "group" ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1382-L1399
1,057
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.removeOwnerFromGroup
public function removeOwnerFromGroup($email, $groupId) { $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId . '/owner/' . $email; return $this->delete($uri); }
php
public function removeOwnerFromGroup($email, $groupId) { $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId . '/owner/' . $email; return $this->delete($uri); }
[ "public", "function", "removeOwnerFromGroup", "(", "$", "email", ",", "$", "groupId", ")", "{", "$", "uri", "=", "self", "::", "APPS_BASE_FEED_URI", ".", "self", "::", "APPS_GROUP_PATH", ".", "'/'", ";", "$", "uri", ".=", "$", "this", "->", "getDomain", "(", ")", ".", "'/'", ".", "$", "groupId", ".", "'/owner/'", ".", "$", "email", ";", "return", "$", "this", "->", "delete", "(", "$", "uri", ")", ";", "}" ]
Remove email as an owner of a group @param string $email Owner's email @param string $groupId The unique identifier for the group
[ "Remove", "email", "as", "an", "owner", "of", "a", "group" ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1407-L1413
1,058
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.updateGroup
public function updateGroup($groupId, $groupName = null, $description = null, $emailPermission = null) { $i = 0; $group = $this->newGroupEntry(); $properties[$i] = $this->newProperty(); $properties[$i]->name = 'groupId'; $properties[$i]->value = $groupId; $i++; if($groupName != null) { $properties[$i] = $this->newProperty(); $properties[$i]->name = 'groupName'; $properties[$i]->value = $groupName; $i++; } if($description != null) { $properties[$i] = $this->newProperty(); $properties[$i]->name = 'description'; $properties[$i]->value = $description; $i++; } if($emailPermission != null) { $properties[$i] = $this->newProperty(); $properties[$i]->name = 'emailPermission'; $properties[$i]->value = $emailPermission; $i++; } $group->property = $properties; $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId; return $this->updateEntry($group, $uri, 'Zend_Gdata_Gapps_GroupEntry'); }
php
public function updateGroup($groupId, $groupName = null, $description = null, $emailPermission = null) { $i = 0; $group = $this->newGroupEntry(); $properties[$i] = $this->newProperty(); $properties[$i]->name = 'groupId'; $properties[$i]->value = $groupId; $i++; if($groupName != null) { $properties[$i] = $this->newProperty(); $properties[$i]->name = 'groupName'; $properties[$i]->value = $groupName; $i++; } if($description != null) { $properties[$i] = $this->newProperty(); $properties[$i]->name = 'description'; $properties[$i]->value = $description; $i++; } if($emailPermission != null) { $properties[$i] = $this->newProperty(); $properties[$i]->name = 'emailPermission'; $properties[$i]->value = $emailPermission; $i++; } $group->property = $properties; $uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/'; $uri .= $this->getDomain() . '/' . $groupId; return $this->updateEntry($group, $uri, 'Zend_Gdata_Gapps_GroupEntry'); }
[ "public", "function", "updateGroup", "(", "$", "groupId", ",", "$", "groupName", "=", "null", ",", "$", "description", "=", "null", ",", "$", "emailPermission", "=", "null", ")", "{", "$", "i", "=", "0", ";", "$", "group", "=", "$", "this", "->", "newGroupEntry", "(", ")", ";", "$", "properties", "[", "$", "i", "]", "=", "$", "this", "->", "newProperty", "(", ")", ";", "$", "properties", "[", "$", "i", "]", "->", "name", "=", "'groupId'", ";", "$", "properties", "[", "$", "i", "]", "->", "value", "=", "$", "groupId", ";", "$", "i", "++", ";", "if", "(", "$", "groupName", "!=", "null", ")", "{", "$", "properties", "[", "$", "i", "]", "=", "$", "this", "->", "newProperty", "(", ")", ";", "$", "properties", "[", "$", "i", "]", "->", "name", "=", "'groupName'", ";", "$", "properties", "[", "$", "i", "]", "->", "value", "=", "$", "groupName", ";", "$", "i", "++", ";", "}", "if", "(", "$", "description", "!=", "null", ")", "{", "$", "properties", "[", "$", "i", "]", "=", "$", "this", "->", "newProperty", "(", ")", ";", "$", "properties", "[", "$", "i", "]", "->", "name", "=", "'description'", ";", "$", "properties", "[", "$", "i", "]", "->", "value", "=", "$", "description", ";", "$", "i", "++", ";", "}", "if", "(", "$", "emailPermission", "!=", "null", ")", "{", "$", "properties", "[", "$", "i", "]", "=", "$", "this", "->", "newProperty", "(", ")", ";", "$", "properties", "[", "$", "i", "]", "->", "name", "=", "'emailPermission'", ";", "$", "properties", "[", "$", "i", "]", "->", "value", "=", "$", "emailPermission", ";", "$", "i", "++", ";", "}", "$", "group", "->", "property", "=", "$", "properties", ";", "$", "uri", "=", "self", "::", "APPS_BASE_FEED_URI", ".", "self", "::", "APPS_GROUP_PATH", ".", "'/'", ";", "$", "uri", ".=", "$", "this", "->", "getDomain", "(", ")", ".", "'/'", ".", "$", "groupId", ";", "return", "$", "this", "->", "updateEntry", "(", "$", "group", ",", "$", "uri", ",", "'Zend_Gdata_Gapps_GroupEntry'", ")", ";", "}" ]
Update group properties with new values. any property not defined will not be updated @param string $groupId A unique identifier for the group @param string $groupName The name of the group @param string $description A description of the group @param string $emailPermission The subscription permission of the group @return Zend_Gdata_Gapps_GroupEntry The group entry as updated on the server.
[ "Update", "group", "properties", "with", "new", "values", ".", "any", "property", "not", "defined", "will", "not", "be", "updated" ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1425-L1463
1,059
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.retrieveGroups
public function retrieveGroups($memberId, $directOnly = null) { $query = $this->newGroupQuery(); $query->setMember($memberId); if($directOnly != null) { $query->setDirectOnly($directOnly); } return $this->getGroupFeed($query); }
php
public function retrieveGroups($memberId, $directOnly = null) { $query = $this->newGroupQuery(); $query->setMember($memberId); if($directOnly != null) { $query->setDirectOnly($directOnly); } return $this->getGroupFeed($query); }
[ "public", "function", "retrieveGroups", "(", "$", "memberId", ",", "$", "directOnly", "=", "null", ")", "{", "$", "query", "=", "$", "this", "->", "newGroupQuery", "(", ")", ";", "$", "query", "->", "setMember", "(", "$", "memberId", ")", ";", "if", "(", "$", "directOnly", "!=", "null", ")", "{", "$", "query", "->", "setDirectOnly", "(", "$", "directOnly", ")", ";", "}", "return", "$", "this", "->", "getGroupFeed", "(", "$", "query", ")", ";", "}" ]
Retrieve all of the groups that a user is a member of @param string $memberId Member username @param bool $directOnly (Optional) If true, members with direct association only will be considered @return Zend_Gdata_Gapps_GroupFeed Collection of Zend_Gdata_GroupEntry objects representing all groups member is apart of in the domain.
[ "Retrieve", "all", "of", "the", "groups", "that", "a", "user", "is", "a", "member", "of" ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1474-L1482
1,060
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.retrievePageOfGroups
public function retrievePageOfGroups ($startGroup = null) { $query = $this->newGroupQuery(); $query->setStartGroupId($startGroup); return $this->getGroupFeed($query); }
php
public function retrievePageOfGroups ($startGroup = null) { $query = $this->newGroupQuery(); $query->setStartGroupId($startGroup); return $this->getGroupFeed($query); }
[ "public", "function", "retrievePageOfGroups", "(", "$", "startGroup", "=", "null", ")", "{", "$", "query", "=", "$", "this", "->", "newGroupQuery", "(", ")", ";", "$", "query", "->", "setStartGroupId", "(", "$", "startGroup", ")", ";", "return", "$", "this", "->", "getGroupFeed", "(", "$", "query", ")", ";", "}" ]
Retrieve a page of groups in alphabetical order, starting with the provided group. @param string $startGroup (optional) The first group to retrieve. If null or not defined, the page will begin with the first group in the domain. @return Zend_Gdata_Gapps_GroupFeed Collection of Zend_Gdata_GroupEntry objects representing the groups in the domain. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Retrieve", "a", "page", "of", "groups", "in", "alphabetical", "order", "starting", "with", "the", "provided", "group", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1497-L1502
1,061
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.retrievePageOfMembers
public function retrievePageOfMembers($groupId, $startMember = null) { $query = $this->newMemberQuery($groupId); $query->setStartMemberId($startMember); return $this->getMemberFeed($query); }
php
public function retrievePageOfMembers($groupId, $startMember = null) { $query = $this->newMemberQuery($groupId); $query->setStartMemberId($startMember); return $this->getMemberFeed($query); }
[ "public", "function", "retrievePageOfMembers", "(", "$", "groupId", ",", "$", "startMember", "=", "null", ")", "{", "$", "query", "=", "$", "this", "->", "newMemberQuery", "(", "$", "groupId", ")", ";", "$", "query", "->", "setStartMemberId", "(", "$", "startMember", ")", ";", "return", "$", "this", "->", "getMemberFeed", "(", "$", "query", ")", ";", "}" ]
Gets page of Members @param string $groupId The group id which should be searched. @param string $startMember (optinal) The address of the first member, or null to start with the first member in the list. @return Zend_Gdata_Gapps_MemberFeed Collection of Zend_Gdata_MemberEntry objects
[ "Gets", "page", "of", "Members" ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1513-L1518
1,062
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.createEmailList
public function createEmailList($emailList) { $entry = $this->newEmailListEntry(); $list = $this->newEmailList(); $list->name = $emailList; $entry->emailList = $list; return $this->insertEmailList($entry); }
php
public function createEmailList($emailList) { $entry = $this->newEmailListEntry(); $list = $this->newEmailList(); $list->name = $emailList; $entry->emailList = $list; return $this->insertEmailList($entry); }
[ "public", "function", "createEmailList", "(", "$", "emailList", ")", "{", "$", "entry", "=", "$", "this", "->", "newEmailListEntry", "(", ")", ";", "$", "list", "=", "$", "this", "->", "newEmailList", "(", ")", ";", "$", "list", "->", "name", "=", "$", "emailList", ";", "$", "entry", "->", "emailList", "=", "$", "list", ";", "return", "$", "this", "->", "insertEmailList", "(", "$", "entry", ")", ";", "}" ]
Create a new email list. @param string $emailList The name of the email list to be created. @return Zend_Gdata_Gapps_EmailListEntry The email list entry as created on the server. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Create", "a", "new", "email", "list", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1530-L1536
1,063
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.retrieveEmailLists
public function retrieveEmailLists($recipient) { $query = $this->newEmailListQuery(); $query->recipient = $recipient; return $this->getEmailListFeed($query); }
php
public function retrieveEmailLists($recipient) { $query = $this->newEmailListQuery(); $query->recipient = $recipient; return $this->getEmailListFeed($query); }
[ "public", "function", "retrieveEmailLists", "(", "$", "recipient", ")", "{", "$", "query", "=", "$", "this", "->", "newEmailListQuery", "(", ")", ";", "$", "query", "->", "recipient", "=", "$", "recipient", ";", "return", "$", "this", "->", "getEmailListFeed", "(", "$", "query", ")", ";", "}" ]
Retrieve all email lists associated with a recipient. @param string $username The recipient whose associated email lists should be returned. @return Zend_Gdata_Gapps_EmailListFeed The list of email lists found as Zend_Gdata_EmailListEntry objects. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Retrieve", "all", "email", "lists", "associated", "with", "a", "recipient", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1549-L1553
1,064
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.retrievePageOfEmailLists
public function retrievePageOfEmailLists ($startNickname = null) { $query = $this->newEmailListQuery(); $query->setStartEmailListName($startNickname); return $this->getEmailListFeed($query); }
php
public function retrievePageOfEmailLists ($startNickname = null) { $query = $this->newEmailListQuery(); $query->setStartEmailListName($startNickname); return $this->getEmailListFeed($query); }
[ "public", "function", "retrievePageOfEmailLists", "(", "$", "startNickname", "=", "null", ")", "{", "$", "query", "=", "$", "this", "->", "newEmailListQuery", "(", ")", ";", "$", "query", "->", "setStartEmailListName", "(", "$", "startNickname", ")", ";", "return", "$", "this", "->", "getEmailListFeed", "(", "$", "query", ")", ";", "}" ]
Retrieve a page of email lists in alphabetical order, starting with the provided email list. @param string $startEmailListName (optional) The first list to retrieve. If null or not defined, the page will begin with the first email list in the domain. @return Zend_Gdata_Gapps_EmailListFeed Collection of Zend_Gdata_EmailListEntry objects representing all nicknames in the domain. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Retrieve", "a", "page", "of", "email", "lists", "in", "alphabetical", "order", "starting", "with", "the", "provided", "email", "list", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1568-L1572
1,065
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.addRecipientToEmailList
public function addRecipientToEmailList($recipientAddress, $emailList) { $entry = $this->newEmailListRecipientEntry(); $who = $this->newWho(); $who->email = $recipientAddress; $entry->who = $who; $address = $this->getBaseUrl() . self::APPS_EMAIL_LIST_PATH . '/' . $emailList . self::APPS_EMAIL_LIST_RECIPIENT_POSTFIX . '/'; return $this->insertEmailListRecipient($entry, $address); }
php
public function addRecipientToEmailList($recipientAddress, $emailList) { $entry = $this->newEmailListRecipientEntry(); $who = $this->newWho(); $who->email = $recipientAddress; $entry->who = $who; $address = $this->getBaseUrl() . self::APPS_EMAIL_LIST_PATH . '/' . $emailList . self::APPS_EMAIL_LIST_RECIPIENT_POSTFIX . '/'; return $this->insertEmailListRecipient($entry, $address); }
[ "public", "function", "addRecipientToEmailList", "(", "$", "recipientAddress", ",", "$", "emailList", ")", "{", "$", "entry", "=", "$", "this", "->", "newEmailListRecipientEntry", "(", ")", ";", "$", "who", "=", "$", "this", "->", "newWho", "(", ")", ";", "$", "who", "->", "email", "=", "$", "recipientAddress", ";", "$", "entry", "->", "who", "=", "$", "who", ";", "$", "address", "=", "$", "this", "->", "getBaseUrl", "(", ")", ".", "self", "::", "APPS_EMAIL_LIST_PATH", ".", "'/'", ".", "$", "emailList", ".", "self", "::", "APPS_EMAIL_LIST_RECIPIENT_POSTFIX", ".", "'/'", ";", "return", "$", "this", "->", "insertEmailListRecipient", "(", "$", "entry", ",", "$", "address", ")", ";", "}" ]
Add a specified recipient to an existing emailList. @param string $recipientAddress The address of the recipient to be added to the email list. @param string $emailList The name of the email address to which the recipient should be added. @return Zend_Gdata_Gapps_EmailListRecipientEntry The recipient entry created by the server. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Add", "a", "specified", "recipient", "to", "an", "existing", "emailList", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1616-L1624
1,066
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.retrievePageOfRecipients
public function retrievePageOfRecipients ($emailList, $startRecipient = null) { $query = $this->newEmailListRecipientQuery(); $query->setEmailListName($emailList); $query->setStartRecipient($startRecipient); return $this->getEmailListRecipientFeed($query); }
php
public function retrievePageOfRecipients ($emailList, $startRecipient = null) { $query = $this->newEmailListRecipientQuery(); $query->setEmailListName($emailList); $query->setStartRecipient($startRecipient); return $this->getEmailListRecipientFeed($query); }
[ "public", "function", "retrievePageOfRecipients", "(", "$", "emailList", ",", "$", "startRecipient", "=", "null", ")", "{", "$", "query", "=", "$", "this", "->", "newEmailListRecipientQuery", "(", ")", ";", "$", "query", "->", "setEmailListName", "(", "$", "emailList", ")", ";", "$", "query", "->", "setStartRecipient", "(", "$", "startRecipient", ")", ";", "return", "$", "this", "->", "getEmailListRecipientFeed", "(", "$", "query", ")", ";", "}" ]
Retrieve a page of email list recipients in alphabetical order, starting with the provided email list recipient. @param string $emaiList The email list which should be searched. @param string $startRecipient (optinal) The address of the first recipient, or null to start with the first recipient in the list. @return Zend_Gdata_Gapps_EmailListRecipientFeed Collection of Zend_Gdata_EmailListRecipientEntry objects representing all recpients in the specified list. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Retrieve", "a", "page", "of", "email", "list", "recipients", "in", "alphabetical", "order", "starting", "with", "the", "provided", "email", "list", "recipient", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1641-L1647
1,067
n0m4dz/laracasa
Zend/Gdata/Gapps.php
Zend_Gdata_Gapps.removeRecipientFromEmailList
public function removeRecipientFromEmailList($recipientAddress, $emailList) { $this->delete($this->getBaseUrl() . self::APPS_EMAIL_LIST_PATH . '/' . $emailList . self::APPS_EMAIL_LIST_RECIPIENT_POSTFIX . '/' . $recipientAddress); }
php
public function removeRecipientFromEmailList($recipientAddress, $emailList) { $this->delete($this->getBaseUrl() . self::APPS_EMAIL_LIST_PATH . '/' . $emailList . self::APPS_EMAIL_LIST_RECIPIENT_POSTFIX . '/' . $recipientAddress); }
[ "public", "function", "removeRecipientFromEmailList", "(", "$", "recipientAddress", ",", "$", "emailList", ")", "{", "$", "this", "->", "delete", "(", "$", "this", "->", "getBaseUrl", "(", ")", ".", "self", "::", "APPS_EMAIL_LIST_PATH", ".", "'/'", ".", "$", "emailList", ".", "self", "::", "APPS_EMAIL_LIST_RECIPIENT_POSTFIX", ".", "'/'", ".", "$", "recipientAddress", ")", ";", "}" ]
Remove a specified recipient from an email list. @param string $recipientAddress The recipient to be removed. @param string $emailList The list from which the recipient should be removed. @throws Zend_Gdata_App_Exception @throws Zend_Gdata_App_HttpException @throws Zend_Gdata_Gapps_ServiceException
[ "Remove", "a", "specified", "recipient", "from", "an", "email", "list", "." ]
6141f0c16c7d4453275e3b74be5041f336085c91
https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps.php#L1677-L1681
1,068
coolms/doctrine
src/Mapping/Uploadable/ManagerSubscriber.php
ManagerSubscriber.getPropertyValueFromObject
protected function getPropertyValueFromObject(ClassMetadata $meta, $propertyName, $object) { $refl = $meta->getReflectionClass(); $prop = $refl->getProperty($propertyName); $prop->setAccessible(true); $value = $prop->getValue($object); return $value; }
php
protected function getPropertyValueFromObject(ClassMetadata $meta, $propertyName, $object) { $refl = $meta->getReflectionClass(); $prop = $refl->getProperty($propertyName); $prop->setAccessible(true); $value = $prop->getValue($object); return $value; }
[ "protected", "function", "getPropertyValueFromObject", "(", "ClassMetadata", "$", "meta", ",", "$", "propertyName", ",", "$", "object", ")", "{", "$", "refl", "=", "$", "meta", "->", "getReflectionClass", "(", ")", ";", "$", "prop", "=", "$", "refl", "->", "getProperty", "(", "$", "propertyName", ")", ";", "$", "prop", "->", "setAccessible", "(", "true", ")", ";", "$", "value", "=", "$", "prop", "->", "getValue", "(", "$", "object", ")", ";", "return", "$", "value", ";", "}" ]
Returns value of the entity's property @param ClassMetadata $meta @param string $propertyName @param object $object @return mixed
[ "Returns", "value", "of", "the", "entity", "s", "property" ]
d7d233594b37cd0c3abc37a46e4e4b965767c3b4
https://github.com/coolms/doctrine/blob/d7d233594b37cd0c3abc37a46e4e4b965767c3b4/src/Mapping/Uploadable/ManagerSubscriber.php#L246-L253
1,069
nano7/Http
src/Routing/Router.php
Router.prepareRoutes
protected function prepareRoutes() { $this->dispatcher = \FastRoute\simpleDispatcher(function (\FastRoute\RouteCollector $collector) { $router = new RouteCollection($this, $collector, '', [], ''); // API $router->group(['middlewares' => ['api']], function (RouteCollection $router) { $route_file = app_path('routes_api.php'); if (file_exists($route_file)) { require $route_file; } }); // WEB $router->group(['middlewares' => ['web']], function (RouteCollection $router) { $route_file = app_path('routes.php'); if (file_exists($route_file)) { require $route_file; } }); }); }
php
protected function prepareRoutes() { $this->dispatcher = \FastRoute\simpleDispatcher(function (\FastRoute\RouteCollector $collector) { $router = new RouteCollection($this, $collector, '', [], ''); // API $router->group(['middlewares' => ['api']], function (RouteCollection $router) { $route_file = app_path('routes_api.php'); if (file_exists($route_file)) { require $route_file; } }); // WEB $router->group(['middlewares' => ['web']], function (RouteCollection $router) { $route_file = app_path('routes.php'); if (file_exists($route_file)) { require $route_file; } }); }); }
[ "protected", "function", "prepareRoutes", "(", ")", "{", "$", "this", "->", "dispatcher", "=", "\\", "FastRoute", "\\", "simpleDispatcher", "(", "function", "(", "\\", "FastRoute", "\\", "RouteCollector", "$", "collector", ")", "{", "$", "router", "=", "new", "RouteCollection", "(", "$", "this", ",", "$", "collector", ",", "''", ",", "[", "]", ",", "''", ")", ";", "// API", "$", "router", "->", "group", "(", "[", "'middlewares'", "=>", "[", "'api'", "]", "]", ",", "function", "(", "RouteCollection", "$", "router", ")", "{", "$", "route_file", "=", "app_path", "(", "'routes_api.php'", ")", ";", "if", "(", "file_exists", "(", "$", "route_file", ")", ")", "{", "require", "$", "route_file", ";", "}", "}", ")", ";", "// WEB", "$", "router", "->", "group", "(", "[", "'middlewares'", "=>", "[", "'web'", "]", "]", ",", "function", "(", "RouteCollection", "$", "router", ")", "{", "$", "route_file", "=", "app_path", "(", "'routes.php'", ")", ";", "if", "(", "file_exists", "(", "$", "route_file", ")", ")", "{", "require", "$", "route_file", ";", "}", "}", ")", ";", "}", ")", ";", "}" ]
Carregar e preparar rotas.
[ "Carregar", "e", "preparar", "rotas", "." ]
9af795646ceb3cf1364160a71e339cb79d63773f
https://github.com/nano7/Http/blob/9af795646ceb3cf1364160a71e339cb79d63773f/src/Routing/Router.php#L110-L131
1,070
nano7/Http
src/Routing/Router.php
Router.route
public function route($name) { if (array_key_exists($name, $this->allNames)) { return $this->allNames[$name]; } return null; }
php
public function route($name) { if (array_key_exists($name, $this->allNames)) { return $this->allNames[$name]; } return null; }
[ "public", "function", "route", "(", "$", "name", ")", "{", "if", "(", "array_key_exists", "(", "$", "name", ",", "$", "this", "->", "allNames", ")", ")", "{", "return", "$", "this", "->", "allNames", "[", "$", "name", "]", ";", "}", "return", "null", ";", "}" ]
Find a route by name. @param $name @return null|Route
[ "Find", "a", "route", "by", "name", "." ]
9af795646ceb3cf1364160a71e339cb79d63773f
https://github.com/nano7/Http/blob/9af795646ceb3cf1364160a71e339cb79d63773f/src/Routing/Router.php#L214-L221
1,071
nano7/Http
src/Routing/Router.php
Router.setNames
public function setNames($old, $name, Route $route) { // Verificar se tem old para remover if ((! is_null($old)) && (isset($this->allNames[$old]))) { unset($this->allNames[$old]); } if (! is_null($name)) { $this->allNames[$name] = $route; } }
php
public function setNames($old, $name, Route $route) { // Verificar se tem old para remover if ((! is_null($old)) && (isset($this->allNames[$old]))) { unset($this->allNames[$old]); } if (! is_null($name)) { $this->allNames[$name] = $route; } }
[ "public", "function", "setNames", "(", "$", "old", ",", "$", "name", ",", "Route", "$", "route", ")", "{", "// Verificar se tem old para remover", "if", "(", "(", "!", "is_null", "(", "$", "old", ")", ")", "&&", "(", "isset", "(", "$", "this", "->", "allNames", "[", "$", "old", "]", ")", ")", ")", "{", "unset", "(", "$", "this", "->", "allNames", "[", "$", "old", "]", ")", ";", "}", "if", "(", "!", "is_null", "(", "$", "name", ")", ")", "{", "$", "this", "->", "allNames", "[", "$", "name", "]", "=", "$", "route", ";", "}", "}" ]
Set name. @param $old @param $name @param Route $route
[ "Set", "name", "." ]
9af795646ceb3cf1364160a71e339cb79d63773f
https://github.com/nano7/Http/blob/9af795646ceb3cf1364160a71e339cb79d63773f/src/Routing/Router.php#L230-L240
1,072
aberdnikov/meerkat-core
classes/Pagination.php
Pagination.render
public function render($view = null) { // Automatically hide pagination whenever it is superfluous if ($this->config['auto_hide'] === true AND $this->total_pages <= 1) { return ''; } if ($view === null) { // Use the view from config $view = $this->config['view']; } $tpl = \Meerkat\Twig\Twig::from_template($view); // Pass on the whole Pagination object //print '<pre>'; //print_r(get_object_vars($this)); //print '</pre>'; return $tpl ->set(get_object_vars($this)) ->set('page', $this) ->render(); }
php
public function render($view = null) { // Automatically hide pagination whenever it is superfluous if ($this->config['auto_hide'] === true AND $this->total_pages <= 1) { return ''; } if ($view === null) { // Use the view from config $view = $this->config['view']; } $tpl = \Meerkat\Twig\Twig::from_template($view); // Pass on the whole Pagination object //print '<pre>'; //print_r(get_object_vars($this)); //print '</pre>'; return $tpl ->set(get_object_vars($this)) ->set('page', $this) ->render(); }
[ "public", "function", "render", "(", "$", "view", "=", "null", ")", "{", "// Automatically hide pagination whenever it is superfluous", "if", "(", "$", "this", "->", "config", "[", "'auto_hide'", "]", "===", "true", "AND", "$", "this", "->", "total_pages", "<=", "1", ")", "{", "return", "''", ";", "}", "if", "(", "$", "view", "===", "null", ")", "{", "// Use the view from config", "$", "view", "=", "$", "this", "->", "config", "[", "'view'", "]", ";", "}", "$", "tpl", "=", "\\", "Meerkat", "\\", "Twig", "\\", "Twig", "::", "from_template", "(", "$", "view", ")", ";", "// Pass on the whole Pagination object", "//print '<pre>';", "//print_r(get_object_vars($this));", "//print '</pre>';", "return", "$", "tpl", "->", "set", "(", "get_object_vars", "(", "$", "this", ")", ")", "->", "set", "(", "'page'", ",", "$", "this", ")", "->", "render", "(", ")", ";", "}" ]
Renders the pagination links. @param mixed string of the view to use, or a Kohana_View object @return string pagination output (HTML)
[ "Renders", "the", "pagination", "links", "." ]
9aab1555919d76f1920198c64e21fd3faf9b5f5d
https://github.com/aberdnikov/meerkat-core/blob/9aab1555919d76f1920198c64e21fd3faf9b5f5d/classes/Pagination.php#L20-L40
1,073
Thruio/TigerKit
src/Services/BoardService.php
BoardService.getBoard
public function getBoard($name) { $byName = Models\Board::search() ->where('name', $name) ->execOne(); $bySlug = Models\Board::getBySlug($name); return $bySlug instanceof Models\Board ? $bySlug : $byName; }
php
public function getBoard($name) { $byName = Models\Board::search() ->where('name', $name) ->execOne(); $bySlug = Models\Board::getBySlug($name); return $bySlug instanceof Models\Board ? $bySlug : $byName; }
[ "public", "function", "getBoard", "(", "$", "name", ")", "{", "$", "byName", "=", "Models", "\\", "Board", "::", "search", "(", ")", "->", "where", "(", "'name'", ",", "$", "name", ")", "->", "execOne", "(", ")", ";", "$", "bySlug", "=", "Models", "\\", "Board", "::", "getBySlug", "(", "$", "name", ")", ";", "return", "$", "bySlug", "instanceof", "Models", "\\", "Board", "?", "$", "bySlug", ":", "$", "byName", ";", "}" ]
Get Board by Name or Slug. @param $name @return Models\Board
[ "Get", "Board", "by", "Name", "or", "Slug", "." ]
0030a46bd45fe24584d9677602835b2f3fb6e16e
https://github.com/Thruio/TigerKit/blob/0030a46bd45fe24584d9677602835b2f3fb6e16e/src/Services/BoardService.php#L29-L36
1,074
emmanix2002/dorcas-sdk-php
src/DorcasResponse.php
DorcasResponse.getData
public function getData(bool $asObject = false) { $data = $this->data['data'] ?? $this->data; return $asObject && $data !== null ? (object) $data : $data; }
php
public function getData(bool $asObject = false) { $data = $this->data['data'] ?? $this->data; return $asObject && $data !== null ? (object) $data : $data; }
[ "public", "function", "getData", "(", "bool", "$", "asObject", "=", "false", ")", "{", "$", "data", "=", "$", "this", "->", "data", "[", "'data'", "]", "??", "$", "this", "->", "data", ";", "return", "$", "asObject", "&&", "$", "data", "!==", "null", "?", "(", "object", ")", "$", "data", ":", "$", "data", ";", "}" ]
Returns the value of the "data" key in the response if available, else it returns the parsed response. @param bool $asObject @return array|mixed|object
[ "Returns", "the", "value", "of", "the", "data", "key", "in", "the", "response", "if", "available", "else", "it", "returns", "the", "parsed", "response", "." ]
1b68df62da1ed5f993f9e2687633402b96ab7f64
https://github.com/emmanix2002/dorcas-sdk-php/blob/1b68df62da1ed5f993f9e2687633402b96ab7f64/src/DorcasResponse.php#L121-L125
1,075
emmanix2002/dorcas-sdk-php
src/DorcasResponse.php
DorcasResponse.getErrors
public function getErrors(bool $asObject = false) { $errors = $this->data['errors'] ?? []; return $asObject ? (object) $errors : $errors; }
php
public function getErrors(bool $asObject = false) { $errors = $this->data['errors'] ?? []; return $asObject ? (object) $errors : $errors; }
[ "public", "function", "getErrors", "(", "bool", "$", "asObject", "=", "false", ")", "{", "$", "errors", "=", "$", "this", "->", "data", "[", "'errors'", "]", "??", "[", "]", ";", "return", "$", "asObject", "?", "(", "object", ")", "$", "errors", ":", "$", "errors", ";", "}" ]
Returns the errors in the response, if any. @param bool $asObject @return array|mixed|object
[ "Returns", "the", "errors", "in", "the", "response", "if", "any", "." ]
1b68df62da1ed5f993f9e2687633402b96ab7f64
https://github.com/emmanix2002/dorcas-sdk-php/blob/1b68df62da1ed5f993f9e2687633402b96ab7f64/src/DorcasResponse.php#L134-L138
1,076
emmanix2002/dorcas-sdk-php
src/DorcasResponse.php
DorcasResponse.dumpRequest
public function dumpRequest(): array { if (empty($this->request)) { return ['http_status' => $this->httpStatus, 'response' => $this->data]; } $this->request->getBody()->rewind(); # rewind the request $size = $this->request->getBody()->getSize() ?: 1024; # get the size, we need it to be able to read through; else we assume 1024 $bodyParams = json_decode($this->request->getBody()->read($size), true); # the body parameters $possibleJsonString = (string) $this->request->getBody(); # cast it to a string $jsonData = json_decode($possibleJsonString); $uri = $this->request->getUri(); $url = $uri->getScheme() . '://' . $uri->getAuthority() . '/' . $uri->getPath(); return [ 'http_status' => $this->httpStatus, 'endpoint' => $url, 'params' => $bodyParams, 'response' => $jsonData ?: $possibleJsonString ]; }
php
public function dumpRequest(): array { if (empty($this->request)) { return ['http_status' => $this->httpStatus, 'response' => $this->data]; } $this->request->getBody()->rewind(); # rewind the request $size = $this->request->getBody()->getSize() ?: 1024; # get the size, we need it to be able to read through; else we assume 1024 $bodyParams = json_decode($this->request->getBody()->read($size), true); # the body parameters $possibleJsonString = (string) $this->request->getBody(); # cast it to a string $jsonData = json_decode($possibleJsonString); $uri = $this->request->getUri(); $url = $uri->getScheme() . '://' . $uri->getAuthority() . '/' . $uri->getPath(); return [ 'http_status' => $this->httpStatus, 'endpoint' => $url, 'params' => $bodyParams, 'response' => $jsonData ?: $possibleJsonString ]; }
[ "public", "function", "dumpRequest", "(", ")", ":", "array", "{", "if", "(", "empty", "(", "$", "this", "->", "request", ")", ")", "{", "return", "[", "'http_status'", "=>", "$", "this", "->", "httpStatus", ",", "'response'", "=>", "$", "this", "->", "data", "]", ";", "}", "$", "this", "->", "request", "->", "getBody", "(", ")", "->", "rewind", "(", ")", ";", "# rewind the request", "$", "size", "=", "$", "this", "->", "request", "->", "getBody", "(", ")", "->", "getSize", "(", ")", "?", ":", "1024", ";", "# get the size, we need it to be able to read through; else we assume 1024", "$", "bodyParams", "=", "json_decode", "(", "$", "this", "->", "request", "->", "getBody", "(", ")", "->", "read", "(", "$", "size", ")", ",", "true", ")", ";", "# the body parameters", "$", "possibleJsonString", "=", "(", "string", ")", "$", "this", "->", "request", "->", "getBody", "(", ")", ";", "# cast it to a string", "$", "jsonData", "=", "json_decode", "(", "$", "possibleJsonString", ")", ";", "$", "uri", "=", "$", "this", "->", "request", "->", "getUri", "(", ")", ";", "$", "url", "=", "$", "uri", "->", "getScheme", "(", ")", ".", "'://'", ".", "$", "uri", "->", "getAuthority", "(", ")", ".", "'/'", ".", "$", "uri", "->", "getPath", "(", ")", ";", "return", "[", "'http_status'", "=>", "$", "this", "->", "httpStatus", ",", "'endpoint'", "=>", "$", "url", ",", "'params'", "=>", "$", "bodyParams", ",", "'response'", "=>", "$", "jsonData", "?", ":", "$", "possibleJsonString", "]", ";", "}" ]
Returns a summary of the request. This will usually be available in the case of a failure. @return array
[ "Returns", "a", "summary", "of", "the", "request", ".", "This", "will", "usually", "be", "available", "in", "the", "case", "of", "a", "failure", "." ]
1b68df62da1ed5f993f9e2687633402b96ab7f64
https://github.com/emmanix2002/dorcas-sdk-php/blob/1b68df62da1ed5f993f9e2687633402b96ab7f64/src/DorcasResponse.php#L145-L167
1,077
konservs/brilliant.framework
libraries/Items/BItemsItemTree.php
BItemsItemTree.children
public function children($lang='',$alias=''){ $collname=$this->collectionName; $bitems=$collname::GetInstance(); $children=$bitems->itemsFilter(array('parent'=>$this->id)); if(empty($alias)){ return $children; } foreach($children as $ch){ $chalias=$ch->getalias($lang); if($chalias==$alias){ return $ch; } } return NULL; }
php
public function children($lang='',$alias=''){ $collname=$this->collectionName; $bitems=$collname::GetInstance(); $children=$bitems->itemsFilter(array('parent'=>$this->id)); if(empty($alias)){ return $children; } foreach($children as $ch){ $chalias=$ch->getalias($lang); if($chalias==$alias){ return $ch; } } return NULL; }
[ "public", "function", "children", "(", "$", "lang", "=", "''", ",", "$", "alias", "=", "''", ")", "{", "$", "collname", "=", "$", "this", "->", "collectionName", ";", "$", "bitems", "=", "$", "collname", "::", "GetInstance", "(", ")", ";", "$", "children", "=", "$", "bitems", "->", "itemsFilter", "(", "array", "(", "'parent'", "=>", "$", "this", "->", "id", ")", ")", ";", "if", "(", "empty", "(", "$", "alias", ")", ")", "{", "return", "$", "children", ";", "}", "foreach", "(", "$", "children", "as", "$", "ch", ")", "{", "$", "chalias", "=", "$", "ch", "->", "getalias", "(", "$", "lang", ")", ";", "if", "(", "$", "chalias", "==", "$", "alias", ")", "{", "return", "$", "ch", ";", "}", "}", "return", "NULL", ";", "}" ]
Get children items by alias.
[ "Get", "children", "items", "by", "alias", "." ]
95f03f1917f746fee98bea8a906ba0588c87762d
https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Items/BItemsItemTree.php#L71-L85
1,078
konservs/brilliant.framework
libraries/Items/BItemsItemTree.php
BItemsItemTree.getfieldsvalues
protected function getfieldsvalues(&$qr_fields,&$qr_values){ $qr_fields=array(); $qr_values=array(); parent::getfieldsvalues($qr_fields,$qr_values); $parent=$this->getparent(); if(empty($parent)){ $collectionName=$this->collectionName; $collection=$collectionName::getInstance(); $parent=$collection->itemGet(1); $this->{$this->parentKeyName}=1; } $qr_fields[]=$this->parentKeyName; $qr_values[]=$this->{$this->parentKeyName}; $qr_fields[]=$this->leftKeyName; $qr_values[]=$this->{$this->leftKeyName}; $qr_fields[]=$this->rightKeyName; $qr_values[]=$this->{$this->rightKeyName}; $qr_fields[]=$this->levelKeyName; $qr_values[]=$this->{$this->levelKeyName}; return true; }
php
protected function getfieldsvalues(&$qr_fields,&$qr_values){ $qr_fields=array(); $qr_values=array(); parent::getfieldsvalues($qr_fields,$qr_values); $parent=$this->getparent(); if(empty($parent)){ $collectionName=$this->collectionName; $collection=$collectionName::getInstance(); $parent=$collection->itemGet(1); $this->{$this->parentKeyName}=1; } $qr_fields[]=$this->parentKeyName; $qr_values[]=$this->{$this->parentKeyName}; $qr_fields[]=$this->leftKeyName; $qr_values[]=$this->{$this->leftKeyName}; $qr_fields[]=$this->rightKeyName; $qr_values[]=$this->{$this->rightKeyName}; $qr_fields[]=$this->levelKeyName; $qr_values[]=$this->{$this->levelKeyName}; return true; }
[ "protected", "function", "getfieldsvalues", "(", "&", "$", "qr_fields", ",", "&", "$", "qr_values", ")", "{", "$", "qr_fields", "=", "array", "(", ")", ";", "$", "qr_values", "=", "array", "(", ")", ";", "parent", "::", "getfieldsvalues", "(", "$", "qr_fields", ",", "$", "qr_values", ")", ";", "$", "parent", "=", "$", "this", "->", "getparent", "(", ")", ";", "if", "(", "empty", "(", "$", "parent", ")", ")", "{", "$", "collectionName", "=", "$", "this", "->", "collectionName", ";", "$", "collection", "=", "$", "collectionName", "::", "getInstance", "(", ")", ";", "$", "parent", "=", "$", "collection", "->", "itemGet", "(", "1", ")", ";", "$", "this", "->", "{", "$", "this", "->", "parentKeyName", "}", "=", "1", ";", "}", "$", "qr_fields", "[", "]", "=", "$", "this", "->", "parentKeyName", ";", "$", "qr_values", "[", "]", "=", "$", "this", "->", "{", "$", "this", "->", "parentKeyName", "}", ";", "$", "qr_fields", "[", "]", "=", "$", "this", "->", "leftKeyName", ";", "$", "qr_values", "[", "]", "=", "$", "this", "->", "{", "$", "this", "->", "leftKeyName", "}", ";", "$", "qr_fields", "[", "]", "=", "$", "this", "->", "rightKeyName", ";", "$", "qr_values", "[", "]", "=", "$", "this", "->", "{", "$", "this", "->", "rightKeyName", "}", ";", "$", "qr_fields", "[", "]", "=", "$", "this", "->", "levelKeyName", ";", "$", "qr_values", "[", "]", "=", "$", "this", "->", "{", "$", "this", "->", "levelKeyName", "}", ";", "return", "true", ";", "}" ]
Get fields values @param $qr_fields @param $qr_values @return bool
[ "Get", "fields", "values" ]
95f03f1917f746fee98bea8a906ba0588c87762d
https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Items/BItemsItemTree.php#L93-L113
1,079
cymapgt/DB
src/DB.php
DB.setDbType
public static function setDbType($dbType) { $dbTypeCast = (string) $dbType; if (array_search($dbTypeCast, self::$dbList) === false) { throw new DBException('Illegal database type provided to DB Service'); } self::$dbType = $dbTypeCast; }
php
public static function setDbType($dbType) { $dbTypeCast = (string) $dbType; if (array_search($dbTypeCast, self::$dbList) === false) { throw new DBException('Illegal database type provided to DB Service'); } self::$dbType = $dbTypeCast; }
[ "public", "static", "function", "setDbType", "(", "$", "dbType", ")", "{", "$", "dbTypeCast", "=", "(", "string", ")", "$", "dbType", ";", "if", "(", "array_search", "(", "$", "dbTypeCast", ",", "self", "::", "$", "dbList", ")", "===", "false", ")", "{", "throw", "new", "DBException", "(", "'Illegal database type provided to DB Service'", ")", ";", "}", "self", "::", "$", "dbType", "=", "$", "dbTypeCast", ";", "}" ]
Static function to set the db type @param string $dbType @return void @throws DBException
[ "Static", "function", "to", "set", "the", "db", "type" ]
25b6109615c4254619177e7a0d5712bd3aeb6585
https://github.com/cymapgt/DB/blob/25b6109615c4254619177e7a0d5712bd3aeb6585/src/DB.php#L58-L66
1,080
cymapgt/DB
src/DB.php
DB.sanitizeDbParameters
public static function sanitizeDbParameters($dbParams) { switch (self::getDbType()) { case 'mysql': if (empty($dbParams['unix_socket'])) { unset($dbParams['unix_socket']); } if (empty($dbParams['charset'])) { unset($dbParams['charset']); } break; case 'sqlite': if (empty($dbParams['user'])) { unset($dbParams['user']); } if (empty($dbParams['password'])) { unset($dbParams['password']); } if (empty($dbParams['host'])) { unset($dbParams['host']); } if (empty($dbParams['port'])) { unset($dbParams['port']); } break; } return $dbParams; }
php
public static function sanitizeDbParameters($dbParams) { switch (self::getDbType()) { case 'mysql': if (empty($dbParams['unix_socket'])) { unset($dbParams['unix_socket']); } if (empty($dbParams['charset'])) { unset($dbParams['charset']); } break; case 'sqlite': if (empty($dbParams['user'])) { unset($dbParams['user']); } if (empty($dbParams['password'])) { unset($dbParams['password']); } if (empty($dbParams['host'])) { unset($dbParams['host']); } if (empty($dbParams['port'])) { unset($dbParams['port']); } break; } return $dbParams; }
[ "public", "static", "function", "sanitizeDbParameters", "(", "$", "dbParams", ")", "{", "switch", "(", "self", "::", "getDbType", "(", ")", ")", "{", "case", "'mysql'", ":", "if", "(", "empty", "(", "$", "dbParams", "[", "'unix_socket'", "]", ")", ")", "{", "unset", "(", "$", "dbParams", "[", "'unix_socket'", "]", ")", ";", "}", "if", "(", "empty", "(", "$", "dbParams", "[", "'charset'", "]", ")", ")", "{", "unset", "(", "$", "dbParams", "[", "'charset'", "]", ")", ";", "}", "break", ";", "case", "'sqlite'", ":", "if", "(", "empty", "(", "$", "dbParams", "[", "'user'", "]", ")", ")", "{", "unset", "(", "$", "dbParams", "[", "'user'", "]", ")", ";", "}", "if", "(", "empty", "(", "$", "dbParams", "[", "'password'", "]", ")", ")", "{", "unset", "(", "$", "dbParams", "[", "'password'", "]", ")", ";", "}", "if", "(", "empty", "(", "$", "dbParams", "[", "'host'", "]", ")", ")", "{", "unset", "(", "$", "dbParams", "[", "'host'", "]", ")", ";", "}", "if", "(", "empty", "(", "$", "dbParams", "[", "'port'", "]", ")", ")", "{", "unset", "(", "$", "dbParams", "[", "'port'", "]", ")", ";", "}", "break", ";", "}", "return", "$", "dbParams", ";", "}" ]
Sanitize the database parameters provided @param array $dbParams - Database parameters for the connection @return array
[ "Sanitize", "the", "database", "parameters", "provided" ]
25b6109615c4254619177e7a0d5712bd3aeb6585
https://github.com/cymapgt/DB/blob/25b6109615c4254619177e7a0d5712bd3aeb6585/src/DB.php#L199-L229
1,081
cymapgt/DB
src/DB.php
DB.connectDb
public static function connectDb() { if (!isset(self::$dbLink)) { $dbParams = self::getDatabaseParameters(); self::validateDbParameters($dbParams); $dbParamsSan = self::sanitizeDbParameters($dbParams); $config = new Configuration(); self::$dbLink = DriverManager::getConnection($dbParamsSan, $config); } return self::$dbLink; }
php
public static function connectDb() { if (!isset(self::$dbLink)) { $dbParams = self::getDatabaseParameters(); self::validateDbParameters($dbParams); $dbParamsSan = self::sanitizeDbParameters($dbParams); $config = new Configuration(); self::$dbLink = DriverManager::getConnection($dbParamsSan, $config); } return self::$dbLink; }
[ "public", "static", "function", "connectDb", "(", ")", "{", "if", "(", "!", "isset", "(", "self", "::", "$", "dbLink", ")", ")", "{", "$", "dbParams", "=", "self", "::", "getDatabaseParameters", "(", ")", ";", "self", "::", "validateDbParameters", "(", "$", "dbParams", ")", ";", "$", "dbParamsSan", "=", "self", "::", "sanitizeDbParameters", "(", "$", "dbParams", ")", ";", "$", "config", "=", "new", "Configuration", "(", ")", ";", "self", "::", "$", "dbLink", "=", "DriverManager", "::", "getConnection", "(", "$", "dbParamsSan", ",", "$", "config", ")", ";", "}", "return", "self", "::", "$", "dbLink", ";", "}" ]
Create a database connection or return singleton connection using environment settings @param connectParams - Associative array of connection parameters @return Doctrine\DBAL
[ "Create", "a", "database", "connection", "or", "return", "singleton", "connection", "using", "environment", "settings" ]
25b6109615c4254619177e7a0d5712bd3aeb6585
https://github.com/cymapgt/DB/blob/25b6109615c4254619177e7a0d5712bd3aeb6585/src/DB.php#L238-L249
1,082
cymapgt/DB
src/DB.php
DB.connectDbNew
public static function connectDbNew($dbParams) { self::validateDbParameters($dbParams); $dbParamsSan = self::sanitizeDbParameters($dbParams); $config = new Configuration(); return DriverManager::getConnection($dbParamsSan, $config); }
php
public static function connectDbNew($dbParams) { self::validateDbParameters($dbParams); $dbParamsSan = self::sanitizeDbParameters($dbParams); $config = new Configuration(); return DriverManager::getConnection($dbParamsSan, $config); }
[ "public", "static", "function", "connectDbNew", "(", "$", "dbParams", ")", "{", "self", "::", "validateDbParameters", "(", "$", "dbParams", ")", ";", "$", "dbParamsSan", "=", "self", "::", "sanitizeDbParameters", "(", "$", "dbParams", ")", ";", "$", "config", "=", "new", "Configuration", "(", ")", ";", "return", "DriverManager", "::", "getConnection", "(", "$", "dbParamsSan", ",", "$", "config", ")", ";", "}" ]
For new connections that are building transactions @param array $dbParams - Database connection parameters @return Doctrine\DBAL
[ "For", "new", "connections", "that", "are", "building", "transactions" ]
25b6109615c4254619177e7a0d5712bd3aeb6585
https://github.com/cymapgt/DB/blob/25b6109615c4254619177e7a0d5712bd3aeb6585/src/DB.php#L258-L263
1,083
cymapgt/DB
src/DB.php
DB.closeDbConnection
public static function closeDbConnection() { if (isset(self::$dbLink)) { $dbConn = self::$dbLink; $dbConn->close(); self::$dbLink = null; } return null; }
php
public static function closeDbConnection() { if (isset(self::$dbLink)) { $dbConn = self::$dbLink; $dbConn->close(); self::$dbLink = null; } return null; }
[ "public", "static", "function", "closeDbConnection", "(", ")", "{", "if", "(", "isset", "(", "self", "::", "$", "dbLink", ")", ")", "{", "$", "dbConn", "=", "self", "::", "$", "dbLink", ";", "$", "dbConn", "->", "close", "(", ")", ";", "self", "::", "$", "dbLink", "=", "null", ";", "}", "return", "null", ";", "}" ]
Closes the static db connection @return void
[ "Closes", "the", "static", "db", "connection" ]
25b6109615c4254619177e7a0d5712bd3aeb6585
https://github.com/cymapgt/DB/blob/25b6109615c4254619177e7a0d5712bd3aeb6585/src/DB.php#L270-L279
1,084
integratedfordevelopers/integrated-channel-bundle
DependencyInjection/IntegratedChannelExtension.php
IntegratedChannelExtension.loadConfigs
protected function loadConfigs(array $config, ContainerBuilder $container) { foreach ($config['configs'] as $name => $arguments) { if (!$arguments['enabled']) { continue; } $id = 'integrated_channel.config.memory.' . $name; if ($container->hasDefinition($id)) { continue; } // first create the options and for that we need a unique service id do { $id_options = $id . '.options.' . uniqid(); } while ($container->hasDefinition($id_options)); $definition = new Definition('%integrated_channel.config.options.class%'); $definition->setPublic(false); $definition->setArguments([$arguments['options']]); $container->setDefinition($id_options, $definition); // create the config it self $definition = new Definition('%integrated_channel.config.class%'); $definition->setArguments([ $name, $arguments['adaptor'], new Reference($id_options) ]); if ($arguments['channel']) { foreach ($arguments['channel'] as $channel) { $definition->addTag('integrated_channel.config', ['channel' => $channel]); } } else { $definition->addTag('integrated_channel.config'); } $container->setDefinition($id, $definition); } }
php
protected function loadConfigs(array $config, ContainerBuilder $container) { foreach ($config['configs'] as $name => $arguments) { if (!$arguments['enabled']) { continue; } $id = 'integrated_channel.config.memory.' . $name; if ($container->hasDefinition($id)) { continue; } // first create the options and for that we need a unique service id do { $id_options = $id . '.options.' . uniqid(); } while ($container->hasDefinition($id_options)); $definition = new Definition('%integrated_channel.config.options.class%'); $definition->setPublic(false); $definition->setArguments([$arguments['options']]); $container->setDefinition($id_options, $definition); // create the config it self $definition = new Definition('%integrated_channel.config.class%'); $definition->setArguments([ $name, $arguments['adaptor'], new Reference($id_options) ]); if ($arguments['channel']) { foreach ($arguments['channel'] as $channel) { $definition->addTag('integrated_channel.config', ['channel' => $channel]); } } else { $definition->addTag('integrated_channel.config'); } $container->setDefinition($id, $definition); } }
[ "protected", "function", "loadConfigs", "(", "array", "$", "config", ",", "ContainerBuilder", "$", "container", ")", "{", "foreach", "(", "$", "config", "[", "'configs'", "]", "as", "$", "name", "=>", "$", "arguments", ")", "{", "if", "(", "!", "$", "arguments", "[", "'enabled'", "]", ")", "{", "continue", ";", "}", "$", "id", "=", "'integrated_channel.config.memory.'", ".", "$", "name", ";", "if", "(", "$", "container", "->", "hasDefinition", "(", "$", "id", ")", ")", "{", "continue", ";", "}", "// first create the options and for that we need a unique service id", "do", "{", "$", "id_options", "=", "$", "id", ".", "'.options.'", ".", "uniqid", "(", ")", ";", "}", "while", "(", "$", "container", "->", "hasDefinition", "(", "$", "id_options", ")", ")", ";", "$", "definition", "=", "new", "Definition", "(", "'%integrated_channel.config.options.class%'", ")", ";", "$", "definition", "->", "setPublic", "(", "false", ")", ";", "$", "definition", "->", "setArguments", "(", "[", "$", "arguments", "[", "'options'", "]", "]", ")", ";", "$", "container", "->", "setDefinition", "(", "$", "id_options", ",", "$", "definition", ")", ";", "// create the config it self", "$", "definition", "=", "new", "Definition", "(", "'%integrated_channel.config.class%'", ")", ";", "$", "definition", "->", "setArguments", "(", "[", "$", "name", ",", "$", "arguments", "[", "'adaptor'", "]", ",", "new", "Reference", "(", "$", "id_options", ")", "]", ")", ";", "if", "(", "$", "arguments", "[", "'channel'", "]", ")", "{", "foreach", "(", "$", "arguments", "[", "'channel'", "]", "as", "$", "channel", ")", "{", "$", "definition", "->", "addTag", "(", "'integrated_channel.config'", ",", "[", "'channel'", "=>", "$", "channel", "]", ")", ";", "}", "}", "else", "{", "$", "definition", "->", "addTag", "(", "'integrated_channel.config'", ")", ";", "}", "$", "container", "->", "setDefinition", "(", "$", "id", ",", "$", "definition", ")", ";", "}", "}" ]
Process the adaptor config configuration. @param array $config @param ContainerBuilder $container
[ "Process", "the", "adaptor", "config", "configuration", "." ]
86291e2c8e12ccce3965beacfce4c15ae6622246
https://github.com/integratedfordevelopers/integrated-channel-bundle/blob/86291e2c8e12ccce3965beacfce4c15ae6622246/DependencyInjection/IntegratedChannelExtension.php#L67-L111
1,085
treehouselabs/keystone-bundle
src/TreeHouse/KeystoneBundle/Controller/TokenController.php
TokenController.getUserId
protected function getUserId(UserInterface $user) { $class = $this->container->getParameter('tree_house.keystone.model.user.class'); $meta = $this->getDoctrine()->getManagerForClass($class)->getClassMetadata($class); $ids = $meta->getIdentifierValues($user); if (sizeof($ids) === 1) { return current($ids); } return $ids; }
php
protected function getUserId(UserInterface $user) { $class = $this->container->getParameter('tree_house.keystone.model.user.class'); $meta = $this->getDoctrine()->getManagerForClass($class)->getClassMetadata($class); $ids = $meta->getIdentifierValues($user); if (sizeof($ids) === 1) { return current($ids); } return $ids; }
[ "protected", "function", "getUserId", "(", "UserInterface", "$", "user", ")", "{", "$", "class", "=", "$", "this", "->", "container", "->", "getParameter", "(", "'tree_house.keystone.model.user.class'", ")", ";", "$", "meta", "=", "$", "this", "->", "getDoctrine", "(", ")", "->", "getManagerForClass", "(", "$", "class", ")", "->", "getClassMetadata", "(", "$", "class", ")", ";", "$", "ids", "=", "$", "meta", "->", "getIdentifierValues", "(", "$", "user", ")", ";", "if", "(", "sizeof", "(", "$", "ids", ")", "===", "1", ")", "{", "return", "current", "(", "$", "ids", ")", ";", "}", "return", "$", "ids", ";", "}" ]
Returns the user identifier. If this is a single identifier, that value is returned. Otherwise all the identifiers are returned as an array. @param UserInterface $user @return array|mixed
[ "Returns", "the", "user", "identifier", ".", "If", "this", "is", "a", "single", "identifier", "that", "value", "is", "returned", ".", "Otherwise", "all", "the", "identifiers", "are", "returned", "as", "an", "array", "." ]
b3e30c68040f88079397bf03e09c8991896c6551
https://github.com/treehouselabs/keystone-bundle/blob/b3e30c68040f88079397bf03e09c8991896c6551/src/TreeHouse/KeystoneBundle/Controller/TokenController.php#L122-L133
1,086
fabsgc/framework
Core/Orm/Validation/Element/Element.php
Element._getField
protected function _getField() { //We can access to a field of the current Entity or a linked Entity (foreign key) //If the field name contain a "." it's the second case $fields = []; $fieldsData = $this->_entity->fields(); //We have to analyze a classic field without linked Entity if (!preg_match('#\.#isU', $this->_field)) { if (isset($fieldsData[$this->_field])) { $fields = [$fieldsData[$this->_field]->value]; } else { throw new MissingEntityException('The field "' . $this->_field . '" in the Entity "' . $this->_entity->name() . '" does\'nt exist'); } } else { //Here it's sure that we have a linked Entity. But we don't compute "One to One and One to Many" in the same way than the 2 other //because in the two first the field value is an Entity object and in the two other, the field value is a Collection //To know which type of linked Entity it's, we just split the name on the "." and we take the index 0 of the generated array $entityName = explode('.', $this->_field); if (array_key_exists($entityName[0], $fieldsData) && $fieldsData[$entityName[0]]->foreign != null) { /** @var int $foreignType : the type of the foreign key */ $foreignType = $fieldsData[$entityName[0]]->foreign->type(); /** @var mixed $fieldValue : the value of the sub-field from the Entity (post.article.content->value) */ $fieldValue = $fieldsData[$entityName[0]]->value->fields()[$entityName[1]]; if ($foreignType == ForeignKey::ONE_TO_MANY || $foreignType == ForeignKey::MANY_TO_ONE) { $fields = $this->_getForeignKeyFieldValue($fieldValue); } else { //We must get all the sub entities as an array an then loop through this array to get the field values foreach ($fieldValue->data() as $fieldValueCollection) { $fields = array_merge($fields, $this->_getForeignKeyFieldValue($fieldValueCollection)); } } } else { throw new MissingEntityException('The field "' . $this->_field . '" in the Entity "' . $this->_entity->name() . '" does\'nt exist'); } } return $fields; }
php
protected function _getField() { //We can access to a field of the current Entity or a linked Entity (foreign key) //If the field name contain a "." it's the second case $fields = []; $fieldsData = $this->_entity->fields(); //We have to analyze a classic field without linked Entity if (!preg_match('#\.#isU', $this->_field)) { if (isset($fieldsData[$this->_field])) { $fields = [$fieldsData[$this->_field]->value]; } else { throw new MissingEntityException('The field "' . $this->_field . '" in the Entity "' . $this->_entity->name() . '" does\'nt exist'); } } else { //Here it's sure that we have a linked Entity. But we don't compute "One to One and One to Many" in the same way than the 2 other //because in the two first the field value is an Entity object and in the two other, the field value is a Collection //To know which type of linked Entity it's, we just split the name on the "." and we take the index 0 of the generated array $entityName = explode('.', $this->_field); if (array_key_exists($entityName[0], $fieldsData) && $fieldsData[$entityName[0]]->foreign != null) { /** @var int $foreignType : the type of the foreign key */ $foreignType = $fieldsData[$entityName[0]]->foreign->type(); /** @var mixed $fieldValue : the value of the sub-field from the Entity (post.article.content->value) */ $fieldValue = $fieldsData[$entityName[0]]->value->fields()[$entityName[1]]; if ($foreignType == ForeignKey::ONE_TO_MANY || $foreignType == ForeignKey::MANY_TO_ONE) { $fields = $this->_getForeignKeyFieldValue($fieldValue); } else { //We must get all the sub entities as an array an then loop through this array to get the field values foreach ($fieldValue->data() as $fieldValueCollection) { $fields = array_merge($fields, $this->_getForeignKeyFieldValue($fieldValueCollection)); } } } else { throw new MissingEntityException('The field "' . $this->_field . '" in the Entity "' . $this->_entity->name() . '" does\'nt exist'); } } return $fields; }
[ "protected", "function", "_getField", "(", ")", "{", "//We can access to a field of the current Entity or a linked Entity (foreign key)", "//If the field name contain a \".\" it's the second case", "$", "fields", "=", "[", "]", ";", "$", "fieldsData", "=", "$", "this", "->", "_entity", "->", "fields", "(", ")", ";", "//We have to analyze a classic field without linked Entity", "if", "(", "!", "preg_match", "(", "'#\\.#isU'", ",", "$", "this", "->", "_field", ")", ")", "{", "if", "(", "isset", "(", "$", "fieldsData", "[", "$", "this", "->", "_field", "]", ")", ")", "{", "$", "fields", "=", "[", "$", "fieldsData", "[", "$", "this", "->", "_field", "]", "->", "value", "]", ";", "}", "else", "{", "throw", "new", "MissingEntityException", "(", "'The field \"'", ".", "$", "this", "->", "_field", ".", "'\" in the Entity \"'", ".", "$", "this", "->", "_entity", "->", "name", "(", ")", ".", "'\" does\\'nt exist'", ")", ";", "}", "}", "else", "{", "//Here it's sure that we have a linked Entity. But we don't compute \"One to One and One to Many\" in the same way than the 2 other", "//because in the two first the field value is an Entity object and in the two other, the field value is a Collection", "//To know which type of linked Entity it's, we just split the name on the \".\" and we take the index 0 of the generated array", "$", "entityName", "=", "explode", "(", "'.'", ",", "$", "this", "->", "_field", ")", ";", "if", "(", "array_key_exists", "(", "$", "entityName", "[", "0", "]", ",", "$", "fieldsData", ")", "&&", "$", "fieldsData", "[", "$", "entityName", "[", "0", "]", "]", "->", "foreign", "!=", "null", ")", "{", "/** @var int $foreignType : the type of the foreign key */", "$", "foreignType", "=", "$", "fieldsData", "[", "$", "entityName", "[", "0", "]", "]", "->", "foreign", "->", "type", "(", ")", ";", "/** @var mixed $fieldValue : the value of the sub-field from the Entity (post.article.content->value) */", "$", "fieldValue", "=", "$", "fieldsData", "[", "$", "entityName", "[", "0", "]", "]", "->", "value", "->", "fields", "(", ")", "[", "$", "entityName", "[", "1", "]", "]", ";", "if", "(", "$", "foreignType", "==", "ForeignKey", "::", "ONE_TO_MANY", "||", "$", "foreignType", "==", "ForeignKey", "::", "MANY_TO_ONE", ")", "{", "$", "fields", "=", "$", "this", "->", "_getForeignKeyFieldValue", "(", "$", "fieldValue", ")", ";", "}", "else", "{", "//We must get all the sub entities as an array an then loop through this array to get the field values", "foreach", "(", "$", "fieldValue", "->", "data", "(", ")", "as", "$", "fieldValueCollection", ")", "{", "$", "fields", "=", "array_merge", "(", "$", "fields", ",", "$", "this", "->", "_getForeignKeyFieldValue", "(", "$", "fieldValueCollection", ")", ")", ";", "}", "}", "}", "else", "{", "throw", "new", "MissingEntityException", "(", "'The field \"'", ".", "$", "this", "->", "_field", ".", "'\" in the Entity \"'", ".", "$", "this", "->", "_entity", "->", "name", "(", ")", ".", "'\" does\\'nt exist'", ")", ";", "}", "}", "return", "$", "fields", ";", "}" ]
Before validating the field, we need to get the correct field from the current Entity or a linked Entity @access public @throws MissingEntityException @return mixed array @since 3.0 @package Gcs\Framework\Core\Form\Validation\Element
[ "Before", "validating", "the", "field", "we", "need", "to", "get", "the", "correct", "field", "from", "the", "current", "Entity", "or", "a", "linked", "Entity" ]
45e58182aba6a3c6381970a1fd3c17662cff2168
https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Validation/Element/Element.php#L373-L416
1,087
fabsgc/framework
Core/Orm/Validation/Element/Element.php
Element._getForeignKeyFieldValue
private function _getForeignKeyFieldValue($field) { $fields = null; if (gettype($field->value) != 'object') { if (is_array($field->value)) { $fields = $field->value; } else { $fields = [$field->value]; } } else if (get_class($field->value) != 'System\Collection\Collection') { $fields = $field->value->data(); } else if (get_class($field->value) != 'System\Orm\Entity\Type\File') { $fields = [$field->value]; } return $fields; }
php
private function _getForeignKeyFieldValue($field) { $fields = null; if (gettype($field->value) != 'object') { if (is_array($field->value)) { $fields = $field->value; } else { $fields = [$field->value]; } } else if (get_class($field->value) != 'System\Collection\Collection') { $fields = $field->value->data(); } else if (get_class($field->value) != 'System\Orm\Entity\Type\File') { $fields = [$field->value]; } return $fields; }
[ "private", "function", "_getForeignKeyFieldValue", "(", "$", "field", ")", "{", "$", "fields", "=", "null", ";", "if", "(", "gettype", "(", "$", "field", "->", "value", ")", "!=", "'object'", ")", "{", "if", "(", "is_array", "(", "$", "field", "->", "value", ")", ")", "{", "$", "fields", "=", "$", "field", "->", "value", ";", "}", "else", "{", "$", "fields", "=", "[", "$", "field", "->", "value", "]", ";", "}", "}", "else", "if", "(", "get_class", "(", "$", "field", "->", "value", ")", "!=", "'System\\Collection\\Collection'", ")", "{", "$", "fields", "=", "$", "field", "->", "value", "->", "data", "(", ")", ";", "}", "else", "if", "(", "get_class", "(", "$", "field", "->", "value", ")", "!=", "'System\\Orm\\Entity\\Type\\File'", ")", "{", "$", "fields", "=", "[", "$", "field", "->", "value", "]", ";", "}", "return", "$", "fields", ";", "}" ]
The method _getField return the value of each field in the Entity. This method is used to factorize the source code @access public @param $field \Gcs\Framework\Core\Orm\Entity\Field @return mixed array @since 3.0 @package Gcs\Framework\Core\Form\Validation\Element
[ "The", "method", "_getField", "return", "the", "value", "of", "each", "field", "in", "the", "Entity", ".", "This", "method", "is", "used", "to", "factorize", "the", "source", "code" ]
45e58182aba6a3c6381970a1fd3c17662cff2168
https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Validation/Element/Element.php#L427-L446
1,088
fabsgc/framework
Core/Orm/Validation/Element/Element.php
Element.equal
public function equal($equal, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::EQUAL, 'value' => $equal, 'message' => $error]); } return $this; }
php
public function equal($equal, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::EQUAL, 'value' => $equal, 'message' => $error]); } return $this; }
[ "public", "function", "equal", "(", "$", "equal", ",", "$", "error", ")", "{", "if", "(", "$", "this", "->", "_exist", ")", "{", "array_push", "(", "$", "this", "->", "_constraints", ",", "[", "'type'", "=>", "self", "::", "EQUAL", ",", "'value'", "=>", "$", "equal", ",", "'message'", "=>", "$", "error", "]", ")", ";", "}", "return", "$", "this", ";", "}" ]
the field must be equal to @access public @param $equal string @param $error string @return \Gcs\Framework\Core\Orm\Validation\Element\Element @since 3.0 @package Gcs\Framework\Core\Form\Validation\Element
[ "the", "field", "must", "be", "equal", "to" ]
45e58182aba6a3c6381970a1fd3c17662cff2168
https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Validation/Element/Element.php#L487-L493
1,089
fabsgc/framework
Core/Orm/Validation/Element/Element.php
Element.different
public function different($different, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::DIFFERENT, 'value' => $different, 'message' => $error]); } return $this; }
php
public function different($different, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::DIFFERENT, 'value' => $different, 'message' => $error]); } return $this; }
[ "public", "function", "different", "(", "$", "different", ",", "$", "error", ")", "{", "if", "(", "$", "this", "->", "_exist", ")", "{", "array_push", "(", "$", "this", "->", "_constraints", ",", "[", "'type'", "=>", "self", "::", "DIFFERENT", ",", "'value'", "=>", "$", "different", ",", "'message'", "=>", "$", "error", "]", ")", ";", "}", "return", "$", "this", ";", "}" ]
the field must be different from @access public @param $different string @param $error string @return \Gcs\Framework\Core\Orm\Validation\Element\Element @since 3.0 @package Gcs\Framework\Core\Form\Validation\Element
[ "the", "field", "must", "be", "different", "from" ]
45e58182aba6a3c6381970a1fd3c17662cff2168
https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Validation/Element/Element.php#L505-L511
1,090
fabsgc/framework
Core/Orm/Validation/Element/Element.php
Element.moreThan
public function moreThan($moreThan, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::MORETHAN, 'value' => $moreThan, 'message' => $error]); } return $this; }
php
public function moreThan($moreThan, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::MORETHAN, 'value' => $moreThan, 'message' => $error]); } return $this; }
[ "public", "function", "moreThan", "(", "$", "moreThan", ",", "$", "error", ")", "{", "if", "(", "$", "this", "->", "_exist", ")", "{", "array_push", "(", "$", "this", "->", "_constraints", ",", "[", "'type'", "=>", "self", "::", "MORETHAN", ",", "'value'", "=>", "$", "moreThan", ",", "'message'", "=>", "$", "error", "]", ")", ";", "}", "return", "$", "this", ";", "}" ]
the field value must be more than @access public @param $moreThan integer @param $error string @return \Gcs\Framework\Core\Orm\Validation\Element\Element @since 3.0 @package Gcs\Framework\Core\Form\Validation\Element
[ "the", "field", "value", "must", "be", "more", "than" ]
45e58182aba6a3c6381970a1fd3c17662cff2168
https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Validation/Element/Element.php#L523-L529
1,091
fabsgc/framework
Core/Orm/Validation/Element/Element.php
Element.lessThan
public function lessThan($lessThan, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::LESSTHAN, 'value' => $lessThan, 'message' => $error]); } return $this; }
php
public function lessThan($lessThan, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::LESSTHAN, 'value' => $lessThan, 'message' => $error]); } return $this; }
[ "public", "function", "lessThan", "(", "$", "lessThan", ",", "$", "error", ")", "{", "if", "(", "$", "this", "->", "_exist", ")", "{", "array_push", "(", "$", "this", "->", "_constraints", ",", "[", "'type'", "=>", "self", "::", "LESSTHAN", ",", "'value'", "=>", "$", "lessThan", ",", "'message'", "=>", "$", "error", "]", ")", ";", "}", "return", "$", "this", ";", "}" ]
the field value must be less than @access public @param $lessThan integer @param $error string @return \Gcs\Framework\Core\Orm\Validation\Element\Element @since 3.0 @package Gcs\Framework\Core\Form\Validation\Element
[ "the", "field", "value", "must", "be", "less", "than" ]
45e58182aba6a3c6381970a1fd3c17662cff2168
https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Validation/Element/Element.php#L541-L547
1,092
fabsgc/framework
Core/Orm/Validation/Element/Element.php
Element.between
public function between($between, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::BETWEEN, 'value' => $between, 'message' => $error]); } return $this; }
php
public function between($between, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::BETWEEN, 'value' => $between, 'message' => $error]); } return $this; }
[ "public", "function", "between", "(", "$", "between", ",", "$", "error", ")", "{", "if", "(", "$", "this", "->", "_exist", ")", "{", "array_push", "(", "$", "this", "->", "_constraints", ",", "[", "'type'", "=>", "self", "::", "BETWEEN", ",", "'value'", "=>", "$", "between", ",", "'message'", "=>", "$", "error", "]", ")", ";", "}", "return", "$", "this", ";", "}" ]
the field value must be between @access public @param $between integer[] @param $error string @return \Gcs\Framework\Core\Orm\Validation\Element\Element @since 3.0 @package Gcs\Framework\Core\Form\Validation\Element
[ "the", "field", "value", "must", "be", "between" ]
45e58182aba6a3c6381970a1fd3c17662cff2168
https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Validation/Element/Element.php#L559-L565
1,093
fabsgc/framework
Core/Orm/Validation/Element/Element.php
Element.in
public function in($in, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::IN, 'value' => $in, 'message' => $error]); } return $this; }
php
public function in($in, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::IN, 'value' => $in, 'message' => $error]); } return $this; }
[ "public", "function", "in", "(", "$", "in", ",", "$", "error", ")", "{", "if", "(", "$", "this", "->", "_exist", ")", "{", "array_push", "(", "$", "this", "->", "_constraints", ",", "[", "'type'", "=>", "self", "::", "IN", ",", "'value'", "=>", "$", "in", ",", "'message'", "=>", "$", "error", "]", ")", ";", "}", "return", "$", "this", ";", "}" ]
the field value must be in @access public @param $in integer[] @param $error string @return \Gcs\Framework\Core\Orm\Validation\Element\Element @since 3.0 @package Gcs\Framework\Core\Form\Validation\Element
[ "the", "field", "value", "must", "be", "in" ]
45e58182aba6a3c6381970a1fd3c17662cff2168
https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Validation/Element/Element.php#L577-L583
1,094
fabsgc/framework
Core/Orm/Validation/Element/Element.php
Element.notIn
public function notIn($notIn, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::NOTIN, 'value' => $notIn, 'message' => $error]); } return $this; }
php
public function notIn($notIn, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::NOTIN, 'value' => $notIn, 'message' => $error]); } return $this; }
[ "public", "function", "notIn", "(", "$", "notIn", ",", "$", "error", ")", "{", "if", "(", "$", "this", "->", "_exist", ")", "{", "array_push", "(", "$", "this", "->", "_constraints", ",", "[", "'type'", "=>", "self", "::", "NOTIN", ",", "'value'", "=>", "$", "notIn", ",", "'message'", "=>", "$", "error", "]", ")", ";", "}", "return", "$", "this", ";", "}" ]
the field value must not be in @access public @param $notIn integer[] @param $error string @return \Gcs\Framework\Core\Orm\Validation\Element\Element @since 3.0 @package Gcs\Framework\Core\Form\Validation\Element
[ "the", "field", "value", "must", "not", "be", "in" ]
45e58182aba6a3c6381970a1fd3c17662cff2168
https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Validation/Element/Element.php#L595-L601
1,095
fabsgc/framework
Core/Orm/Validation/Element/Element.php
Element.length
public function length($length, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::LENGTH, 'value' => $length, 'message' => $error]); } return $this; }
php
public function length($length, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::LENGTH, 'value' => $length, 'message' => $error]); } return $this; }
[ "public", "function", "length", "(", "$", "length", ",", "$", "error", ")", "{", "if", "(", "$", "this", "->", "_exist", ")", "{", "array_push", "(", "$", "this", "->", "_constraints", ",", "[", "'type'", "=>", "self", "::", "LENGTH", ",", "'value'", "=>", "$", "length", ",", "'message'", "=>", "$", "error", "]", ")", ";", "}", "return", "$", "this", ";", "}" ]
the field size must be @access public @param $length integer @param $error string @return \Gcs\Framework\Core\Orm\Validation\Element\Element @since 3.0 @package Gcs\Framework\Core\Form\Validation\Element
[ "the", "field", "size", "must", "be" ]
45e58182aba6a3c6381970a1fd3c17662cff2168
https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Validation/Element/Element.php#L613-L619
1,096
fabsgc/framework
Core/Orm/Validation/Element/Element.php
Element.lengthMin
public function lengthMin($lengthMin, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::LENGTHMIN, 'value' => $lengthMin, 'message' => $error]); } return $this; }
php
public function lengthMin($lengthMin, $error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::LENGTHMIN, 'value' => $lengthMin, 'message' => $error]); } return $this; }
[ "public", "function", "lengthMin", "(", "$", "lengthMin", ",", "$", "error", ")", "{", "if", "(", "$", "this", "->", "_exist", ")", "{", "array_push", "(", "$", "this", "->", "_constraints", ",", "[", "'type'", "=>", "self", "::", "LENGTHMIN", ",", "'value'", "=>", "$", "lengthMin", ",", "'message'", "=>", "$", "error", "]", ")", ";", "}", "return", "$", "this", ";", "}" ]
the field size must more than @access public @param $lengthMin integer @param $error string @return \Gcs\Framework\Core\Orm\Validation\Element\Element @since 3.0 @package Gcs\Framework\Core\Form\Validation\Element
[ "the", "field", "size", "must", "more", "than" ]
45e58182aba6a3c6381970a1fd3c17662cff2168
https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Validation/Element/Element.php#L631-L637
1,097
fabsgc/framework
Core/Orm/Validation/Element/Element.php
Element.mail
public function mail($error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::MAIL, 'message' => $error]); } return $this; }
php
public function mail($error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::MAIL, 'message' => $error]); } return $this; }
[ "public", "function", "mail", "(", "$", "error", ")", "{", "if", "(", "$", "this", "->", "_exist", ")", "{", "array_push", "(", "$", "this", "->", "_constraints", ",", "[", "'type'", "=>", "self", "::", "MAIL", ",", "'message'", "=>", "$", "error", "]", ")", ";", "}", "return", "$", "this", ";", "}" ]
the field must be an email address @access public @param $error string @return \Gcs\Framework\Core\Orm\Validation\Element\Element @since 3.0 @package Gcs\Framework\Core\Form\Validation\Element
[ "the", "field", "must", "be", "an", "email", "address" ]
45e58182aba6a3c6381970a1fd3c17662cff2168
https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Validation/Element/Element.php#L720-L726
1,098
fabsgc/framework
Core/Orm/Validation/Element/Element.php
Element.int
public function int($error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::INT, 'message' => $error]); } return $this; }
php
public function int($error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::INT, 'message' => $error]); } return $this; }
[ "public", "function", "int", "(", "$", "error", ")", "{", "if", "(", "$", "this", "->", "_exist", ")", "{", "array_push", "(", "$", "this", "->", "_constraints", ",", "[", "'type'", "=>", "self", "::", "INT", ",", "'message'", "=>", "$", "error", "]", ")", ";", "}", "return", "$", "this", ";", "}" ]
the field must be an int @access public @param $error string @return \Gcs\Framework\Core\Orm\Validation\Element\Element @since 3.0 @package Gcs\Framework\Core\Form\Validation\Element
[ "the", "field", "must", "be", "an", "int" ]
45e58182aba6a3c6381970a1fd3c17662cff2168
https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Validation/Element/Element.php#L737-L743
1,099
fabsgc/framework
Core/Orm/Validation/Element/Element.php
Element.float
public function float($error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::FLOAT, 'message' => $error]); } return $this; }
php
public function float($error) { if ($this->_exist) { array_push($this->_constraints, ['type' => self::FLOAT, 'message' => $error]); } return $this; }
[ "public", "function", "float", "(", "$", "error", ")", "{", "if", "(", "$", "this", "->", "_exist", ")", "{", "array_push", "(", "$", "this", "->", "_constraints", ",", "[", "'type'", "=>", "self", "::", "FLOAT", ",", "'message'", "=>", "$", "error", "]", ")", ";", "}", "return", "$", "this", ";", "}" ]
the field must be a float @access public @param $error string @return \Gcs\Framework\Core\Orm\Validation\Element\Element @since 3.0 @package Gcs\Framework\Core\Form\Validation\Element
[ "the", "field", "must", "be", "a", "float" ]
45e58182aba6a3c6381970a1fd3c17662cff2168
https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Orm/Validation/Element/Element.php#L754-L760