query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Send incidents comment mail. | public function sendIncidentCommentMail($logginUser, $incidentComment)
{
$url = config('app.front_url').'/#/incidents/detail/'. $incidentComment->incident_id;
$incidentUsers = $this->_getAssignIncidentUsers($incidentComment->incident_id);
$email_template = EmailTemplate::where('type', 'incident_comments')->first();
if (!empty($email_template) && !empty($incidentUsers)) {
$incidentName = $incidentUsers->incident_name;
foreach ($incidentUsers->users as $key => $value) {
$message = $email_template->template_body;
$subject = $email_template->template_subject;
$posted_by = str_replace("{POSTED_BY}", $logginUser->firstname.' '.$logginUser->lastname, $message);
$incident_name = str_replace("{INCIDENT_TITLE}", $incidentName, $posted_by);
$site_url = str_replace("{COMMENT_URL}", $url, $incident_name);
$comment = str_replace("{COMMENT_MESSAGE}", $incidentComment->comment, $site_url);
$message = str_replace("{SITE_NAME}", config('core.COMPANY_NAME'), $comment);
$this->_sendEmailsInQueue(
$value->email,
$value->name,
$subject,
$message
);
}
}
} | [
"public function notifyCommentAction()\n {\n $commentId = $this->getRequest()->getParam('id');\n $repository = $this->getEntityManager()->getRepository(\\Application\\Model\\Comment::class);\n $comment = $repository->findOneById($commentId);\n $discussion = $comment->getDiscussion();\n $users = $this->getEntityManager()->getRepository(\\Application\\Model\\User::class)->getAllForCommentNotification($comment);\n\n $subject = 'Discussion - ' . $discussion->getName();\n $mailParams = [\n 'comment' => $comment,\n 'discussion' => $discussion,\n ];\n\n $this->sendMail($users, $subject, new ViewModel($mailParams));\n }",
"public function sendCommentEmails( Smut_Request $req ) {\n \n $page = $req->page;\n \n $this->sendAdminNotification( $page );\n $this->sendReplyNotifications( $page );\n \n }",
"private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => 'opublisher@gmail.com',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => 'opublisher@gmail.com',\r\n 'fromName' => 'opublisher@gmail.com',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }",
"public function sendEmailNotifications()\n {\n //z formularoveho prvku 'notifications' si vezmu aktualni vazby\n $user_id_list = $this->_form_items['notifications']->getValue();\n\n //pokud nebyly zvoleni zadni uzivatele, tak se emailova notifikace\n //nebude odesilat\n if (empty($user_id_list))\n {\n return;\n }\n\n //nactu si cilovy zaznam (ten ke kteremu delam komentar) - jeho preview bude v emailu\n $relid = $this->_model->relid;\n $table_name = lognumber::getTableName($this->_model->reltype);\n $rel_record = ORM::factory($table_name, $relid);\n\n //ID aktualniho uzivatele\n $userid = Auth::instance()->get_user()->pk();\n\n //pripravim si subject pro email\n $subject = __('comment.new_comment_notifications', array(\n ':rel_record_preview' => $rel_record->preview(),\n ));\n\n //pripravim si body pro email\n $body = View::factory('comment/email/body', array(\n 'rel_record_preview' => $rel_record->preview(),\n 'user_preview' => Auth::instance()->get_user()->name(),\n 'message' => $this->_model->_text,\n 'attachements' => $this->_model->attachements->find_all(),\n //odkaz na podsekci preview kde jsou zobrazeny komentare\n 'show_all_coments_link' => appurl::object_overview($table_name, $relid, NULL, 'comments'),\n //odkaz na akci kontroleru, ktera odhlasi uzivatele z odberu\n 'unsign_from_notifications' => appurl::object_action('comment', 'unsign', array($this->_model->reltype, $this->_model->relid, $userid))\n ));\n\n //nactu si vschny uzivatele, na ktere pujde emailove upozorneni\n //nacitam kompletni modely, protoze budu potrebovat jejich emailove adresy\n //ktere mohou byt klidne i v jinych relacnich tabulkach (napriklad pri vazbe\n //uzivatel - makler, apod.)\n $users = ORM::factory('user')->where('public', '=', '1')\n ->where('userid', 'IN', (array)$user_id_list)\n ->find_all();\n\n //email jde na kazdeho z nich\n foreach ($users as $user)\n {\n //vlozi email do fronty k odeslani (ta je zpracovavana pomoci cronu)\n Emailq::factory()->add_email($user->contact_email(),\n $user->name(),\n $subject,\n $body);\n }\n }",
"public function sendMail() {\n\t\t//get the job id\n\t\t$jobid = Input::get('jobid');\n\n\t\t//get the data off the commentor\n\t\t$commentor = Auth::user()->PK_userId;\n\t\t$commentorName = Auth::user()->name;\n\n\t\t//get the job and his owner\n\t\t$job = Job::find($jobid);\n\t\t$user = User::find($job->FK_userId);\n\t\t\n\t\t//store the user info in varibales\n\t\t$name = $user->name;\n\t\t$email = $user->email;\n\n\t\t//get the comment\n\t\t$comment = Input::get('comment');\n\n\t\t//set the data to use in the email ready\n\t\t$data = array(\n\t\t\t'name' \t\t\t\t=> $name,\n\t\t\t'email'\t\t\t\t=> $email,\n\t\t\t'commentorName'\t\t=> $commentorName,\n\t\t\t'comment' \t\t\t=> $comment,\n\t\t\t'jobid'\t\t\t\t=> $jobid\n\t\t);\n\t\t\t\n\t\t//send the owner off the job to notify him there is a new comment on his job\n\t\tMail::send('emails.comment', $data , function($message) use($email, $name) {\n\t\t\t$message->to($email, $name)->subject('You got a new comment on youre job'); \n\t\t});\n\t}",
"private function sendInvoiceEmail()\n {\n // We can't send an invoice if we don't know the current transaction\n if (!isset($this->_postArray['brq_transactions'])) {\n return;\n }\n\n /** @var Mage_Sales_Model_Resource_Order_Invoice_Collection $invoiceCollection */\n $invoiceCollection = $this->_order->getInvoiceCollection()\n ->addFieldToFilter('transaction_id', array('eq' => $this->_postArray['brq_transactions']))\n ->setOrder('entity_id', Mage_Sales_Model_Resource_Order_Invoice_Collection::SORT_ORDER_DESC);\n\n /** @var Mage_Sales_Model_Order_Invoice $invoice */\n $invoice = $invoiceCollection->getFirstItem();\n\n if ($invoice->getId() && !$invoice->getEmailSent()) {\n $comment = $this->getNewestInvoiceComment($invoice);\n\n $invoice->sendEmail(true, $comment)\n ->setEmailSent(true)\n ->save();\n }\n }",
"public function sendAgentsNotificationEmail(){\n //Get comments on this account which haven't been sent as notifications yet\n $comments = $this->getComments()->where([\n 'comment_notification_email_sent' => Comment::NOTIFICATION_EMAIL_SENT_FALSE\n ])->orderBy('comment_datetime DESC')->asArray()->all();\n\n $numComments = count($comments);\n if($numComments > 0)\n {\n //Get Agents with Email Notifications Enabled\n $agents = $this->getAgents()->where([\n 'agent_email_preference' => \\common\\models\\Agent::PREF_EMAIL_DAILY,\n 'agent_status' => \\common\\models\\Agent::STATUS_ACTIVE,\n ])->asArray()->all();\n\n $numAgents = count($agents);\n if($numAgents > 0)\n {\n //Get Recent Account Activity\n $activities = $this->getActivities()->with('agent')->limit(5)->asArray()->all();\n\n $subject = Yii::t('frontend', 'You have {n,plural,=1{a new comment} other{# new comments}} on @{accountName}', ['n' => $numComments, 'accountName' => $this->user_name]);\n\n //Send email to all these agents with summary\n foreach($agents as $agent){\n Yii::$app->mailer->compose([\n 'html' => 'agent/agentNotification',\n ], [\n 'accountName' => $this->user_name,\n 'numComments' => $numComments,\n 'comments' => $comments,\n 'activities' => $activities\n ])\n ->setFrom([\\Yii::$app->params['supportEmail'] => \\Yii::$app->name ])\n ->setTo($agent['agent_email'])\n ->setSubject($subject)\n ->send();\n }\n }\n\n //Mark all comments for this account as sent via email\n Comment::updateAll([\n 'comment_notification_email_sent' => Comment::NOTIFICATION_EMAIL_SENT_TRUE\n ],[\n 'user_id' => $this->user_id\n ]);\n\n }\n }",
"protected function ___sendAdminNotificationEmail(Comment $comment) {\n\n\t\tif(!$this->field->get('notificationEmail')) return false;\n\t\t\n\t\t$field = $this->field;\n\t\t$page = $this->page; \n\t\t$actionURL = $page->httpUrl . \"?field=$field->name&page_id=$page->id&code=$comment->code&comment_success=\";\n\n\t\t// skip notification when spam\n\t\tif($comment->status == Comment::statusSpam && !$field->get('notifySpam')) return 0;\n\n\t\tif($comment->status == Comment::statusPending) {\n\t\t\t$status = $this->_(\"Pending Approval\");\n\t\t\t$actionURL .= \"approve\";\n\t\t\t$actionLabel = $this->_('Approve Now'); \n\t\t} else if($comment->status == Comment::statusApproved) {\n\t\t\t$status = $this->_(\"Approved\");\n\t\t\t$actionURL .= \"spam\";\n\t\t\t$actionLabel = $this->_('Mark as SPAM'); \n\t\t} else if($comment->status == Comment::statusSpam) {\n\t\t\t$status = sprintf($this->_(\"SPAM - will be deleted automatically after %d days\"), $field->get('deleteSpamDays'));\n\t\t\t$actionURL .= \"approve\";\n\t\t\t$actionLabel = $this->_('Not SPAM: Approve Now'); \n\t\t} else {\n\t\t\t$actionURL = '';\n\t\t\t$actionLabel = '';\n\t\t\t$status = \"Unknown\";\n\t\t}\n\n\t\t$subject = sprintf($this->_('Comment posted to: %s'), $this->wire('config')->httpHost . \" - $page->title\");\n\t\t\n\t\t$values = array(\n\t\t\t'page' => array(\n\t\t\t\t'label' => $this->_x('Page', 'email-body'), \n\t\t\t\t'value' => $page->httpUrl\n\t\t\t),\n\t\t\t'cite' => array(\n\t\t\t\t'label' => $this->_x('From', 'email-body'),\n\t\t\t\t'value' => $comment->cite, \n\t\t\t),\t\n\t\t\t'email' => array(\n\t\t\t\t'label' => $this->_x('Email', 'email-body'),\n\t\t\t\t'value' => $comment->email\n\t\t\t), \n\t\t\t'website' => array(\n\t\t\t\t'label' => $this->_x('Website', 'email-body'),\n\t\t\t\t'value' => $comment->website, \n\t\t\t),\n\t\t\t'stars' => array(\n\t\t\t\t'label' => $this->_x('Stars', 'email-body'),\n\t\t\t\t'value' => $comment->stars,\n\t\t\t),\n\t\t\t'status' => array(\n\t\t\t\t'label' => $this->_x('Status', 'email-body'),\n\t\t\t\t'value' => $status\n\t\t\t),\n\t\t\t'action' => array(\n\t\t\t\t'label' => $this->_x('Action', 'email-body'), \n\t\t\t\t'value' => \"$actionLabel: $actionURL\"\n\t\t\t), \n\t\t);\n\n\t\tif(!$comment->stars) unset($values['stars']);\n\t\t\n\t\t$values['text'] = array(\n\t\t\t'label' => $this->_x('Text', 'email-body'),\n\t\t\t'value' => $comment->text\n\t\t);\n\t\t\n\t\t$body = '';\n\t\t$bodyHTML = \n\t\t\t\"<html><head><body>\\n\" . \n\t\t\t\"<table width='100%' cellpadding='0' cellspacing='0' border='0'>\\n\";\n\t\t\n\t\tforeach($values as $key => $info) {\n\t\t\t\n\t\t\t$body .= \"$info[label]: $info[value]\\n\";\n\t\t\n\t\t\tif($key == 'action') continue; \n\t\t\t\n\t\t\tif($key == 'status') {\n\t\t\t\t$value = \"$info[value] (<a href='$actionURL'>$actionLabel</a>)\";\n\t\t\t\t\n\t\t\t} else if($key == 'page') { \n\t\t\t\t$editUrl = $page->editUrl(true);\n\t\t\t\t$value = \"<a href='$info[value]'>$page->title</a> (<a href='$editUrl'>\" . $this->_('Edit') . \")\";\n\t\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$value = $this->wire('sanitizer')->entities($info['value']);\n\t\t\t}\n\t\t\t\n\t\t\t$bodyHTML .= \n\t\t\t\t\"<tr>\" . \n\t\t\t\t\"<td style='padding: 5px; border-bottom: 1px solid #ccc; font-weight: bold; vertical-align: top'>$info[label]</td>\" . \n\t\t\t\t\"<td style='padding: 5px; border-bottom: 1px solid #ccc; width: 90%;'>$value</td>\" . \n\t\t\t\t\"</tr>\\n\";\n\t\t}\n\t\t\n\t\t$bodyHTML .= \"</table></body></html>\\n\\n\";\n\n\t\t$emails = $this->parseEmails($field->get('notificationEmail')); \t\n\t\tif(count($emails)) {\n\t\t\t$mail = $this->wire('mail')->new();\n\t\t\tforeach($emails as $email) $mail->to($email);\n\t\t\t$mail->subject($subject)->body($body)->bodyHTML($bodyHTML);\n\t\t\t$fromEmail = $this->getFromEmail();\n\t\t\tif($fromEmail) $mail->from($fromEmail);\n\t\t\treturn $mail->send();\n\t\t}\n\t\t\n\t\treturn 0; \t\n\t}",
"public function sendCommentEmail() {\n // Only works for ajax requests\n $this->onlyAjaxRequests();\n\n $json = [];\n $user = $this->getLoggedInUser();\n\n if ($user && isset($_POST['data'])) {\n $data = json_decode($_POST['data'], true);\n if ($image = $this->imageModel->isImageExists($data['image_id'])) {\n $imageOwner = $this->userModel->findUser(['id' => $image['user_id']]);\n $message = \"<p>\" . $user['login'] . \" recently commented your photo:</p>\";\n $message .= \"<p>\\\"<q>\" . htmlspecialchars($data['comment']) . \"</q>\\\"</p>\";\n if (!$this->sendEmail($imageOwner['email'], $imageOwner['login'], $message)) {\n $json['message'] = 'Could not sent an email';\n }\n } else {\n $json['message'] = 'Image does not exists';\n }\n } else {\n $json['message'] = 'Image does not exists';\n }\n\n echo json_encode($json);\n }",
"function ac_notifier_notify( $comment_id, $params ) {\n global $bp;\n extract( $params );\n\n $users = ac_notifier_find_involved_persons( $activity_id );\n $activity=new BP_Activity_Activity( $activity_id );\n //since there is a bug in bp 1.2.9 and causes trouble with private notificatin, so let us not notify for any of the private activities\n if( $activity->hide_sitewide )\n return;\n //push the original poster user_id, if the original poster has not commented on his/her status yet\n if( !in_array( $activity->user_id, $users ) && ( get_current_user_id() != $activity->user_id ) )//if someone else is commenting\n array_push ( $users, $activity->user_id );\n \n foreach( (array)$users as $user_id ){\n //create a notification\n bp_notifications_add_notification( array(\n \n 'item_id' => $activity_id,\n 'user_id' => $user_id,\n 'component_name' => $bp->ac_notifier->id,\n 'component_action' => 'new_activity_comment_'.$activity_id \n \n ));//a hack to not allow grouping by component,action, rather group by component and individual action item\n }\n }",
"public function actionEmail()\n {\n $item = $this->model->getItem($this->model->getSavedVariable('last_stored_visit'));\n $body = $this->getVsisitEmailBody($item);\n $subject = '!MPROVE - Performance Dialog Observations - ' . $item->name . ' / ' . date('d M Y', $item->date_added);\n $this->sendItemEmail($body, $subject);\n }",
"function comment_mail_notify($comment_id) {\n\t\t$comment = get_comment($comment_id);\n\t\t$parent_id = $comment->comment_parent ? $comment->comment_parent : '';\n\t\t$spam_confirmed = $comment->comment_approved;\n\t\tif (($parent_id != '') && ($spam_confirmed != 'spam')) {\n\t\t\t$wp_email = 'no-reply@' . preg_replace('#^www.#', '', strtolower($_SERVER['SERVER_NAME'])); //e-mail 发出点, no-reply 可改为可用的 e-mail.\n\t\t\t$to = trim(get_comment($parent_id)->comment_author_email);\n\t\t\t$subject = '您在 [' . get_option(\"blogname\") . '] 的留言有了回复';\n\t\t\t$message = '\n\t\t\t\t<div style=\"background-color:#eef2fa; border:1px solid #d8e3e8; color:#111; padding:0 15px; -moz-border-radius:5px; -webkit-border-radius:5px; -khtml-border-radius:5px;\">\n\t\t\t\t<p><strong>' . trim(get_comment($parent_id)->comment_author) . '</strong>, 您好!</p>\n\t\t\t\t<p>您曾在 <a href=\"'.site_url( '/' ).'\" target=\"_blank\">'.get_option('blogname').'</a> 《' . get_the_title($comment->comment_post_ID) . '》的留言:</p>\n\t\t\t\t<p style=\"text-indent:2em;\">'. trim(get_comment($parent_id)->comment_content) . '</p>\n\t\t\t\t<hr />\n\t\t\t\t<p> <a href=\"'.site_url( '/' ).'\" target=\"_blank\">'. trim($comment->comment_author) . '</a> 给您的回复:</p>\n\t\t\t\t<p style=\"text-indent:2em;\">'. trim($comment->comment_content) . '</p>\n\t\t\t\t<p>您可以点击 <a href=\"'.get_permalink( $comment->comment_post_ID ).'#comment-'.$parent_id.'\" target=\"_blank\">查看回复完整內容</a></p>\n\t\t\t\t<hr />\n\t\t\t\t<p>欢迎再度光临 <a href=\"'.site_url( '/' ).'\" target=\"_blank\">'.get_option('blogname').'</a> </p>\n\t\t\t\t<p>(此邮件由系统自动发送,请勿回复.)</p>\n\t\t\t</div>';\n\t\t\t$from = \"From: \\\"\" . get_option('blogname') . \"\\\" <$wp_email>\";\n\t\t\t$headers = \"$from\\nContent-Type: text/html; charset=\" . get_option('blog_charset') . \"\\n\";\n\t\t\twp_mail( $to, $subject, $message, $headers );\n\t\t}\n\t}",
"protected function sendNewCommentMail(HyphaDomElement $comment) {\n\t\t// send newly created comment to all users\n\t\t$title = $this->getTitle();\n\t\t$linkToPage = $this->constructFullPath($this->pagename);\n\t\t$name = $this->getCommentCommenter($comment);\n\t\t$commentBody = $comment->getText();\n\n\t\t$subject = __('art-comment-subject', [\n\t\t\t'name' => $name,\n\t\t\t'title' => $title\n\t\t]);\n\t\t$messageArgs = [\n\t\t\t'name' => htmlspecialchars($name),\n\t\t\t'link' => htmlspecialchars($linkToPage),\n\t\t\t'title' => htmlspecialchars($title),\n\t\t\t'comment' => nl2br(htmlspecialchars($commentBody)),\n\t\t];\n\t\t$message = __('art-comment-body', $messageArgs);\n\t\t$this->sendMail(getUserEmailList(), $subject, $message);\n\n\t\t$subscriberSubject = __('art-comment-subscriber-subject', [\n\t\t\t'name' => $name,\n\t\t\t'title' => $title\n\t\t]);\n\t\t$subscriberMessage = __('art-comment-subscriber-body', $messageArgs);\n\n\t\t// also send newly create comment to all who subscribed to this discussion, with unsubscribe link\n\t\tforeach ($this->getSubscribers($comment) as $subscriber) {\n\t\t\t$email = $subscriber->getAttribute(self::FIELD_NAME_DISCUSSION_SUBSCRIBER_EMAIL);\n\n\t\t\t// Do not notify people of their own comments\n\t\t\tif ($email == $comment->getAttribute(self::FIELD_NAME_DISCUSSION_COMMENTER_EMAIL))\n\t\t\t\tcontinue;\n\n\t\t\t$code = $subscriber->getAttribute(self::FIELD_NAME_DISCUSSION_SUBSCRIBER_UNSUBSCRIBE_CODE);\n\t\t\t// include email for server record purposes\n\t\t\t$path = hypha_substitute(self::PATH_UNSUBSCRIBE_CODE, ['address' => $email, 'code' => $code]);\n\t\t\t$linkToUnsubscribe = $this->constructFullPath($this->pagename . '/' . $path);\n\t\t\t$message = $subscriberMessage;\n\t\t\t$message .= '<p><a href=\"' . htmlspecialchars($linkToUnsubscribe) . '\">' . htmlspecialchars(__('art-unsubscribe')) . '</a></p>';\n\t\t\t$this->sendMail($email, $subscriberSubject, $message);\n\t\t}\n\t}",
"function notifyComments($cids, $type)\r\n {\r\n $my = JFactory::getUser();\r\n\r\n $database =& JFactory::getDBO();\r\n\r\n\r\n if (is_array($cids)) {\r\n $cids = implode(',',$cids);\r\n }\r\n\r\n $sentemail = \"\";\r\n $database->setQuery(\"SELECT * FROM #__comment WHERE id IN ($cids)\");\r\n $rows = $database->loadObjectList();\r\n if ($rows) {\r\n $query = \"SELECT email FROM #__users WHERE id='\".$my->id.\"' LIMIT 1\";\r\n $database->SetQuery($query);\r\n $myemail = $database->loadResult();\r\n $_notify_users = $this->_notify_users;\r\n\r\n foreach($rows as $row) {\r\n $this->_notify_users = $_notify_users;\r\n $this->setIDs($row->id, $row->contentid);\r\n $this->resetLists();\r\n $this->lists['name'] \t= $row->name;\r\n $this->lists['title'] \t= $row->title;\r\n $this->lists['notify'] \t= $row->notify;\r\n $this->lists['comment']\t= $row->comment;\r\n\r\n $email_writer = $row->email;\r\n /*\r\n * notify writer of approval\r\n */\r\n if ($row->userid > 0) {\r\n $query = \"SELECT email FROM #__users WHERE id='\".$row->userid.\"' LIMIT 1\";\r\n $database->SetQuery($query);\r\n $result = $database->loadAssocList();\r\n if ($result) {\r\n $user = $result[0];\r\n $email_writer = $user['email'];\r\n }\r\n }\r\n\r\n if ($email_writer && $email_writer != $myemail) {\r\n switch ($type) {\r\n \t\t\tcase 'publish':\r\n $this->lists['subject'] = _JOOMLACOMMENT_NOTIFY_PUBLISH_SUBJECT;\r\n $this->lists['message'] = _JOOMLACOMMENT_NOTIFY_PUBLISH_MESSAGE;\r\n break;\r\n case 'unpublish':\r\n $this->lists['subject'] = _JOOMLACOMMENT_NOTIFY_UNPUBLISH_SUBJECT;\r\n $this->lists['message'] = _JOOMLACOMMENT_NOTIFY_UNPUBLISH_MESSAGE;\r\n break;\r\n case 'delete' :\r\n $this->lists['subject'] = _JOOMLACOMMENT_NOTIFY_DELETE_SUBJECT;\r\n $this->lists['message'] = _JOOMLACOMMENT_NOTIFY_DELETE_MESSAGE;\r\n break;\r\n }\r\n\r\n $sentemail .= ($sentemail ? ';' : '').$this->notifyMailList($temp=array($email_writer));\r\n $exclude = $myemail ? ($email_writer.','.$myemail): $email_writer;\r\n } else {\r\n $exclude = $myemail ? $myemail:\"\";\r\n }\r\n\t\t\t /*\r\n\t\t\t * notify users, moderators, admin\r\n\t\t\t */\r\n switch ($type) {\r\n case 'publish':\r\n $this->lists['subject']\t= _JOOMLACOMMENT_NOTIFY_PUBLISH_SUBJECT;\r\n $this->lists['message']\t= _JOOMLACOMMENT_NOTIFY_PUBLISH_MESSAGE;\r\n break;\r\n case 'unpublish':\r\n $this->_notify_users = false;\r\n $this->lists['subject']\t= _JOOMLACOMMENT_NOTIFY_UNPUBLISH_SUBJECT;\r\n $this->lists['message']\t= _JOOMLACOMMENT_NOTIFY_UNPUBLISH_MESSAGE;\r\n break;\r\n case 'delete' :\r\n $this->_notify_users = false;\r\n $this->lists['subject']\t= _JOOMLACOMMENT_NOTIFY_DELETE_SUBJECT;\r\n $this->lists['message']\t= _JOOMLACOMMENT_NOTIFY_DELETE_MESSAGE;\r\n break;\r\n }\r\n//\t \t \techo implode(',', $notification->getMailList($row->contentid));\r\n $templist = $this->getMailList($row->contentid, $exclude);\r\n $sentemail .= ($sentemail ? ';' : '').$this->notifyMailList($templist);\r\n }\r\n }\r\n return $sentemail;\r\n }",
"public function action_comment_report() {\n\t\t// Check if SwiftMailer installed\n\t\tif ( ! Kohana::find_file('vendor', 'swift/lib/swift_required'))\n\t\t{\n\t\t\t$this->request->response = 'Can not email daily comment report. SwiftMailer is not installed.';\n\t\t\treturn;\n\t\t}\n\n\t\t// Generate report\n\t\t$report = Request::factory('comments/blog-admin/report/86400')->execute()->response;\n\n\t\ttry\n\t\t{\n\t\t\t// Include the SwiftMailer autoloader\n\t\t\trequire_once Kohana::find_file('vendor', 'swift/lib/swift_required');\n\n\t\t\t// Create the message\n\t\t\t$message = Swift_Message::newInstance()\n\t\t\t\t->setContentType(Kohana::config('blog.comment_report.email_type'))\n\t\t\t\t->setSubject(Kohana::config('blog.comment_report.email_subject'))\n\t\t\t\t->setFrom(Kohana::config('blog.comment_report.email_from'))\n\t\t\t\t->setTo(Kohana::config('blog.comment_report.email_to'))\n\t\t\t\t->setBody($report);\n\n\t\t\t// Create the transport\n\t\t\t$transport = Swift_SmtpTransport::newInstance()\n\t\t\t\t->setHost(Kohana::config('email.options.hostname'))\n\t\t\t\t->setPort(Kohana::config('email.options.port'))\n\t\t\t\t->setEncryption(Kohana::config('email.options.encryption'))\n\t\t\t\t->setUsername(Kohana::config('email.options.username'))\n\t\t\t\t->setPassword(Kohana::config('email.options.password'));\n\n\t\t\t// Create the mailer\n\t\t\t$mailer = Swift_Mailer::newInstance($transport);\n\n\t\t\t// Send the message\n\t\t\t$mailer->send($message);\n\n\t\t\t$this->request->response = 'Daily comment report email sent.';\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tKohana::$log->add(Kohana::ERROR, 'Error occured sending daily comment report. '.$e->getMessage());\n\t\t\t$this->request->response = 'Error sending email report.'.PHP_EOL;\n\t\t}\n\t}",
"public function SendIssueReport()\n {\n if (count($this->issues) > 0)\n {\n $body = \"The following strips had issues:\\n\\n\";\n foreach($this->issues as $c)\n $body .= $c->report();\n\n mail(self::ME, 'Comics issues - '.date('F jS, Y \\a\\t g:ia'), $body.Issue::LINE);\n }\n }",
"function sendVotesEmail($registrant, $jlist)\n{\n $contest = $_SESSION['contest'];\n $name = $_SESSION['ctst_name'];\n $subject = $name . \" vote for judges.\";\n $mailContent = $registrant['givenName'] . ' ' . $registrant['familyName'] .\n ' IAC member number ' . $registrant['iacID'] .\n ' voted as follows for judges at the ' . $name . \"\\n\\n\" . $jlist . \"\\n\\n\";\n $mailContent .= automatedMessage($name);\n $headers = \"From: \" . ADMIN_EMAIL . \"\\r\\n\";\n $headers .= \"CC: \" . $registrant['email'] . \"\\r\\n\";\n do_email($contest['voteEmail'], $subject, $mailContent, $headers);\n}",
"public function reportComment() {\n $commentId = $this->request->getParameter(\"comId\");\n $postId = $this->request->getParameter(\"postId\");\n $this->comment->report($commentId);\n $this->redirect('Post','index/'.$postId);\n }",
"public function email_reminder()\n {\n $remind=$this->Budget_model->get_budget_reminders();\n\n if ($remind) {\n \n foreach ($remind as $res) {\n \n echo $res->user_id;\n \n }\n }\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks the mime type to see if it is an image | final public function isImage()
{
if (substr($this->mime, 0, 6) == 'image/') {
return true;
} else {
return false;
}
} | [
"protected function isImage()\n {\n \treturn str_contains($this->media->mime_type, 'image');\n\t}",
"public function isImage()\n\t{\n\t\treturn substr($this->mime_type, 0, 5) === 'image';\n\t}",
"function is_image()\n\t{\n\t\treturn (strpos($this->mimetype, 'image/') !== false) ? true : false;\n\t}",
"public function is_image()\n {\n if (substr($this->file->getMimeType(), 0, 5) == 'image') {\n return true;\n } else {\n return false ;\n }\n }",
"function is_image(){\r\n\t\tif (stristr($this->file_type, \"image/\") !== false){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"private function isImage()\n {\n return preg_match('/image/i', $this->type);\n }",
"public function is_image()\n\t{\n\t\treturn (strpos($this->mimetype, 'image/') === 0);\n\t}",
"public function isImage(){\n $ok = true;\n $fileInfo = new finfo(FILEINFO_MIME_TYPE);\n if(false === $ext = array_search($fileInfo->file($this->tmpFile), $this->imgMime, true)){\n $ok = false;\n }\n return $ok;\n }",
"public function isImage()\n {\n $meta = $this->getMimeType();\n\n if((substr($meta, 0, 5) == 'image') &&\n ($meta != 'image/tiff')) {\n return true;\n }\n\n return false;\n }",
"function is_image($mime)\n {\n return substr($mime, 0, 5) == 'image' ?: false;\n }",
"public function isImage(): bool\n\t{\n\t\treturn str_starts_with($this->getMimeType(), 'image');\n\t}",
"public function isImage() {\n $image = getimagesize($this->getPath());\n return in_array($image['mime'], self::$imageMimeType);\n }",
"public function isImage()\n {\n $imageMime = $this->getClientMediaType();\n foreach ($this->imageMimes as $imageMime) {\n if (in_array($this->type, (array) $imageMime)) {\n return true;\n }\n }\n return false;\n }",
"public function isImage()\n {\n return substr($this->type, 0, 5) == 'image';\n }",
"public function checkImageType()\n {\n if (empty($this->checkImageType)) {\n return true;\n }\n\n if (('image' == substr($this->mediaType, 0, strpos($this->mediaType, '/')))\n || (!empty($this->mediaRealType)\n && 'image' == substr($this->mediaRealType, 0, strpos($this->mediaRealType, '/')))\n ) {\n if (!@getimagesize($this->mediaTmpName)) {\n $this->setErrors(\\XoopsLocale::E_INVALID_IMAGE_FILE);\n return false;\n }\n }\n return true;\n }",
"static function IsImage($contentType)\n {\n return substr($contentType, 0, 5) == 'image';\n }",
"public function checkImageType()\r\n\t{\r\n\t\tif ( empty( $this->checkImageType ) ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif ( ( 'image' == substr( $this->mediaType, 0, strpos( $this->mediaType, '/' ) ) ) || ( !empty( $this->mediaRealType ) && 'image' == substr( $this->mediaRealType, 0, strpos( $this->mediaRealType, '/' ) ) ) ) {\r\n\t\t\tif ( !( $info = @getimagesize( $this->mediaTmpName ) ) ) {\r\n\t\t\t\t$this->setErrors( _ER_UP_INVALIDIMAGEFILE );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public function isImage()\n {\n return ($this->getType() == 'image');\n }",
"function check_image_type($source_pic)\n{\n $image_info = check_mime_type($source_pic);\n\n switch ($image_info) {\n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'goodsReceivedNoteLineDetailsGETManyRequestGRNIDLinesLineIDLineDetailsGet' | protected function goodsReceivedNoteLineDetailsGETManyRequestGRNIDLinesLineIDLineDetailsGetRequest($accept, $grnid, $line_id, $jiwa_stateful = null)
{
// verify the required parameter 'accept' is set
if ($accept === null || (is_array($accept) && count($accept) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $accept when calling goodsReceivedNoteLineDetailsGETManyRequestGRNIDLinesLineIDLineDetailsGet'
);
}
// verify the required parameter 'grnid' is set
if ($grnid === null || (is_array($grnid) && count($grnid) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $grnid when calling goodsReceivedNoteLineDetailsGETManyRequestGRNIDLinesLineIDLineDetailsGet'
);
}
// verify the required parameter 'line_id' is set
if ($line_id === null || (is_array($line_id) && count($line_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $line_id when calling goodsReceivedNoteLineDetailsGETManyRequestGRNIDLinesLineIDLineDetailsGet'
);
}
$resourcePath = '/GoodsReceivedNotes/{GRNID}/Lines/{LineID}/LineDetails';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($accept !== null) {
$headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept);
}
// header params
if ($jiwa_stateful !== null) {
$headerParams['jiwa-stateful'] = ObjectSerializer::toHeaderValue($jiwa_stateful);
}
// path params
if ($grnid !== null) {
$resourcePath = str_replace(
'{' . 'GRNID' . '}',
ObjectSerializer::toPathValue($grnid),
$resourcePath
);
}
// path params
if ($line_id !== null) {
$resourcePath = str_replace(
'{' . 'LineID' . '}',
ObjectSerializer::toPathValue($line_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json', 'application/xml']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json', 'application/xml'],
['application/x-www-form-urlencoded', 'application/json', 'application/xml']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
if($headers['Content-Type'] === 'application/json') {
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass) {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
// array has no __toString(), so we should encode it manually
if(is_array($httpBody)) {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
}
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
}
}
// this endpoint requires HTTP basic authentication
if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"public function testGoodsReceivedNoteLineDetailGETRequestGRNIDLinesLineIDLineDetailsLineDetailIDGet()\n {\n }",
"protected function goodsReceivedNoteLinePATCHRequestGRNIDLinesLineIDUpdateRequest($accept, $grnid, $line_id, $jiwa_stateful = null, $quantity_ordered = null, $quantity_delivered = null, $order_id = null, $order_no = null, $order_line_id = null, $quantity = null, $inventory_id = null, $part_no = null, $aux2 = null, $description = null, $supplier_part_no = null, $grn_line_type = null, $quantity_decimal_places = null, $last_saved_date_time = null, $classification_id = null, $classification_description = null, $tax_amount = null, $tax_id = null, $tax_rate = null, $cost = null, $currency_rate_used = null, $purchasing_classification_id = null, $purchasing_classification_description = null, $posted_to_wip = null, $job_charge = null, $use_serial_no = null, $fx_cost = null, $physical_item = null, $inventory_expected_liability_ledger_account_id = null, $inventory_expected_liability_ledger_account_no = null, $inventory_expected_liability_ledger_account_description = null, $inventory_expected_asset_ledger_account_id = null, $inventory_expected_asset_ledger_account_no = null, $inventory_expected_asset_ledger_account_description = null, $inventory_delivered_asset_ledger_account_id = null, $inventory_delivered_asset_ledger_account_no = null, $inventory_delivered_asset_ledger_account_description = null, $inventory_value_ledger_account_id = null, $inventory_value_ledger_account_no = null, $inventory_value_ledger_account_description = null, $inventory_delivered_liability_ledger_account_id = null, $inventory_delivered_liability_ledger_account_no = null, $inventory_delivered_liability_ledger_account_description = null, $inventory_wip_ledger_account_id = null, $inventory_wip_ledger_account_no = null, $inventory_wip_ledger_account_description = null, $po_line_last_saved_date_time = null, $order_units = null, $item_no = null, $in_creditor_rec_id = null, $in_supplier_warehouse_rec_id = null, $job_costing_stage_id = null, $job_costing_stage_no = null, $job_costing_stage_name = null, $job_costing_cost_centre_id = null, $job_costing_cost_centre_no = null, $job_costing_cost_centre_name = null, $job_costing_job_id = null, $job_costing_job_no = null, $unit_inc_tax = null, $line_total_inc_tax = null, $fx_line_total_ex_tax = null, $fx_decimal_places = null, $home_decimal_places = null, $use_expiry_date = null, $line_details = null, $custom_field_values = null, $body = null)\n {\n // verify the required parameter 'accept' is set\n if ($accept === null || (is_array($accept) && count($accept) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accept when calling goodsReceivedNoteLinePATCHRequestGRNIDLinesLineIDUpdate'\n );\n }\n // verify the required parameter 'grnid' is set\n if ($grnid === null || (is_array($grnid) && count($grnid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $grnid when calling goodsReceivedNoteLinePATCHRequestGRNIDLinesLineIDUpdate'\n );\n }\n // verify the required parameter 'line_id' is set\n if ($line_id === null || (is_array($line_id) && count($line_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $line_id when calling goodsReceivedNoteLinePATCHRequestGRNIDLinesLineIDUpdate'\n );\n }\n\n $resourcePath = '/GoodsReceivedNotes/{GRNID}/Lines/{LineID}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($quantity_ordered !== null) {\n $queryParams['QuantityOrdered'] = ObjectSerializer::toQueryValue($quantity_ordered);\n }\n // query params\n if ($quantity_delivered !== null) {\n $queryParams['QuantityDelivered'] = ObjectSerializer::toQueryValue($quantity_delivered);\n }\n // query params\n if ($order_id !== null) {\n $queryParams['OrderID'] = ObjectSerializer::toQueryValue($order_id);\n }\n // query params\n if ($order_no !== null) {\n $queryParams['OrderNo'] = ObjectSerializer::toQueryValue($order_no);\n }\n // query params\n if ($order_line_id !== null) {\n $queryParams['OrderLineID'] = ObjectSerializer::toQueryValue($order_line_id);\n }\n // query params\n if ($quantity !== null) {\n $queryParams['Quantity'] = ObjectSerializer::toQueryValue($quantity);\n }\n // query params\n if ($inventory_id !== null) {\n $queryParams['InventoryID'] = ObjectSerializer::toQueryValue($inventory_id);\n }\n // query params\n if ($part_no !== null) {\n $queryParams['PartNo'] = ObjectSerializer::toQueryValue($part_no);\n }\n // query params\n if ($aux2 !== null) {\n $queryParams['Aux2'] = ObjectSerializer::toQueryValue($aux2);\n }\n // query params\n if ($description !== null) {\n $queryParams['Description'] = ObjectSerializer::toQueryValue($description);\n }\n // query params\n if ($supplier_part_no !== null) {\n $queryParams['SupplierPartNo'] = ObjectSerializer::toQueryValue($supplier_part_no);\n }\n // query params\n if ($grn_line_type !== null) {\n $queryParams['GRNLineType'] = ObjectSerializer::toQueryValue($grn_line_type);\n }\n // query params\n if ($quantity_decimal_places !== null) {\n $queryParams['QuantityDecimalPlaces'] = ObjectSerializer::toQueryValue($quantity_decimal_places);\n }\n // query params\n if ($last_saved_date_time !== null) {\n $queryParams['LastSavedDateTime'] = ObjectSerializer::toQueryValue($last_saved_date_time);\n }\n // query params\n if ($classification_id !== null) {\n $queryParams['ClassificationID'] = ObjectSerializer::toQueryValue($classification_id);\n }\n // query params\n if ($classification_description !== null) {\n $queryParams['ClassificationDescription'] = ObjectSerializer::toQueryValue($classification_description);\n }\n // query params\n if ($tax_amount !== null) {\n $queryParams['TaxAmount'] = ObjectSerializer::toQueryValue($tax_amount);\n }\n // query params\n if ($tax_id !== null) {\n $queryParams['TaxID'] = ObjectSerializer::toQueryValue($tax_id);\n }\n // query params\n if ($tax_rate !== null) {\n $queryParams['TaxRate'] = ObjectSerializer::toQueryValue($tax_rate);\n }\n // query params\n if ($cost !== null) {\n $queryParams['Cost'] = ObjectSerializer::toQueryValue($cost);\n }\n // query params\n if ($currency_rate_used !== null) {\n $queryParams['CurrencyRateUsed'] = ObjectSerializer::toQueryValue($currency_rate_used);\n }\n // query params\n if ($purchasing_classification_id !== null) {\n $queryParams['PurchasingClassificationID'] = ObjectSerializer::toQueryValue($purchasing_classification_id);\n }\n // query params\n if ($purchasing_classification_description !== null) {\n $queryParams['PurchasingClassificationDescription'] = ObjectSerializer::toQueryValue($purchasing_classification_description);\n }\n // query params\n if ($posted_to_wip !== null) {\n $queryParams['PostedToWIP'] = ObjectSerializer::toQueryValue($posted_to_wip);\n }\n // query params\n if ($job_charge !== null) {\n $queryParams['JobCharge'] = ObjectSerializer::toQueryValue($job_charge);\n }\n // query params\n if ($use_serial_no !== null) {\n $queryParams['UseSerialNo'] = ObjectSerializer::toQueryValue($use_serial_no);\n }\n // query params\n if ($fx_cost !== null) {\n $queryParams['FXCost'] = ObjectSerializer::toQueryValue($fx_cost);\n }\n // query params\n if ($physical_item !== null) {\n $queryParams['PhysicalItem'] = ObjectSerializer::toQueryValue($physical_item);\n }\n // query params\n if ($inventory_expected_liability_ledger_account_id !== null) {\n $queryParams['InventoryExpectedLiability_LedgerAccountID'] = ObjectSerializer::toQueryValue($inventory_expected_liability_ledger_account_id);\n }\n // query params\n if ($inventory_expected_liability_ledger_account_no !== null) {\n $queryParams['InventoryExpectedLiability_LedgerAccountNo'] = ObjectSerializer::toQueryValue($inventory_expected_liability_ledger_account_no);\n }\n // query params\n if ($inventory_expected_liability_ledger_account_description !== null) {\n $queryParams['InventoryExpectedLiability_LedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_expected_liability_ledger_account_description);\n }\n // query params\n if ($inventory_expected_asset_ledger_account_id !== null) {\n $queryParams['InventoryExpectedAsset_LedgerAccountID'] = ObjectSerializer::toQueryValue($inventory_expected_asset_ledger_account_id);\n }\n // query params\n if ($inventory_expected_asset_ledger_account_no !== null) {\n $queryParams['InventoryExpectedAsset_LedgerAccountNo'] = ObjectSerializer::toQueryValue($inventory_expected_asset_ledger_account_no);\n }\n // query params\n if ($inventory_expected_asset_ledger_account_description !== null) {\n $queryParams['InventoryExpectedAsset_LedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_expected_asset_ledger_account_description);\n }\n // query params\n if ($inventory_delivered_asset_ledger_account_id !== null) {\n $queryParams['InventoryDeliveredAsset_LedgerAccountID'] = ObjectSerializer::toQueryValue($inventory_delivered_asset_ledger_account_id);\n }\n // query params\n if ($inventory_delivered_asset_ledger_account_no !== null) {\n $queryParams['InventoryDeliveredAsset_LedgerAccountNo'] = ObjectSerializer::toQueryValue($inventory_delivered_asset_ledger_account_no);\n }\n // query params\n if ($inventory_delivered_asset_ledger_account_description !== null) {\n $queryParams['InventoryDeliveredAsset_LedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_delivered_asset_ledger_account_description);\n }\n // query params\n if ($inventory_value_ledger_account_id !== null) {\n $queryParams['InventoryValue_LedgerAccountID'] = ObjectSerializer::toQueryValue($inventory_value_ledger_account_id);\n }\n // query params\n if ($inventory_value_ledger_account_no !== null) {\n $queryParams['InventoryValue_LedgerAccountNo'] = ObjectSerializer::toQueryValue($inventory_value_ledger_account_no);\n }\n // query params\n if ($inventory_value_ledger_account_description !== null) {\n $queryParams['InventoryValue_LedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_value_ledger_account_description);\n }\n // query params\n if ($inventory_delivered_liability_ledger_account_id !== null) {\n $queryParams['InventoryDeliveredLiability_LedgerAccountID'] = ObjectSerializer::toQueryValue($inventory_delivered_liability_ledger_account_id);\n }\n // query params\n if ($inventory_delivered_liability_ledger_account_no !== null) {\n $queryParams['InventoryDeliveredLiability_LedgerAccountNo'] = ObjectSerializer::toQueryValue($inventory_delivered_liability_ledger_account_no);\n }\n // query params\n if ($inventory_delivered_liability_ledger_account_description !== null) {\n $queryParams['InventoryDeliveredLiability_LedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_delivered_liability_ledger_account_description);\n }\n // query params\n if ($inventory_wip_ledger_account_id !== null) {\n $queryParams['InventoryWIP_LedgerAccountID'] = ObjectSerializer::toQueryValue($inventory_wip_ledger_account_id);\n }\n // query params\n if ($inventory_wip_ledger_account_no !== null) {\n $queryParams['InventoryWIP_LedgerAccountNo'] = ObjectSerializer::toQueryValue($inventory_wip_ledger_account_no);\n }\n // query params\n if ($inventory_wip_ledger_account_description !== null) {\n $queryParams['InventoryWIP_LedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_wip_ledger_account_description);\n }\n // query params\n if ($po_line_last_saved_date_time !== null) {\n $queryParams['POLineLastSavedDateTime'] = ObjectSerializer::toQueryValue($po_line_last_saved_date_time);\n }\n // query params\n if ($order_units !== null) {\n $queryParams['OrderUnits'] = ObjectSerializer::toQueryValue($order_units);\n }\n // query params\n if ($item_no !== null) {\n $queryParams['ItemNo'] = ObjectSerializer::toQueryValue($item_no);\n }\n // query params\n if ($in_creditor_rec_id !== null) {\n $queryParams['IN_Creditor_RecID'] = ObjectSerializer::toQueryValue($in_creditor_rec_id);\n }\n // query params\n if ($in_supplier_warehouse_rec_id !== null) {\n $queryParams['IN_SupplierWarehouse_RecID'] = ObjectSerializer::toQueryValue($in_supplier_warehouse_rec_id);\n }\n // query params\n if ($job_costing_stage_id !== null) {\n $queryParams['JobCostingStageID'] = ObjectSerializer::toQueryValue($job_costing_stage_id);\n }\n // query params\n if ($job_costing_stage_no !== null) {\n $queryParams['JobCostingStageNo'] = ObjectSerializer::toQueryValue($job_costing_stage_no);\n }\n // query params\n if ($job_costing_stage_name !== null) {\n $queryParams['JobCostingStageName'] = ObjectSerializer::toQueryValue($job_costing_stage_name);\n }\n // query params\n if ($job_costing_cost_centre_id !== null) {\n $queryParams['JobCostingCostCentreID'] = ObjectSerializer::toQueryValue($job_costing_cost_centre_id);\n }\n // query params\n if ($job_costing_cost_centre_no !== null) {\n $queryParams['JobCostingCostCentreNo'] = ObjectSerializer::toQueryValue($job_costing_cost_centre_no);\n }\n // query params\n if ($job_costing_cost_centre_name !== null) {\n $queryParams['JobCostingCostCentreName'] = ObjectSerializer::toQueryValue($job_costing_cost_centre_name);\n }\n // query params\n if ($job_costing_job_id !== null) {\n $queryParams['JobCostingJobID'] = ObjectSerializer::toQueryValue($job_costing_job_id);\n }\n // query params\n if ($job_costing_job_no !== null) {\n $queryParams['JobCostingJobNo'] = ObjectSerializer::toQueryValue($job_costing_job_no);\n }\n // query params\n if ($unit_inc_tax !== null) {\n $queryParams['UnitIncTax'] = ObjectSerializer::toQueryValue($unit_inc_tax);\n }\n // query params\n if ($line_total_inc_tax !== null) {\n $queryParams['LineTotalIncTax'] = ObjectSerializer::toQueryValue($line_total_inc_tax);\n }\n // query params\n if ($fx_line_total_ex_tax !== null) {\n $queryParams['FXLineTotalExTax'] = ObjectSerializer::toQueryValue($fx_line_total_ex_tax);\n }\n // query params\n if ($fx_decimal_places !== null) {\n $queryParams['FXDecimalPlaces'] = ObjectSerializer::toQueryValue($fx_decimal_places);\n }\n // query params\n if ($home_decimal_places !== null) {\n $queryParams['HomeDecimalPlaces'] = ObjectSerializer::toQueryValue($home_decimal_places);\n }\n // query params\n if ($use_expiry_date !== null) {\n $queryParams['UseExpiryDate'] = ObjectSerializer::toQueryValue($use_expiry_date);\n }\n // query params\n if ($line_details !== null) {\n $queryParams['LineDetails'] = ObjectSerializer::toQueryValue($line_details);\n }\n // query params\n if ($custom_field_values !== null) {\n $queryParams['CustomFieldValues'] = ObjectSerializer::toQueryValue($custom_field_values);\n }\n // header params\n if ($accept !== null) {\n $headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept);\n }\n // header params\n if ($jiwa_stateful !== null) {\n $headerParams['jiwa-stateful'] = ObjectSerializer::toHeaderValue($jiwa_stateful);\n }\n\n // path params\n if ($grnid !== null) {\n $resourcePath = str_replace(\n '{' . 'GRNID' . '}',\n ObjectSerializer::toPathValue($grnid),\n $resourcePath\n );\n }\n // path params\n if ($line_id !== null) {\n $resourcePath = str_replace(\n '{' . 'LineID' . '}',\n ObjectSerializer::toPathValue($line_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/x-www-form-urlencoded', 'application/json', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function goodsReceivedNoteLineGETRequestGRNIDLinesLineIDGetRequest($accept, $grnid, $line_id, $jiwa_stateful = null)\n {\n // verify the required parameter 'accept' is set\n if ($accept === null || (is_array($accept) && count($accept) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accept when calling goodsReceivedNoteLineGETRequestGRNIDLinesLineIDGet'\n );\n }\n // verify the required parameter 'grnid' is set\n if ($grnid === null || (is_array($grnid) && count($grnid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $grnid when calling goodsReceivedNoteLineGETRequestGRNIDLinesLineIDGet'\n );\n }\n // verify the required parameter 'line_id' is set\n if ($line_id === null || (is_array($line_id) && count($line_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $line_id when calling goodsReceivedNoteLineGETRequestGRNIDLinesLineIDGet'\n );\n }\n\n $resourcePath = '/GoodsReceivedNotes/{GRNID}/Lines/{LineID}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($accept !== null) {\n $headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept);\n }\n // header params\n if ($jiwa_stateful !== null) {\n $headerParams['jiwa-stateful'] = ObjectSerializer::toHeaderValue($jiwa_stateful);\n }\n\n // path params\n if ($grnid !== null) {\n $resourcePath = str_replace(\n '{' . 'GRNID' . '}',\n ObjectSerializer::toPathValue($grnid),\n $resourcePath\n );\n }\n // path params\n if ($line_id !== null) {\n $resourcePath = str_replace(\n '{' . 'LineID' . '}',\n ObjectSerializer::toPathValue($line_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/x-www-form-urlencoded', 'application/json', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function goodsReceivedNoteLinePOSTRequestGRNIDLinesPostRequest($accept, $grnid, $jiwa_stateful = null, $quantity_ordered = null, $quantity_delivered = null, $order_id = null, $order_no = null, $order_line_id = null, $quantity = null, $inventory_id = null, $part_no = null, $aux2 = null, $description = null, $supplier_part_no = null, $grn_line_type = null, $quantity_decimal_places = null, $last_saved_date_time = null, $classification_id = null, $classification_description = null, $tax_amount = null, $tax_id = null, $tax_rate = null, $cost = null, $currency_rate_used = null, $purchasing_classification_id = null, $purchasing_classification_description = null, $posted_to_wip = null, $job_charge = null, $use_serial_no = null, $fx_cost = null, $physical_item = null, $inventory_expected_liability_ledger_account_id = null, $inventory_expected_liability_ledger_account_no = null, $inventory_expected_liability_ledger_account_description = null, $inventory_expected_asset_ledger_account_id = null, $inventory_expected_asset_ledger_account_no = null, $inventory_expected_asset_ledger_account_description = null, $inventory_delivered_asset_ledger_account_id = null, $inventory_delivered_asset_ledger_account_no = null, $inventory_delivered_asset_ledger_account_description = null, $inventory_value_ledger_account_id = null, $inventory_value_ledger_account_no = null, $inventory_value_ledger_account_description = null, $inventory_delivered_liability_ledger_account_id = null, $inventory_delivered_liability_ledger_account_no = null, $inventory_delivered_liability_ledger_account_description = null, $inventory_wip_ledger_account_id = null, $inventory_wip_ledger_account_no = null, $inventory_wip_ledger_account_description = null, $po_line_last_saved_date_time = null, $order_units = null, $item_no = null, $in_creditor_rec_id = null, $in_supplier_warehouse_rec_id = null, $job_costing_stage_id = null, $job_costing_stage_no = null, $job_costing_stage_name = null, $job_costing_cost_centre_id = null, $job_costing_cost_centre_no = null, $job_costing_cost_centre_name = null, $job_costing_job_id = null, $job_costing_job_no = null, $unit_inc_tax = null, $line_total_inc_tax = null, $fx_line_total_ex_tax = null, $fx_decimal_places = null, $home_decimal_places = null, $use_expiry_date = null, $line_details = null, $custom_field_values = null, $body = null)\n {\n // verify the required parameter 'accept' is set\n if ($accept === null || (is_array($accept) && count($accept) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accept when calling goodsReceivedNoteLinePOSTRequestGRNIDLinesPost'\n );\n }\n // verify the required parameter 'grnid' is set\n if ($grnid === null || (is_array($grnid) && count($grnid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $grnid when calling goodsReceivedNoteLinePOSTRequestGRNIDLinesPost'\n );\n }\n\n $resourcePath = '/GoodsReceivedNotes/{GRNID}/Lines';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($quantity_ordered !== null) {\n $queryParams['QuantityOrdered'] = ObjectSerializer::toQueryValue($quantity_ordered);\n }\n // query params\n if ($quantity_delivered !== null) {\n $queryParams['QuantityDelivered'] = ObjectSerializer::toQueryValue($quantity_delivered);\n }\n // query params\n if ($order_id !== null) {\n $queryParams['OrderID'] = ObjectSerializer::toQueryValue($order_id);\n }\n // query params\n if ($order_no !== null) {\n $queryParams['OrderNo'] = ObjectSerializer::toQueryValue($order_no);\n }\n // query params\n if ($order_line_id !== null) {\n $queryParams['OrderLineID'] = ObjectSerializer::toQueryValue($order_line_id);\n }\n // query params\n if ($quantity !== null) {\n $queryParams['Quantity'] = ObjectSerializer::toQueryValue($quantity);\n }\n // query params\n if ($inventory_id !== null) {\n $queryParams['InventoryID'] = ObjectSerializer::toQueryValue($inventory_id);\n }\n // query params\n if ($part_no !== null) {\n $queryParams['PartNo'] = ObjectSerializer::toQueryValue($part_no);\n }\n // query params\n if ($aux2 !== null) {\n $queryParams['Aux2'] = ObjectSerializer::toQueryValue($aux2);\n }\n // query params\n if ($description !== null) {\n $queryParams['Description'] = ObjectSerializer::toQueryValue($description);\n }\n // query params\n if ($supplier_part_no !== null) {\n $queryParams['SupplierPartNo'] = ObjectSerializer::toQueryValue($supplier_part_no);\n }\n // query params\n if ($grn_line_type !== null) {\n $queryParams['GRNLineType'] = ObjectSerializer::toQueryValue($grn_line_type);\n }\n // query params\n if ($quantity_decimal_places !== null) {\n $queryParams['QuantityDecimalPlaces'] = ObjectSerializer::toQueryValue($quantity_decimal_places);\n }\n // query params\n if ($last_saved_date_time !== null) {\n $queryParams['LastSavedDateTime'] = ObjectSerializer::toQueryValue($last_saved_date_time);\n }\n // query params\n if ($classification_id !== null) {\n $queryParams['ClassificationID'] = ObjectSerializer::toQueryValue($classification_id);\n }\n // query params\n if ($classification_description !== null) {\n $queryParams['ClassificationDescription'] = ObjectSerializer::toQueryValue($classification_description);\n }\n // query params\n if ($tax_amount !== null) {\n $queryParams['TaxAmount'] = ObjectSerializer::toQueryValue($tax_amount);\n }\n // query params\n if ($tax_id !== null) {\n $queryParams['TaxID'] = ObjectSerializer::toQueryValue($tax_id);\n }\n // query params\n if ($tax_rate !== null) {\n $queryParams['TaxRate'] = ObjectSerializer::toQueryValue($tax_rate);\n }\n // query params\n if ($cost !== null) {\n $queryParams['Cost'] = ObjectSerializer::toQueryValue($cost);\n }\n // query params\n if ($currency_rate_used !== null) {\n $queryParams['CurrencyRateUsed'] = ObjectSerializer::toQueryValue($currency_rate_used);\n }\n // query params\n if ($purchasing_classification_id !== null) {\n $queryParams['PurchasingClassificationID'] = ObjectSerializer::toQueryValue($purchasing_classification_id);\n }\n // query params\n if ($purchasing_classification_description !== null) {\n $queryParams['PurchasingClassificationDescription'] = ObjectSerializer::toQueryValue($purchasing_classification_description);\n }\n // query params\n if ($posted_to_wip !== null) {\n $queryParams['PostedToWIP'] = ObjectSerializer::toQueryValue($posted_to_wip);\n }\n // query params\n if ($job_charge !== null) {\n $queryParams['JobCharge'] = ObjectSerializer::toQueryValue($job_charge);\n }\n // query params\n if ($use_serial_no !== null) {\n $queryParams['UseSerialNo'] = ObjectSerializer::toQueryValue($use_serial_no);\n }\n // query params\n if ($fx_cost !== null) {\n $queryParams['FXCost'] = ObjectSerializer::toQueryValue($fx_cost);\n }\n // query params\n if ($physical_item !== null) {\n $queryParams['PhysicalItem'] = ObjectSerializer::toQueryValue($physical_item);\n }\n // query params\n if ($inventory_expected_liability_ledger_account_id !== null) {\n $queryParams['InventoryExpectedLiability_LedgerAccountID'] = ObjectSerializer::toQueryValue($inventory_expected_liability_ledger_account_id);\n }\n // query params\n if ($inventory_expected_liability_ledger_account_no !== null) {\n $queryParams['InventoryExpectedLiability_LedgerAccountNo'] = ObjectSerializer::toQueryValue($inventory_expected_liability_ledger_account_no);\n }\n // query params\n if ($inventory_expected_liability_ledger_account_description !== null) {\n $queryParams['InventoryExpectedLiability_LedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_expected_liability_ledger_account_description);\n }\n // query params\n if ($inventory_expected_asset_ledger_account_id !== null) {\n $queryParams['InventoryExpectedAsset_LedgerAccountID'] = ObjectSerializer::toQueryValue($inventory_expected_asset_ledger_account_id);\n }\n // query params\n if ($inventory_expected_asset_ledger_account_no !== null) {\n $queryParams['InventoryExpectedAsset_LedgerAccountNo'] = ObjectSerializer::toQueryValue($inventory_expected_asset_ledger_account_no);\n }\n // query params\n if ($inventory_expected_asset_ledger_account_description !== null) {\n $queryParams['InventoryExpectedAsset_LedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_expected_asset_ledger_account_description);\n }\n // query params\n if ($inventory_delivered_asset_ledger_account_id !== null) {\n $queryParams['InventoryDeliveredAsset_LedgerAccountID'] = ObjectSerializer::toQueryValue($inventory_delivered_asset_ledger_account_id);\n }\n // query params\n if ($inventory_delivered_asset_ledger_account_no !== null) {\n $queryParams['InventoryDeliveredAsset_LedgerAccountNo'] = ObjectSerializer::toQueryValue($inventory_delivered_asset_ledger_account_no);\n }\n // query params\n if ($inventory_delivered_asset_ledger_account_description !== null) {\n $queryParams['InventoryDeliveredAsset_LedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_delivered_asset_ledger_account_description);\n }\n // query params\n if ($inventory_value_ledger_account_id !== null) {\n $queryParams['InventoryValue_LedgerAccountID'] = ObjectSerializer::toQueryValue($inventory_value_ledger_account_id);\n }\n // query params\n if ($inventory_value_ledger_account_no !== null) {\n $queryParams['InventoryValue_LedgerAccountNo'] = ObjectSerializer::toQueryValue($inventory_value_ledger_account_no);\n }\n // query params\n if ($inventory_value_ledger_account_description !== null) {\n $queryParams['InventoryValue_LedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_value_ledger_account_description);\n }\n // query params\n if ($inventory_delivered_liability_ledger_account_id !== null) {\n $queryParams['InventoryDeliveredLiability_LedgerAccountID'] = ObjectSerializer::toQueryValue($inventory_delivered_liability_ledger_account_id);\n }\n // query params\n if ($inventory_delivered_liability_ledger_account_no !== null) {\n $queryParams['InventoryDeliveredLiability_LedgerAccountNo'] = ObjectSerializer::toQueryValue($inventory_delivered_liability_ledger_account_no);\n }\n // query params\n if ($inventory_delivered_liability_ledger_account_description !== null) {\n $queryParams['InventoryDeliveredLiability_LedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_delivered_liability_ledger_account_description);\n }\n // query params\n if ($inventory_wip_ledger_account_id !== null) {\n $queryParams['InventoryWIP_LedgerAccountID'] = ObjectSerializer::toQueryValue($inventory_wip_ledger_account_id);\n }\n // query params\n if ($inventory_wip_ledger_account_no !== null) {\n $queryParams['InventoryWIP_LedgerAccountNo'] = ObjectSerializer::toQueryValue($inventory_wip_ledger_account_no);\n }\n // query params\n if ($inventory_wip_ledger_account_description !== null) {\n $queryParams['InventoryWIP_LedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_wip_ledger_account_description);\n }\n // query params\n if ($po_line_last_saved_date_time !== null) {\n $queryParams['POLineLastSavedDateTime'] = ObjectSerializer::toQueryValue($po_line_last_saved_date_time);\n }\n // query params\n if ($order_units !== null) {\n $queryParams['OrderUnits'] = ObjectSerializer::toQueryValue($order_units);\n }\n // query params\n if ($item_no !== null) {\n $queryParams['ItemNo'] = ObjectSerializer::toQueryValue($item_no);\n }\n // query params\n if ($in_creditor_rec_id !== null) {\n $queryParams['IN_Creditor_RecID'] = ObjectSerializer::toQueryValue($in_creditor_rec_id);\n }\n // query params\n if ($in_supplier_warehouse_rec_id !== null) {\n $queryParams['IN_SupplierWarehouse_RecID'] = ObjectSerializer::toQueryValue($in_supplier_warehouse_rec_id);\n }\n // query params\n if ($job_costing_stage_id !== null) {\n $queryParams['JobCostingStageID'] = ObjectSerializer::toQueryValue($job_costing_stage_id);\n }\n // query params\n if ($job_costing_stage_no !== null) {\n $queryParams['JobCostingStageNo'] = ObjectSerializer::toQueryValue($job_costing_stage_no);\n }\n // query params\n if ($job_costing_stage_name !== null) {\n $queryParams['JobCostingStageName'] = ObjectSerializer::toQueryValue($job_costing_stage_name);\n }\n // query params\n if ($job_costing_cost_centre_id !== null) {\n $queryParams['JobCostingCostCentreID'] = ObjectSerializer::toQueryValue($job_costing_cost_centre_id);\n }\n // query params\n if ($job_costing_cost_centre_no !== null) {\n $queryParams['JobCostingCostCentreNo'] = ObjectSerializer::toQueryValue($job_costing_cost_centre_no);\n }\n // query params\n if ($job_costing_cost_centre_name !== null) {\n $queryParams['JobCostingCostCentreName'] = ObjectSerializer::toQueryValue($job_costing_cost_centre_name);\n }\n // query params\n if ($job_costing_job_id !== null) {\n $queryParams['JobCostingJobID'] = ObjectSerializer::toQueryValue($job_costing_job_id);\n }\n // query params\n if ($job_costing_job_no !== null) {\n $queryParams['JobCostingJobNo'] = ObjectSerializer::toQueryValue($job_costing_job_no);\n }\n // query params\n if ($unit_inc_tax !== null) {\n $queryParams['UnitIncTax'] = ObjectSerializer::toQueryValue($unit_inc_tax);\n }\n // query params\n if ($line_total_inc_tax !== null) {\n $queryParams['LineTotalIncTax'] = ObjectSerializer::toQueryValue($line_total_inc_tax);\n }\n // query params\n if ($fx_line_total_ex_tax !== null) {\n $queryParams['FXLineTotalExTax'] = ObjectSerializer::toQueryValue($fx_line_total_ex_tax);\n }\n // query params\n if ($fx_decimal_places !== null) {\n $queryParams['FXDecimalPlaces'] = ObjectSerializer::toQueryValue($fx_decimal_places);\n }\n // query params\n if ($home_decimal_places !== null) {\n $queryParams['HomeDecimalPlaces'] = ObjectSerializer::toQueryValue($home_decimal_places);\n }\n // query params\n if ($use_expiry_date !== null) {\n $queryParams['UseExpiryDate'] = ObjectSerializer::toQueryValue($use_expiry_date);\n }\n // query params\n if ($line_details !== null) {\n $queryParams['LineDetails'] = ObjectSerializer::toQueryValue($line_details);\n }\n // query params\n if ($custom_field_values !== null) {\n $queryParams['CustomFieldValues'] = ObjectSerializer::toQueryValue($custom_field_values);\n }\n // header params\n if ($accept !== null) {\n $headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept);\n }\n // header params\n if ($jiwa_stateful !== null) {\n $headerParams['jiwa-stateful'] = ObjectSerializer::toHeaderValue($jiwa_stateful);\n }\n\n // path params\n if ($grnid !== null) {\n $resourcePath = str_replace(\n '{' . 'GRNID' . '}',\n ObjectSerializer::toPathValue($grnid),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/x-www-form-urlencoded', 'application/json', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function goodsReceivedNoteLinePOSTRequestGRNIDLinesPostWithHttpInfo($accept, $grnid, $jiwa_stateful = null, $quantity_ordered = null, $quantity_delivered = null, $order_id = null, $order_no = null, $order_line_id = null, $quantity = null, $inventory_id = null, $part_no = null, $aux2 = null, $description = null, $supplier_part_no = null, $grn_line_type = null, $quantity_decimal_places = null, $last_saved_date_time = null, $classification_id = null, $classification_description = null, $tax_amount = null, $tax_id = null, $tax_rate = null, $cost = null, $currency_rate_used = null, $purchasing_classification_id = null, $purchasing_classification_description = null, $posted_to_wip = null, $job_charge = null, $use_serial_no = null, $fx_cost = null, $physical_item = null, $inventory_expected_liability_ledger_account_id = null, $inventory_expected_liability_ledger_account_no = null, $inventory_expected_liability_ledger_account_description = null, $inventory_expected_asset_ledger_account_id = null, $inventory_expected_asset_ledger_account_no = null, $inventory_expected_asset_ledger_account_description = null, $inventory_delivered_asset_ledger_account_id = null, $inventory_delivered_asset_ledger_account_no = null, $inventory_delivered_asset_ledger_account_description = null, $inventory_value_ledger_account_id = null, $inventory_value_ledger_account_no = null, $inventory_value_ledger_account_description = null, $inventory_delivered_liability_ledger_account_id = null, $inventory_delivered_liability_ledger_account_no = null, $inventory_delivered_liability_ledger_account_description = null, $inventory_wip_ledger_account_id = null, $inventory_wip_ledger_account_no = null, $inventory_wip_ledger_account_description = null, $po_line_last_saved_date_time = null, $order_units = null, $item_no = null, $in_creditor_rec_id = null, $in_supplier_warehouse_rec_id = null, $job_costing_stage_id = null, $job_costing_stage_no = null, $job_costing_stage_name = null, $job_costing_cost_centre_id = null, $job_costing_cost_centre_no = null, $job_costing_cost_centre_name = null, $job_costing_job_id = null, $job_costing_job_no = null, $unit_inc_tax = null, $line_total_inc_tax = null, $fx_line_total_ex_tax = null, $fx_decimal_places = null, $home_decimal_places = null, $use_expiry_date = null, $line_details = null, $custom_field_values = null, $body = null)\n {\n $returnType = '\\Jiwa\\Model\\GoodsReceivedNoteLine';\n $request = $this->goodsReceivedNoteLinePOSTRequestGRNIDLinesPostRequest($accept, $grnid, $jiwa_stateful, $quantity_ordered, $quantity_delivered, $order_id, $order_no, $order_line_id, $quantity, $inventory_id, $part_no, $aux2, $description, $supplier_part_no, $grn_line_type, $quantity_decimal_places, $last_saved_date_time, $classification_id, $classification_description, $tax_amount, $tax_id, $tax_rate, $cost, $currency_rate_used, $purchasing_classification_id, $purchasing_classification_description, $posted_to_wip, $job_charge, $use_serial_no, $fx_cost, $physical_item, $inventory_expected_liability_ledger_account_id, $inventory_expected_liability_ledger_account_no, $inventory_expected_liability_ledger_account_description, $inventory_expected_asset_ledger_account_id, $inventory_expected_asset_ledger_account_no, $inventory_expected_asset_ledger_account_description, $inventory_delivered_asset_ledger_account_id, $inventory_delivered_asset_ledger_account_no, $inventory_delivered_asset_ledger_account_description, $inventory_value_ledger_account_id, $inventory_value_ledger_account_no, $inventory_value_ledger_account_description, $inventory_delivered_liability_ledger_account_id, $inventory_delivered_liability_ledger_account_no, $inventory_delivered_liability_ledger_account_description, $inventory_wip_ledger_account_id, $inventory_wip_ledger_account_no, $inventory_wip_ledger_account_description, $po_line_last_saved_date_time, $order_units, $item_no, $in_creditor_rec_id, $in_supplier_warehouse_rec_id, $job_costing_stage_id, $job_costing_stage_no, $job_costing_stage_name, $job_costing_cost_centre_id, $job_costing_cost_centre_no, $job_costing_cost_centre_name, $job_costing_job_id, $job_costing_job_no, $unit_inc_tax, $line_total_inc_tax, $fx_line_total_ex_tax, $fx_decimal_places, $home_decimal_places, $use_expiry_date, $line_details, $custom_field_values, $body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\GoodsReceivedNoteLine',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\GoodsReceivedNoteLine',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\GoodsReceivedNoteLine',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\GoodsReceivedNoteLine',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\GoodsReceivedNoteLine',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function goodsReceivedNoteLinesGETManyRequestGRNIDLinesGetWithHttpInfo($accept, $grnid, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\GoodsReceivedNoteLine[]';\n $request = $this->goodsReceivedNoteLinesGETManyRequestGRNIDLinesGetRequest($accept, $grnid, $jiwa_stateful);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\GoodsReceivedNoteLine[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\GoodsReceivedNoteLine[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\GoodsReceivedNoteLine[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\GoodsReceivedNoteLine[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function goodsReceivedNoteLineDetailPOSTRequestGRNIDLinesLineIDLineDetailsPostRequest($accept, $grnid, $line_id, $jiwa_stateful = null, $link_id = null, $quantity = null, $last_saved_date_time = null, $serial_no = null, $bin_location_id = null, $bin_location_description = null, $expiry_date = null, $body = null)\n {\n // verify the required parameter 'accept' is set\n if ($accept === null || (is_array($accept) && count($accept) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accept when calling goodsReceivedNoteLineDetailPOSTRequestGRNIDLinesLineIDLineDetailsPost'\n );\n }\n // verify the required parameter 'grnid' is set\n if ($grnid === null || (is_array($grnid) && count($grnid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $grnid when calling goodsReceivedNoteLineDetailPOSTRequestGRNIDLinesLineIDLineDetailsPost'\n );\n }\n // verify the required parameter 'line_id' is set\n if ($line_id === null || (is_array($line_id) && count($line_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $line_id when calling goodsReceivedNoteLineDetailPOSTRequestGRNIDLinesLineIDLineDetailsPost'\n );\n }\n\n $resourcePath = '/GoodsReceivedNotes/{GRNID}/Lines/{LineID}/LineDetails';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($link_id !== null) {\n $queryParams['LinkID'] = ObjectSerializer::toQueryValue($link_id);\n }\n // query params\n if ($quantity !== null) {\n $queryParams['Quantity'] = ObjectSerializer::toQueryValue($quantity);\n }\n // query params\n if ($last_saved_date_time !== null) {\n $queryParams['LastSavedDateTime'] = ObjectSerializer::toQueryValue($last_saved_date_time);\n }\n // query params\n if ($serial_no !== null) {\n $queryParams['SerialNo'] = ObjectSerializer::toQueryValue($serial_no);\n }\n // query params\n if ($bin_location_id !== null) {\n $queryParams['BinLocationID'] = ObjectSerializer::toQueryValue($bin_location_id);\n }\n // query params\n if ($bin_location_description !== null) {\n $queryParams['BinLocationDescription'] = ObjectSerializer::toQueryValue($bin_location_description);\n }\n // query params\n if ($expiry_date !== null) {\n $queryParams['ExpiryDate'] = ObjectSerializer::toQueryValue($expiry_date);\n }\n // header params\n if ($accept !== null) {\n $headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept);\n }\n // header params\n if ($jiwa_stateful !== null) {\n $headerParams['jiwa-stateful'] = ObjectSerializer::toHeaderValue($jiwa_stateful);\n }\n\n // path params\n if ($grnid !== null) {\n $resourcePath = str_replace(\n '{' . 'GRNID' . '}',\n ObjectSerializer::toPathValue($grnid),\n $resourcePath\n );\n }\n // path params\n if ($line_id !== null) {\n $resourcePath = str_replace(\n '{' . 'LineID' . '}',\n ObjectSerializer::toPathValue($line_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/x-www-form-urlencoded', 'application/json', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function salesOrderLineDetailsGETManyRequestInvoiceIDHistorysInvoiceHistoryIDLinesInvoiceLineIDLineDetailsGetRequest($accept, $invoice_id, $invoice_history_id, $invoice_line_id, $jiwa_stateful = null)\n {\n // verify the required parameter 'accept' is set\n if ($accept === null || (is_array($accept) && count($accept) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accept when calling salesOrderLineDetailsGETManyRequestInvoiceIDHistorysInvoiceHistoryIDLinesInvoiceLineIDLineDetailsGet'\n );\n }\n // verify the required parameter 'invoice_id' is set\n if ($invoice_id === null || (is_array($invoice_id) && count($invoice_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_id when calling salesOrderLineDetailsGETManyRequestInvoiceIDHistorysInvoiceHistoryIDLinesInvoiceLineIDLineDetailsGet'\n );\n }\n // verify the required parameter 'invoice_history_id' is set\n if ($invoice_history_id === null || (is_array($invoice_history_id) && count($invoice_history_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_history_id when calling salesOrderLineDetailsGETManyRequestInvoiceIDHistorysInvoiceHistoryIDLinesInvoiceLineIDLineDetailsGet'\n );\n }\n // verify the required parameter 'invoice_line_id' is set\n if ($invoice_line_id === null || (is_array($invoice_line_id) && count($invoice_line_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_line_id when calling salesOrderLineDetailsGETManyRequestInvoiceIDHistorysInvoiceHistoryIDLinesInvoiceLineIDLineDetailsGet'\n );\n }\n\n $resourcePath = '/SalesOrders/{InvoiceID}/Historys/{InvoiceHistoryID}/Lines/{InvoiceLineID}/LineDetails';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($accept !== null) {\n $headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept);\n }\n // header params\n if ($jiwa_stateful !== null) {\n $headerParams['jiwa-stateful'] = ObjectSerializer::toHeaderValue($jiwa_stateful);\n }\n\n // path params\n if ($invoice_id !== null) {\n $resourcePath = str_replace(\n '{' . 'InvoiceID' . '}',\n ObjectSerializer::toPathValue($invoice_id),\n $resourcePath\n );\n }\n // path params\n if ($invoice_history_id !== null) {\n $resourcePath = str_replace(\n '{' . 'InvoiceHistoryID' . '}',\n ObjectSerializer::toPathValue($invoice_history_id),\n $resourcePath\n );\n }\n // path params\n if ($invoice_line_id !== null) {\n $resourcePath = str_replace(\n '{' . 'InvoiceLineID' . '}',\n ObjectSerializer::toPathValue($invoice_line_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/x-www-form-urlencoded', 'application/json', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function goodsReceivedNoteLineDELETERequestGRNIDLinesLineIDDeleteAsync($accept, $grnid, $line_id, $jiwa_stateful = null, $quantity_ordered = null, $quantity_delivered = null, $order_id = null, $order_no = null, $order_line_id = null, $quantity = null, $inventory_id = null, $part_no = null, $aux2 = null, $description = null, $supplier_part_no = null, $grn_line_type = null, $quantity_decimal_places = null, $last_saved_date_time = null, $classification_id = null, $classification_description = null, $tax_amount = null, $tax_id = null, $tax_rate = null, $cost = null, $currency_rate_used = null, $purchasing_classification_id = null, $purchasing_classification_description = null, $posted_to_wip = null, $job_charge = null, $use_serial_no = null, $fx_cost = null, $physical_item = null, $inventory_expected_liability_ledger_account_id = null, $inventory_expected_liability_ledger_account_no = null, $inventory_expected_liability_ledger_account_description = null, $inventory_expected_asset_ledger_account_id = null, $inventory_expected_asset_ledger_account_no = null, $inventory_expected_asset_ledger_account_description = null, $inventory_delivered_asset_ledger_account_id = null, $inventory_delivered_asset_ledger_account_no = null, $inventory_delivered_asset_ledger_account_description = null, $inventory_value_ledger_account_id = null, $inventory_value_ledger_account_no = null, $inventory_value_ledger_account_description = null, $inventory_delivered_liability_ledger_account_id = null, $inventory_delivered_liability_ledger_account_no = null, $inventory_delivered_liability_ledger_account_description = null, $inventory_wip_ledger_account_id = null, $inventory_wip_ledger_account_no = null, $inventory_wip_ledger_account_description = null, $po_line_last_saved_date_time = null, $order_units = null, $item_no = null, $in_creditor_rec_id = null, $in_supplier_warehouse_rec_id = null, $job_costing_stage_id = null, $job_costing_stage_no = null, $job_costing_stage_name = null, $job_costing_cost_centre_id = null, $job_costing_cost_centre_no = null, $job_costing_cost_centre_name = null, $job_costing_job_id = null, $job_costing_job_no = null, $unit_inc_tax = null, $line_total_inc_tax = null, $fx_line_total_ex_tax = null, $fx_decimal_places = null, $home_decimal_places = null, $use_expiry_date = null, $line_details = null, $custom_field_values = null)\n {\n return $this->goodsReceivedNoteLineDELETERequestGRNIDLinesLineIDDeleteAsyncWithHttpInfo($accept, $grnid, $line_id, $jiwa_stateful, $quantity_ordered, $quantity_delivered, $order_id, $order_no, $order_line_id, $quantity, $inventory_id, $part_no, $aux2, $description, $supplier_part_no, $grn_line_type, $quantity_decimal_places, $last_saved_date_time, $classification_id, $classification_description, $tax_amount, $tax_id, $tax_rate, $cost, $currency_rate_used, $purchasing_classification_id, $purchasing_classification_description, $posted_to_wip, $job_charge, $use_serial_no, $fx_cost, $physical_item, $inventory_expected_liability_ledger_account_id, $inventory_expected_liability_ledger_account_no, $inventory_expected_liability_ledger_account_description, $inventory_expected_asset_ledger_account_id, $inventory_expected_asset_ledger_account_no, $inventory_expected_asset_ledger_account_description, $inventory_delivered_asset_ledger_account_id, $inventory_delivered_asset_ledger_account_no, $inventory_delivered_asset_ledger_account_description, $inventory_value_ledger_account_id, $inventory_value_ledger_account_no, $inventory_value_ledger_account_description, $inventory_delivered_liability_ledger_account_id, $inventory_delivered_liability_ledger_account_no, $inventory_delivered_liability_ledger_account_description, $inventory_wip_ledger_account_id, $inventory_wip_ledger_account_no, $inventory_wip_ledger_account_description, $po_line_last_saved_date_time, $order_units, $item_no, $in_creditor_rec_id, $in_supplier_warehouse_rec_id, $job_costing_stage_id, $job_costing_stage_no, $job_costing_stage_name, $job_costing_cost_centre_id, $job_costing_cost_centre_no, $job_costing_cost_centre_name, $job_costing_job_id, $job_costing_job_no, $unit_inc_tax, $line_total_inc_tax, $fx_line_total_ex_tax, $fx_decimal_places, $home_decimal_places, $use_expiry_date, $line_details, $custom_field_values)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function goodsReceivedNoteLinePOSTRequestGRNIDLinesPostAsyncWithHttpInfo($accept, $grnid, $jiwa_stateful = null, $quantity_ordered = null, $quantity_delivered = null, $order_id = null, $order_no = null, $order_line_id = null, $quantity = null, $inventory_id = null, $part_no = null, $aux2 = null, $description = null, $supplier_part_no = null, $grn_line_type = null, $quantity_decimal_places = null, $last_saved_date_time = null, $classification_id = null, $classification_description = null, $tax_amount = null, $tax_id = null, $tax_rate = null, $cost = null, $currency_rate_used = null, $purchasing_classification_id = null, $purchasing_classification_description = null, $posted_to_wip = null, $job_charge = null, $use_serial_no = null, $fx_cost = null, $physical_item = null, $inventory_expected_liability_ledger_account_id = null, $inventory_expected_liability_ledger_account_no = null, $inventory_expected_liability_ledger_account_description = null, $inventory_expected_asset_ledger_account_id = null, $inventory_expected_asset_ledger_account_no = null, $inventory_expected_asset_ledger_account_description = null, $inventory_delivered_asset_ledger_account_id = null, $inventory_delivered_asset_ledger_account_no = null, $inventory_delivered_asset_ledger_account_description = null, $inventory_value_ledger_account_id = null, $inventory_value_ledger_account_no = null, $inventory_value_ledger_account_description = null, $inventory_delivered_liability_ledger_account_id = null, $inventory_delivered_liability_ledger_account_no = null, $inventory_delivered_liability_ledger_account_description = null, $inventory_wip_ledger_account_id = null, $inventory_wip_ledger_account_no = null, $inventory_wip_ledger_account_description = null, $po_line_last_saved_date_time = null, $order_units = null, $item_no = null, $in_creditor_rec_id = null, $in_supplier_warehouse_rec_id = null, $job_costing_stage_id = null, $job_costing_stage_no = null, $job_costing_stage_name = null, $job_costing_cost_centre_id = null, $job_costing_cost_centre_no = null, $job_costing_cost_centre_name = null, $job_costing_job_id = null, $job_costing_job_no = null, $unit_inc_tax = null, $line_total_inc_tax = null, $fx_line_total_ex_tax = null, $fx_decimal_places = null, $home_decimal_places = null, $use_expiry_date = null, $line_details = null, $custom_field_values = null, $body = null)\n {\n $returnType = '\\Jiwa\\Model\\GoodsReceivedNoteLine';\n $request = $this->goodsReceivedNoteLinePOSTRequestGRNIDLinesPostRequest($accept, $grnid, $jiwa_stateful, $quantity_ordered, $quantity_delivered, $order_id, $order_no, $order_line_id, $quantity, $inventory_id, $part_no, $aux2, $description, $supplier_part_no, $grn_line_type, $quantity_decimal_places, $last_saved_date_time, $classification_id, $classification_description, $tax_amount, $tax_id, $tax_rate, $cost, $currency_rate_used, $purchasing_classification_id, $purchasing_classification_description, $posted_to_wip, $job_charge, $use_serial_no, $fx_cost, $physical_item, $inventory_expected_liability_ledger_account_id, $inventory_expected_liability_ledger_account_no, $inventory_expected_liability_ledger_account_description, $inventory_expected_asset_ledger_account_id, $inventory_expected_asset_ledger_account_no, $inventory_expected_asset_ledger_account_description, $inventory_delivered_asset_ledger_account_id, $inventory_delivered_asset_ledger_account_no, $inventory_delivered_asset_ledger_account_description, $inventory_value_ledger_account_id, $inventory_value_ledger_account_no, $inventory_value_ledger_account_description, $inventory_delivered_liability_ledger_account_id, $inventory_delivered_liability_ledger_account_no, $inventory_delivered_liability_ledger_account_description, $inventory_wip_ledger_account_id, $inventory_wip_ledger_account_no, $inventory_wip_ledger_account_description, $po_line_last_saved_date_time, $order_units, $item_no, $in_creditor_rec_id, $in_supplier_warehouse_rec_id, $job_costing_stage_id, $job_costing_stage_no, $job_costing_stage_name, $job_costing_cost_centre_id, $job_costing_cost_centre_no, $job_costing_cost_centre_name, $job_costing_job_id, $job_costing_job_no, $unit_inc_tax, $line_total_inc_tax, $fx_line_total_ex_tax, $fx_decimal_places, $home_decimal_places, $use_expiry_date, $line_details, $custom_field_values, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function salesOrderLineDetailGETRequestInvoiceIDHistorysInvoiceHistoryIDLinesInvoiceLineIDLineDetailsDetailsLineIDGetRequest($accept, $invoice_id, $invoice_history_id, $invoice_line_id, $details_line_id, $jiwa_stateful = null)\n {\n // verify the required parameter 'accept' is set\n if ($accept === null || (is_array($accept) && count($accept) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accept when calling salesOrderLineDetailGETRequestInvoiceIDHistorysInvoiceHistoryIDLinesInvoiceLineIDLineDetailsDetailsLineIDGet'\n );\n }\n // verify the required parameter 'invoice_id' is set\n if ($invoice_id === null || (is_array($invoice_id) && count($invoice_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_id when calling salesOrderLineDetailGETRequestInvoiceIDHistorysInvoiceHistoryIDLinesInvoiceLineIDLineDetailsDetailsLineIDGet'\n );\n }\n // verify the required parameter 'invoice_history_id' is set\n if ($invoice_history_id === null || (is_array($invoice_history_id) && count($invoice_history_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_history_id when calling salesOrderLineDetailGETRequestInvoiceIDHistorysInvoiceHistoryIDLinesInvoiceLineIDLineDetailsDetailsLineIDGet'\n );\n }\n // verify the required parameter 'invoice_line_id' is set\n if ($invoice_line_id === null || (is_array($invoice_line_id) && count($invoice_line_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_line_id when calling salesOrderLineDetailGETRequestInvoiceIDHistorysInvoiceHistoryIDLinesInvoiceLineIDLineDetailsDetailsLineIDGet'\n );\n }\n // verify the required parameter 'details_line_id' is set\n if ($details_line_id === null || (is_array($details_line_id) && count($details_line_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $details_line_id when calling salesOrderLineDetailGETRequestInvoiceIDHistorysInvoiceHistoryIDLinesInvoiceLineIDLineDetailsDetailsLineIDGet'\n );\n }\n\n $resourcePath = '/SalesOrders/{InvoiceID}/Historys/{InvoiceHistoryID}/Lines/{InvoiceLineID}/LineDetails/{DetailsLineID}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($accept !== null) {\n $headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept);\n }\n // header params\n if ($jiwa_stateful !== null) {\n $headerParams['jiwa-stateful'] = ObjectSerializer::toHeaderValue($jiwa_stateful);\n }\n\n // path params\n if ($invoice_id !== null) {\n $resourcePath = str_replace(\n '{' . 'InvoiceID' . '}',\n ObjectSerializer::toPathValue($invoice_id),\n $resourcePath\n );\n }\n // path params\n if ($invoice_history_id !== null) {\n $resourcePath = str_replace(\n '{' . 'InvoiceHistoryID' . '}',\n ObjectSerializer::toPathValue($invoice_history_id),\n $resourcePath\n );\n }\n // path params\n if ($invoice_line_id !== null) {\n $resourcePath = str_replace(\n '{' . 'InvoiceLineID' . '}',\n ObjectSerializer::toPathValue($invoice_line_id),\n $resourcePath\n );\n }\n // path params\n if ($details_line_id !== null) {\n $resourcePath = str_replace(\n '{' . 'DetailsLineID' . '}',\n ObjectSerializer::toPathValue($details_line_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/x-www-form-urlencoded', 'application/json', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function purchaseOrderLinePATCHRequestPurchaseOrderIDLinesPurchaseOrderLineIDUpdateRequest($accept, $purchase_order_id, $purchase_order_line_id, $jiwa_stateful = null, $item_no = null, $inventory_id = null, $is_physical = null, $part_no = null, $description = null, $quantity_decimal_places = null, $make_supplier_the_new_default = null, $purchase_order_line_type = null, $quantity = null, $inc_price = null, $tax_amount = null, $line_total = null, $line_total_ex_tax = null, $fx_total = null, $currency_rate_used = null, $fx_decimal_places = null, $home_currency_decimal_places = null, $delivery_date = null, $delivered = null, $history_text_comment = null, $job_costing_stage_rec_id = null, $job_costing_stage_no = null, $job_costing_stage_name = null, $job_costing_stage_classification_rec_id = null, $job_costing_stage_classification_description = null, $job_costing_cost_centre_rec_id = null, $job_costing_cost_centre_no = null, $job_costing_cost_centre_name = null, $job_costing_job_rec_id = null, $job_costing_job_no = null, $job_costing_job_description = null, $in_on_back_order_orders_on_back_id = null, $in_on_back_order_quantity = null, $in_on_back_order_est_bo_value = null, $in_on_back_order_last_saved_date_time = null, $invoice_line_id = null, $user_defined_float1 = null, $user_defined_float2 = null, $user_defined_float3 = null, $user_defined_date1 = null, $user_defined_date2 = null, $user_defined_date3 = null, $user_defined_string1 = null, $user_defined_string2 = null, $user_defined_string3 = null, $purchasing_classification_rec_id = null, $purchasing_classification_description = null, $purchasing_classification_ledger_account_rec_id = null, $purchasing_classification_ledger_account_account_no = null, $purchasing_classification_ledger_account_description = null, $service_manager_task_rec_id = null, $service_manager_task_no = null, $service_manager_task_description = null, $service_manager_job_rec_id = null, $service_manager_job_no = null, $service_manager_job_description = null, $in_creditor_rec_id = null, $supplier_part_no = null, $in_supplier_warehouse_rec_id = null, $order_units = null, $delivery_days = null, $fx_cost = null, $cost = null, $cost_original = null, $units = null, $tax_rate_rec_id = null, $tax_rate_description = null, $tax_rate = null, $tax_rate_bas_code = null, $inventory_expected_liability_ledger_account_rec_id = null, $inventory_expected_liability_ledger_account_account_no = null, $inventory_expected_liability_ledger_account_description = null, $inventory_expected_asset_ledger_account_rec_id = null, $inventory_expected_asset_ledger_account_account_no = null, $inventory_expected_asset_ledger_account_description = null, $classification_id = null, $classification_description = null, $custom_field_values = null, $body = null)\n {\n // verify the required parameter 'accept' is set\n if ($accept === null || (is_array($accept) && count($accept) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accept when calling purchaseOrderLinePATCHRequestPurchaseOrderIDLinesPurchaseOrderLineIDUpdate'\n );\n }\n // verify the required parameter 'purchase_order_id' is set\n if ($purchase_order_id === null || (is_array($purchase_order_id) && count($purchase_order_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $purchase_order_id when calling purchaseOrderLinePATCHRequestPurchaseOrderIDLinesPurchaseOrderLineIDUpdate'\n );\n }\n // verify the required parameter 'purchase_order_line_id' is set\n if ($purchase_order_line_id === null || (is_array($purchase_order_line_id) && count($purchase_order_line_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $purchase_order_line_id when calling purchaseOrderLinePATCHRequestPurchaseOrderIDLinesPurchaseOrderLineIDUpdate'\n );\n }\n\n $resourcePath = '/PurchaseOrders/{PurchaseOrderID}/Lines/{PurchaseOrderLineID}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($item_no !== null) {\n $queryParams['ItemNo'] = ObjectSerializer::toQueryValue($item_no);\n }\n // query params\n if ($inventory_id !== null) {\n $queryParams['InventoryID'] = ObjectSerializer::toQueryValue($inventory_id);\n }\n // query params\n if ($is_physical !== null) {\n $queryParams['IsPhysical'] = ObjectSerializer::toQueryValue($is_physical);\n }\n // query params\n if ($part_no !== null) {\n $queryParams['PartNo'] = ObjectSerializer::toQueryValue($part_no);\n }\n // query params\n if ($description !== null) {\n $queryParams['Description'] = ObjectSerializer::toQueryValue($description);\n }\n // query params\n if ($quantity_decimal_places !== null) {\n $queryParams['QuantityDecimalPlaces'] = ObjectSerializer::toQueryValue($quantity_decimal_places);\n }\n // query params\n if ($make_supplier_the_new_default !== null) {\n $queryParams['MakeSupplierTheNewDefault'] = ObjectSerializer::toQueryValue($make_supplier_the_new_default);\n }\n // query params\n if ($purchase_order_line_type !== null) {\n $queryParams['PurchaseOrderLineType'] = ObjectSerializer::toQueryValue($purchase_order_line_type);\n }\n // query params\n if ($quantity !== null) {\n $queryParams['Quantity'] = ObjectSerializer::toQueryValue($quantity);\n }\n // query params\n if ($inc_price !== null) {\n $queryParams['IncPrice'] = ObjectSerializer::toQueryValue($inc_price);\n }\n // query params\n if ($tax_amount !== null) {\n $queryParams['TaxAmount'] = ObjectSerializer::toQueryValue($tax_amount);\n }\n // query params\n if ($line_total !== null) {\n $queryParams['LineTotal'] = ObjectSerializer::toQueryValue($line_total);\n }\n // query params\n if ($line_total_ex_tax !== null) {\n $queryParams['LineTotalExTax'] = ObjectSerializer::toQueryValue($line_total_ex_tax);\n }\n // query params\n if ($fx_total !== null) {\n $queryParams['FxTotal'] = ObjectSerializer::toQueryValue($fx_total);\n }\n // query params\n if ($currency_rate_used !== null) {\n $queryParams['CurrencyRateUsed'] = ObjectSerializer::toQueryValue($currency_rate_used);\n }\n // query params\n if ($fx_decimal_places !== null) {\n $queryParams['FXDecimalPlaces'] = ObjectSerializer::toQueryValue($fx_decimal_places);\n }\n // query params\n if ($home_currency_decimal_places !== null) {\n $queryParams['HomeCurrencyDecimalPlaces'] = ObjectSerializer::toQueryValue($home_currency_decimal_places);\n }\n // query params\n if ($delivery_date !== null) {\n $queryParams['DeliveryDate'] = ObjectSerializer::toQueryValue($delivery_date);\n }\n // query params\n if ($delivered !== null) {\n $queryParams['Delivered'] = ObjectSerializer::toQueryValue($delivered);\n }\n // query params\n if ($history_text_comment !== null) {\n $queryParams['HistoryText_Comment'] = ObjectSerializer::toQueryValue($history_text_comment);\n }\n // query params\n if ($job_costing_stage_rec_id !== null) {\n $queryParams['JobCostingStageRecID'] = ObjectSerializer::toQueryValue($job_costing_stage_rec_id);\n }\n // query params\n if ($job_costing_stage_no !== null) {\n $queryParams['JobCostingStageNo'] = ObjectSerializer::toQueryValue($job_costing_stage_no);\n }\n // query params\n if ($job_costing_stage_name !== null) {\n $queryParams['JobCostingStageName'] = ObjectSerializer::toQueryValue($job_costing_stage_name);\n }\n // query params\n if ($job_costing_stage_classification_rec_id !== null) {\n $queryParams['JobCostingStageClassificationRecID'] = ObjectSerializer::toQueryValue($job_costing_stage_classification_rec_id);\n }\n // query params\n if ($job_costing_stage_classification_description !== null) {\n $queryParams['JobCostingStageClassificationDescription'] = ObjectSerializer::toQueryValue($job_costing_stage_classification_description);\n }\n // query params\n if ($job_costing_cost_centre_rec_id !== null) {\n $queryParams['JobCostingCostCentreRecID'] = ObjectSerializer::toQueryValue($job_costing_cost_centre_rec_id);\n }\n // query params\n if ($job_costing_cost_centre_no !== null) {\n $queryParams['JobCostingCostCentreNo'] = ObjectSerializer::toQueryValue($job_costing_cost_centre_no);\n }\n // query params\n if ($job_costing_cost_centre_name !== null) {\n $queryParams['JobCostingCostCentreName'] = ObjectSerializer::toQueryValue($job_costing_cost_centre_name);\n }\n // query params\n if ($job_costing_job_rec_id !== null) {\n $queryParams['JobCostingJobRecID'] = ObjectSerializer::toQueryValue($job_costing_job_rec_id);\n }\n // query params\n if ($job_costing_job_no !== null) {\n $queryParams['JobCostingJobNo'] = ObjectSerializer::toQueryValue($job_costing_job_no);\n }\n // query params\n if ($job_costing_job_description !== null) {\n $queryParams['JobCostingJobDescription'] = ObjectSerializer::toQueryValue($job_costing_job_description);\n }\n // query params\n if ($in_on_back_order_orders_on_back_id !== null) {\n $queryParams['IN_OnBackOrder_OrdersOnBackID'] = ObjectSerializer::toQueryValue($in_on_back_order_orders_on_back_id);\n }\n // query params\n if ($in_on_back_order_quantity !== null) {\n $queryParams['IN_OnBackOrder_Quantity'] = ObjectSerializer::toQueryValue($in_on_back_order_quantity);\n }\n // query params\n if ($in_on_back_order_est_bo_value !== null) {\n $queryParams['IN_OnBackOrder_EstBOValue'] = ObjectSerializer::toQueryValue($in_on_back_order_est_bo_value);\n }\n // query params\n if ($in_on_back_order_last_saved_date_time !== null) {\n $queryParams['IN_OnBackOrder_LastSavedDateTime'] = ObjectSerializer::toQueryValue($in_on_back_order_last_saved_date_time);\n }\n // query params\n if ($invoice_line_id !== null) {\n $queryParams['InvoiceLineID'] = ObjectSerializer::toQueryValue($invoice_line_id);\n }\n // query params\n if ($user_defined_float1 !== null) {\n $queryParams['UserDefinedFloat1'] = ObjectSerializer::toQueryValue($user_defined_float1);\n }\n // query params\n if ($user_defined_float2 !== null) {\n $queryParams['UserDefinedFloat2'] = ObjectSerializer::toQueryValue($user_defined_float2);\n }\n // query params\n if ($user_defined_float3 !== null) {\n $queryParams['UserDefinedFloat3'] = ObjectSerializer::toQueryValue($user_defined_float3);\n }\n // query params\n if ($user_defined_date1 !== null) {\n $queryParams['UserDefinedDate1'] = ObjectSerializer::toQueryValue($user_defined_date1);\n }\n // query params\n if ($user_defined_date2 !== null) {\n $queryParams['UserDefinedDate2'] = ObjectSerializer::toQueryValue($user_defined_date2);\n }\n // query params\n if ($user_defined_date3 !== null) {\n $queryParams['UserDefinedDate3'] = ObjectSerializer::toQueryValue($user_defined_date3);\n }\n // query params\n if ($user_defined_string1 !== null) {\n $queryParams['UserDefinedString1'] = ObjectSerializer::toQueryValue($user_defined_string1);\n }\n // query params\n if ($user_defined_string2 !== null) {\n $queryParams['UserDefinedString2'] = ObjectSerializer::toQueryValue($user_defined_string2);\n }\n // query params\n if ($user_defined_string3 !== null) {\n $queryParams['UserDefinedString3'] = ObjectSerializer::toQueryValue($user_defined_string3);\n }\n // query params\n if ($purchasing_classification_rec_id !== null) {\n $queryParams['PurchasingClassificationRecID'] = ObjectSerializer::toQueryValue($purchasing_classification_rec_id);\n }\n // query params\n if ($purchasing_classification_description !== null) {\n $queryParams['PurchasingClassificationDescription'] = ObjectSerializer::toQueryValue($purchasing_classification_description);\n }\n // query params\n if ($purchasing_classification_ledger_account_rec_id !== null) {\n $queryParams['PurchasingClassificationLedgerAccountRecID'] = ObjectSerializer::toQueryValue($purchasing_classification_ledger_account_rec_id);\n }\n // query params\n if ($purchasing_classification_ledger_account_account_no !== null) {\n $queryParams['PurchasingClassificationLedgerAccountAccountNo'] = ObjectSerializer::toQueryValue($purchasing_classification_ledger_account_account_no);\n }\n // query params\n if ($purchasing_classification_ledger_account_description !== null) {\n $queryParams['PurchasingClassificationLedgerAccountDescription'] = ObjectSerializer::toQueryValue($purchasing_classification_ledger_account_description);\n }\n // query params\n if ($service_manager_task_rec_id !== null) {\n $queryParams['ServiceManagerTaskRecID'] = ObjectSerializer::toQueryValue($service_manager_task_rec_id);\n }\n // query params\n if ($service_manager_task_no !== null) {\n $queryParams['ServiceManagerTaskNo'] = ObjectSerializer::toQueryValue($service_manager_task_no);\n }\n // query params\n if ($service_manager_task_description !== null) {\n $queryParams['ServiceManagerTaskDescription'] = ObjectSerializer::toQueryValue($service_manager_task_description);\n }\n // query params\n if ($service_manager_job_rec_id !== null) {\n $queryParams['ServiceManagerJobRecID'] = ObjectSerializer::toQueryValue($service_manager_job_rec_id);\n }\n // query params\n if ($service_manager_job_no !== null) {\n $queryParams['ServiceManagerJobNo'] = ObjectSerializer::toQueryValue($service_manager_job_no);\n }\n // query params\n if ($service_manager_job_description !== null) {\n $queryParams['ServiceManagerJobDescription'] = ObjectSerializer::toQueryValue($service_manager_job_description);\n }\n // query params\n if ($in_creditor_rec_id !== null) {\n $queryParams['IN_Creditor_RecID'] = ObjectSerializer::toQueryValue($in_creditor_rec_id);\n }\n // query params\n if ($supplier_part_no !== null) {\n $queryParams['SupplierPartNo'] = ObjectSerializer::toQueryValue($supplier_part_no);\n }\n // query params\n if ($in_supplier_warehouse_rec_id !== null) {\n $queryParams['IN_SupplierWarehouse_RecID'] = ObjectSerializer::toQueryValue($in_supplier_warehouse_rec_id);\n }\n // query params\n if ($order_units !== null) {\n $queryParams['OrderUnits'] = ObjectSerializer::toQueryValue($order_units);\n }\n // query params\n if ($delivery_days !== null) {\n $queryParams['DeliveryDays'] = ObjectSerializer::toQueryValue($delivery_days);\n }\n // query params\n if ($fx_cost !== null) {\n $queryParams['FXCost'] = ObjectSerializer::toQueryValue($fx_cost);\n }\n // query params\n if ($cost !== null) {\n $queryParams['Cost'] = ObjectSerializer::toQueryValue($cost);\n }\n // query params\n if ($cost_original !== null) {\n $queryParams['CostOriginal'] = ObjectSerializer::toQueryValue($cost_original);\n }\n // query params\n if ($units !== null) {\n $queryParams['Units'] = ObjectSerializer::toQueryValue($units);\n }\n // query params\n if ($tax_rate_rec_id !== null) {\n $queryParams['TaxRateRecID'] = ObjectSerializer::toQueryValue($tax_rate_rec_id);\n }\n // query params\n if ($tax_rate_description !== null) {\n $queryParams['TaxRateDescription'] = ObjectSerializer::toQueryValue($tax_rate_description);\n }\n // query params\n if ($tax_rate !== null) {\n $queryParams['TaxRate'] = ObjectSerializer::toQueryValue($tax_rate);\n }\n // query params\n if ($tax_rate_bas_code !== null) {\n $queryParams['TaxRateBASCode'] = ObjectSerializer::toQueryValue($tax_rate_bas_code);\n }\n // query params\n if ($inventory_expected_liability_ledger_account_rec_id !== null) {\n $queryParams['InventoryExpectedLiabilityLedgerAccountRecID'] = ObjectSerializer::toQueryValue($inventory_expected_liability_ledger_account_rec_id);\n }\n // query params\n if ($inventory_expected_liability_ledger_account_account_no !== null) {\n $queryParams['InventoryExpectedLiabilityLedgerAccountAccountNo'] = ObjectSerializer::toQueryValue($inventory_expected_liability_ledger_account_account_no);\n }\n // query params\n if ($inventory_expected_liability_ledger_account_description !== null) {\n $queryParams['InventoryExpectedLiabilityLedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_expected_liability_ledger_account_description);\n }\n // query params\n if ($inventory_expected_asset_ledger_account_rec_id !== null) {\n $queryParams['InventoryExpectedAssetLedgerAccountRecID'] = ObjectSerializer::toQueryValue($inventory_expected_asset_ledger_account_rec_id);\n }\n // query params\n if ($inventory_expected_asset_ledger_account_account_no !== null) {\n $queryParams['InventoryExpectedAssetLedgerAccountAccountNo'] = ObjectSerializer::toQueryValue($inventory_expected_asset_ledger_account_account_no);\n }\n // query params\n if ($inventory_expected_asset_ledger_account_description !== null) {\n $queryParams['InventoryExpectedAssetLedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_expected_asset_ledger_account_description);\n }\n // query params\n if ($classification_id !== null) {\n $queryParams['ClassificationID'] = ObjectSerializer::toQueryValue($classification_id);\n }\n // query params\n if ($classification_description !== null) {\n $queryParams['ClassificationDescription'] = ObjectSerializer::toQueryValue($classification_description);\n }\n // query params\n if ($custom_field_values !== null) {\n $queryParams['CustomFieldValues'] = ObjectSerializer::toQueryValue($custom_field_values);\n }\n // header params\n if ($accept !== null) {\n $headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept);\n }\n // header params\n if ($jiwa_stateful !== null) {\n $headerParams['jiwa-stateful'] = ObjectSerializer::toHeaderValue($jiwa_stateful);\n }\n\n // path params\n if ($purchase_order_id !== null) {\n $resourcePath = str_replace(\n '{' . 'PurchaseOrderID' . '}',\n ObjectSerializer::toPathValue($purchase_order_id),\n $resourcePath\n );\n }\n // path params\n if ($purchase_order_line_id !== null) {\n $resourcePath = str_replace(\n '{' . 'PurchaseOrderLineID' . '}',\n ObjectSerializer::toPathValue($purchase_order_line_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/x-www-form-urlencoded', 'application/json', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function purchaseOrderLinePOSTRequestPurchaseOrderIDLinesPostRequest($accept, $purchase_order_id, $jiwa_stateful = null, $item_no = null, $inventory_id = null, $is_physical = null, $part_no = null, $description = null, $quantity_decimal_places = null, $make_supplier_the_new_default = null, $purchase_order_line_type = null, $quantity = null, $inc_price = null, $tax_amount = null, $line_total = null, $line_total_ex_tax = null, $fx_total = null, $currency_rate_used = null, $fx_decimal_places = null, $home_currency_decimal_places = null, $delivery_date = null, $delivered = null, $history_text_comment = null, $job_costing_stage_rec_id = null, $job_costing_stage_no = null, $job_costing_stage_name = null, $job_costing_stage_classification_rec_id = null, $job_costing_stage_classification_description = null, $job_costing_cost_centre_rec_id = null, $job_costing_cost_centre_no = null, $job_costing_cost_centre_name = null, $job_costing_job_rec_id = null, $job_costing_job_no = null, $job_costing_job_description = null, $in_on_back_order_orders_on_back_id = null, $in_on_back_order_quantity = null, $in_on_back_order_est_bo_value = null, $in_on_back_order_last_saved_date_time = null, $invoice_line_id = null, $user_defined_float1 = null, $user_defined_float2 = null, $user_defined_float3 = null, $user_defined_date1 = null, $user_defined_date2 = null, $user_defined_date3 = null, $user_defined_string1 = null, $user_defined_string2 = null, $user_defined_string3 = null, $purchasing_classification_rec_id = null, $purchasing_classification_description = null, $purchasing_classification_ledger_account_rec_id = null, $purchasing_classification_ledger_account_account_no = null, $purchasing_classification_ledger_account_description = null, $service_manager_task_rec_id = null, $service_manager_task_no = null, $service_manager_task_description = null, $service_manager_job_rec_id = null, $service_manager_job_no = null, $service_manager_job_description = null, $in_creditor_rec_id = null, $supplier_part_no = null, $in_supplier_warehouse_rec_id = null, $order_units = null, $delivery_days = null, $fx_cost = null, $cost = null, $cost_original = null, $units = null, $tax_rate_rec_id = null, $tax_rate_description = null, $tax_rate = null, $tax_rate_bas_code = null, $inventory_expected_liability_ledger_account_rec_id = null, $inventory_expected_liability_ledger_account_account_no = null, $inventory_expected_liability_ledger_account_description = null, $inventory_expected_asset_ledger_account_rec_id = null, $inventory_expected_asset_ledger_account_account_no = null, $inventory_expected_asset_ledger_account_description = null, $classification_id = null, $classification_description = null, $custom_field_values = null, $body = null)\n {\n // verify the required parameter 'accept' is set\n if ($accept === null || (is_array($accept) && count($accept) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accept when calling purchaseOrderLinePOSTRequestPurchaseOrderIDLinesPost'\n );\n }\n // verify the required parameter 'purchase_order_id' is set\n if ($purchase_order_id === null || (is_array($purchase_order_id) && count($purchase_order_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $purchase_order_id when calling purchaseOrderLinePOSTRequestPurchaseOrderIDLinesPost'\n );\n }\n\n $resourcePath = '/PurchaseOrders/{PurchaseOrderID}/Lines';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($item_no !== null) {\n $queryParams['ItemNo'] = ObjectSerializer::toQueryValue($item_no);\n }\n // query params\n if ($inventory_id !== null) {\n $queryParams['InventoryID'] = ObjectSerializer::toQueryValue($inventory_id);\n }\n // query params\n if ($is_physical !== null) {\n $queryParams['IsPhysical'] = ObjectSerializer::toQueryValue($is_physical);\n }\n // query params\n if ($part_no !== null) {\n $queryParams['PartNo'] = ObjectSerializer::toQueryValue($part_no);\n }\n // query params\n if ($description !== null) {\n $queryParams['Description'] = ObjectSerializer::toQueryValue($description);\n }\n // query params\n if ($quantity_decimal_places !== null) {\n $queryParams['QuantityDecimalPlaces'] = ObjectSerializer::toQueryValue($quantity_decimal_places);\n }\n // query params\n if ($make_supplier_the_new_default !== null) {\n $queryParams['MakeSupplierTheNewDefault'] = ObjectSerializer::toQueryValue($make_supplier_the_new_default);\n }\n // query params\n if ($purchase_order_line_type !== null) {\n $queryParams['PurchaseOrderLineType'] = ObjectSerializer::toQueryValue($purchase_order_line_type);\n }\n // query params\n if ($quantity !== null) {\n $queryParams['Quantity'] = ObjectSerializer::toQueryValue($quantity);\n }\n // query params\n if ($inc_price !== null) {\n $queryParams['IncPrice'] = ObjectSerializer::toQueryValue($inc_price);\n }\n // query params\n if ($tax_amount !== null) {\n $queryParams['TaxAmount'] = ObjectSerializer::toQueryValue($tax_amount);\n }\n // query params\n if ($line_total !== null) {\n $queryParams['LineTotal'] = ObjectSerializer::toQueryValue($line_total);\n }\n // query params\n if ($line_total_ex_tax !== null) {\n $queryParams['LineTotalExTax'] = ObjectSerializer::toQueryValue($line_total_ex_tax);\n }\n // query params\n if ($fx_total !== null) {\n $queryParams['FxTotal'] = ObjectSerializer::toQueryValue($fx_total);\n }\n // query params\n if ($currency_rate_used !== null) {\n $queryParams['CurrencyRateUsed'] = ObjectSerializer::toQueryValue($currency_rate_used);\n }\n // query params\n if ($fx_decimal_places !== null) {\n $queryParams['FXDecimalPlaces'] = ObjectSerializer::toQueryValue($fx_decimal_places);\n }\n // query params\n if ($home_currency_decimal_places !== null) {\n $queryParams['HomeCurrencyDecimalPlaces'] = ObjectSerializer::toQueryValue($home_currency_decimal_places);\n }\n // query params\n if ($delivery_date !== null) {\n $queryParams['DeliveryDate'] = ObjectSerializer::toQueryValue($delivery_date);\n }\n // query params\n if ($delivered !== null) {\n $queryParams['Delivered'] = ObjectSerializer::toQueryValue($delivered);\n }\n // query params\n if ($history_text_comment !== null) {\n $queryParams['HistoryText_Comment'] = ObjectSerializer::toQueryValue($history_text_comment);\n }\n // query params\n if ($job_costing_stage_rec_id !== null) {\n $queryParams['JobCostingStageRecID'] = ObjectSerializer::toQueryValue($job_costing_stage_rec_id);\n }\n // query params\n if ($job_costing_stage_no !== null) {\n $queryParams['JobCostingStageNo'] = ObjectSerializer::toQueryValue($job_costing_stage_no);\n }\n // query params\n if ($job_costing_stage_name !== null) {\n $queryParams['JobCostingStageName'] = ObjectSerializer::toQueryValue($job_costing_stage_name);\n }\n // query params\n if ($job_costing_stage_classification_rec_id !== null) {\n $queryParams['JobCostingStageClassificationRecID'] = ObjectSerializer::toQueryValue($job_costing_stage_classification_rec_id);\n }\n // query params\n if ($job_costing_stage_classification_description !== null) {\n $queryParams['JobCostingStageClassificationDescription'] = ObjectSerializer::toQueryValue($job_costing_stage_classification_description);\n }\n // query params\n if ($job_costing_cost_centre_rec_id !== null) {\n $queryParams['JobCostingCostCentreRecID'] = ObjectSerializer::toQueryValue($job_costing_cost_centre_rec_id);\n }\n // query params\n if ($job_costing_cost_centre_no !== null) {\n $queryParams['JobCostingCostCentreNo'] = ObjectSerializer::toQueryValue($job_costing_cost_centre_no);\n }\n // query params\n if ($job_costing_cost_centre_name !== null) {\n $queryParams['JobCostingCostCentreName'] = ObjectSerializer::toQueryValue($job_costing_cost_centre_name);\n }\n // query params\n if ($job_costing_job_rec_id !== null) {\n $queryParams['JobCostingJobRecID'] = ObjectSerializer::toQueryValue($job_costing_job_rec_id);\n }\n // query params\n if ($job_costing_job_no !== null) {\n $queryParams['JobCostingJobNo'] = ObjectSerializer::toQueryValue($job_costing_job_no);\n }\n // query params\n if ($job_costing_job_description !== null) {\n $queryParams['JobCostingJobDescription'] = ObjectSerializer::toQueryValue($job_costing_job_description);\n }\n // query params\n if ($in_on_back_order_orders_on_back_id !== null) {\n $queryParams['IN_OnBackOrder_OrdersOnBackID'] = ObjectSerializer::toQueryValue($in_on_back_order_orders_on_back_id);\n }\n // query params\n if ($in_on_back_order_quantity !== null) {\n $queryParams['IN_OnBackOrder_Quantity'] = ObjectSerializer::toQueryValue($in_on_back_order_quantity);\n }\n // query params\n if ($in_on_back_order_est_bo_value !== null) {\n $queryParams['IN_OnBackOrder_EstBOValue'] = ObjectSerializer::toQueryValue($in_on_back_order_est_bo_value);\n }\n // query params\n if ($in_on_back_order_last_saved_date_time !== null) {\n $queryParams['IN_OnBackOrder_LastSavedDateTime'] = ObjectSerializer::toQueryValue($in_on_back_order_last_saved_date_time);\n }\n // query params\n if ($invoice_line_id !== null) {\n $queryParams['InvoiceLineID'] = ObjectSerializer::toQueryValue($invoice_line_id);\n }\n // query params\n if ($user_defined_float1 !== null) {\n $queryParams['UserDefinedFloat1'] = ObjectSerializer::toQueryValue($user_defined_float1);\n }\n // query params\n if ($user_defined_float2 !== null) {\n $queryParams['UserDefinedFloat2'] = ObjectSerializer::toQueryValue($user_defined_float2);\n }\n // query params\n if ($user_defined_float3 !== null) {\n $queryParams['UserDefinedFloat3'] = ObjectSerializer::toQueryValue($user_defined_float3);\n }\n // query params\n if ($user_defined_date1 !== null) {\n $queryParams['UserDefinedDate1'] = ObjectSerializer::toQueryValue($user_defined_date1);\n }\n // query params\n if ($user_defined_date2 !== null) {\n $queryParams['UserDefinedDate2'] = ObjectSerializer::toQueryValue($user_defined_date2);\n }\n // query params\n if ($user_defined_date3 !== null) {\n $queryParams['UserDefinedDate3'] = ObjectSerializer::toQueryValue($user_defined_date3);\n }\n // query params\n if ($user_defined_string1 !== null) {\n $queryParams['UserDefinedString1'] = ObjectSerializer::toQueryValue($user_defined_string1);\n }\n // query params\n if ($user_defined_string2 !== null) {\n $queryParams['UserDefinedString2'] = ObjectSerializer::toQueryValue($user_defined_string2);\n }\n // query params\n if ($user_defined_string3 !== null) {\n $queryParams['UserDefinedString3'] = ObjectSerializer::toQueryValue($user_defined_string3);\n }\n // query params\n if ($purchasing_classification_rec_id !== null) {\n $queryParams['PurchasingClassificationRecID'] = ObjectSerializer::toQueryValue($purchasing_classification_rec_id);\n }\n // query params\n if ($purchasing_classification_description !== null) {\n $queryParams['PurchasingClassificationDescription'] = ObjectSerializer::toQueryValue($purchasing_classification_description);\n }\n // query params\n if ($purchasing_classification_ledger_account_rec_id !== null) {\n $queryParams['PurchasingClassificationLedgerAccountRecID'] = ObjectSerializer::toQueryValue($purchasing_classification_ledger_account_rec_id);\n }\n // query params\n if ($purchasing_classification_ledger_account_account_no !== null) {\n $queryParams['PurchasingClassificationLedgerAccountAccountNo'] = ObjectSerializer::toQueryValue($purchasing_classification_ledger_account_account_no);\n }\n // query params\n if ($purchasing_classification_ledger_account_description !== null) {\n $queryParams['PurchasingClassificationLedgerAccountDescription'] = ObjectSerializer::toQueryValue($purchasing_classification_ledger_account_description);\n }\n // query params\n if ($service_manager_task_rec_id !== null) {\n $queryParams['ServiceManagerTaskRecID'] = ObjectSerializer::toQueryValue($service_manager_task_rec_id);\n }\n // query params\n if ($service_manager_task_no !== null) {\n $queryParams['ServiceManagerTaskNo'] = ObjectSerializer::toQueryValue($service_manager_task_no);\n }\n // query params\n if ($service_manager_task_description !== null) {\n $queryParams['ServiceManagerTaskDescription'] = ObjectSerializer::toQueryValue($service_manager_task_description);\n }\n // query params\n if ($service_manager_job_rec_id !== null) {\n $queryParams['ServiceManagerJobRecID'] = ObjectSerializer::toQueryValue($service_manager_job_rec_id);\n }\n // query params\n if ($service_manager_job_no !== null) {\n $queryParams['ServiceManagerJobNo'] = ObjectSerializer::toQueryValue($service_manager_job_no);\n }\n // query params\n if ($service_manager_job_description !== null) {\n $queryParams['ServiceManagerJobDescription'] = ObjectSerializer::toQueryValue($service_manager_job_description);\n }\n // query params\n if ($in_creditor_rec_id !== null) {\n $queryParams['IN_Creditor_RecID'] = ObjectSerializer::toQueryValue($in_creditor_rec_id);\n }\n // query params\n if ($supplier_part_no !== null) {\n $queryParams['SupplierPartNo'] = ObjectSerializer::toQueryValue($supplier_part_no);\n }\n // query params\n if ($in_supplier_warehouse_rec_id !== null) {\n $queryParams['IN_SupplierWarehouse_RecID'] = ObjectSerializer::toQueryValue($in_supplier_warehouse_rec_id);\n }\n // query params\n if ($order_units !== null) {\n $queryParams['OrderUnits'] = ObjectSerializer::toQueryValue($order_units);\n }\n // query params\n if ($delivery_days !== null) {\n $queryParams['DeliveryDays'] = ObjectSerializer::toQueryValue($delivery_days);\n }\n // query params\n if ($fx_cost !== null) {\n $queryParams['FXCost'] = ObjectSerializer::toQueryValue($fx_cost);\n }\n // query params\n if ($cost !== null) {\n $queryParams['Cost'] = ObjectSerializer::toQueryValue($cost);\n }\n // query params\n if ($cost_original !== null) {\n $queryParams['CostOriginal'] = ObjectSerializer::toQueryValue($cost_original);\n }\n // query params\n if ($units !== null) {\n $queryParams['Units'] = ObjectSerializer::toQueryValue($units);\n }\n // query params\n if ($tax_rate_rec_id !== null) {\n $queryParams['TaxRateRecID'] = ObjectSerializer::toQueryValue($tax_rate_rec_id);\n }\n // query params\n if ($tax_rate_description !== null) {\n $queryParams['TaxRateDescription'] = ObjectSerializer::toQueryValue($tax_rate_description);\n }\n // query params\n if ($tax_rate !== null) {\n $queryParams['TaxRate'] = ObjectSerializer::toQueryValue($tax_rate);\n }\n // query params\n if ($tax_rate_bas_code !== null) {\n $queryParams['TaxRateBASCode'] = ObjectSerializer::toQueryValue($tax_rate_bas_code);\n }\n // query params\n if ($inventory_expected_liability_ledger_account_rec_id !== null) {\n $queryParams['InventoryExpectedLiabilityLedgerAccountRecID'] = ObjectSerializer::toQueryValue($inventory_expected_liability_ledger_account_rec_id);\n }\n // query params\n if ($inventory_expected_liability_ledger_account_account_no !== null) {\n $queryParams['InventoryExpectedLiabilityLedgerAccountAccountNo'] = ObjectSerializer::toQueryValue($inventory_expected_liability_ledger_account_account_no);\n }\n // query params\n if ($inventory_expected_liability_ledger_account_description !== null) {\n $queryParams['InventoryExpectedLiabilityLedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_expected_liability_ledger_account_description);\n }\n // query params\n if ($inventory_expected_asset_ledger_account_rec_id !== null) {\n $queryParams['InventoryExpectedAssetLedgerAccountRecID'] = ObjectSerializer::toQueryValue($inventory_expected_asset_ledger_account_rec_id);\n }\n // query params\n if ($inventory_expected_asset_ledger_account_account_no !== null) {\n $queryParams['InventoryExpectedAssetLedgerAccountAccountNo'] = ObjectSerializer::toQueryValue($inventory_expected_asset_ledger_account_account_no);\n }\n // query params\n if ($inventory_expected_asset_ledger_account_description !== null) {\n $queryParams['InventoryExpectedAssetLedgerAccountDescription'] = ObjectSerializer::toQueryValue($inventory_expected_asset_ledger_account_description);\n }\n // query params\n if ($classification_id !== null) {\n $queryParams['ClassificationID'] = ObjectSerializer::toQueryValue($classification_id);\n }\n // query params\n if ($classification_description !== null) {\n $queryParams['ClassificationDescription'] = ObjectSerializer::toQueryValue($classification_description);\n }\n // query params\n if ($custom_field_values !== null) {\n $queryParams['CustomFieldValues'] = ObjectSerializer::toQueryValue($custom_field_values);\n }\n // header params\n if ($accept !== null) {\n $headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept);\n }\n // header params\n if ($jiwa_stateful !== null) {\n $headerParams['jiwa-stateful'] = ObjectSerializer::toHeaderValue($jiwa_stateful);\n }\n\n // path params\n if ($purchase_order_id !== null) {\n $resourcePath = str_replace(\n '{' . 'PurchaseOrderID' . '}',\n ObjectSerializer::toPathValue($purchase_order_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/x-www-form-urlencoded', 'application/json', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function goodsReceivedNoteLinesGETManyRequestGRNIDLinesGet($accept, $grnid, $jiwa_stateful = null)\n {\n list($response) = $this->goodsReceivedNoteLinesGETManyRequestGRNIDLinesGetWithHttpInfo($accept, $grnid, $jiwa_stateful);\n return $response;\n }",
"protected function purchaseOrderLineGETRequestPurchaseOrderIDLinesPurchaseOrderLineIDGetRequest($accept, $purchase_order_id, $purchase_order_line_id, $jiwa_stateful = null)\n {\n // verify the required parameter 'accept' is set\n if ($accept === null || (is_array($accept) && count($accept) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accept when calling purchaseOrderLineGETRequestPurchaseOrderIDLinesPurchaseOrderLineIDGet'\n );\n }\n // verify the required parameter 'purchase_order_id' is set\n if ($purchase_order_id === null || (is_array($purchase_order_id) && count($purchase_order_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $purchase_order_id when calling purchaseOrderLineGETRequestPurchaseOrderIDLinesPurchaseOrderLineIDGet'\n );\n }\n // verify the required parameter 'purchase_order_line_id' is set\n if ($purchase_order_line_id === null || (is_array($purchase_order_line_id) && count($purchase_order_line_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $purchase_order_line_id when calling purchaseOrderLineGETRequestPurchaseOrderIDLinesPurchaseOrderLineIDGet'\n );\n }\n\n $resourcePath = '/PurchaseOrders/{PurchaseOrderID}/Lines/{PurchaseOrderLineID}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($accept !== null) {\n $headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept);\n }\n // header params\n if ($jiwa_stateful !== null) {\n $headerParams['jiwa-stateful'] = ObjectSerializer::toHeaderValue($jiwa_stateful);\n }\n\n // path params\n if ($purchase_order_id !== null) {\n $resourcePath = str_replace(\n '{' . 'PurchaseOrderID' . '}',\n ObjectSerializer::toPathValue($purchase_order_id),\n $resourcePath\n );\n }\n // path params\n if ($purchase_order_line_id !== null) {\n $resourcePath = str_replace(\n '{' . 'PurchaseOrderLineID' . '}',\n ObjectSerializer::toPathValue($purchase_order_line_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/x-www-form-urlencoded', 'application/json', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function gETStockLineItemIdLineItemRequest($stock_line_item_id)\n {\n // verify the required parameter 'stock_line_item_id' is set\n if ($stock_line_item_id === null || (is_array($stock_line_item_id) && count($stock_line_item_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $stock_line_item_id when calling gETStockLineItemIdLineItem'\n );\n }\n\n $resourcePath = '/stock_line_items/{stockLineItemId}/line_item';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($stock_line_item_id !== null) {\n $resourcePath = str_replace(\n '{' . 'stockLineItemId' . '}',\n ObjectSerializer::toPathValue($stock_line_item_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getTelephonyProvidersEdgesLineRequest($lineId)\n {\n // verify the required parameter 'lineId' is set\n if ($lineId === null || (is_array($lineId) && count($lineId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $lineId when calling getTelephonyProvidersEdgesLine'\n );\n }\n\n $resourcePath = '/api/v2/telephony/providers/edges/lines/{lineId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($lineId !== null) {\n $resourcePath = str_replace(\n '{' . 'lineId' . '}',\n ObjectSerializer::toPathValue($lineId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getInvoiceWorksheetLineDetailByIdRequest($invoice_worksheet_line_detail_id)\n {\n // verify the required parameter 'invoice_worksheet_line_detail_id' is set\n if ($invoice_worksheet_line_detail_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_worksheet_line_detail_id when calling getInvoiceWorksheetLineDetailById'\n );\n }\n\n $resourcePath = '/beta/invoiceWorksheetLineDetail/{invoiceWorksheetLineDetailId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($invoice_worksheet_line_detail_id !== null) {\n $resourcePath = str_replace(\n '{' . 'invoiceWorksheetLineDetailId' . '}',\n ObjectSerializer::toPathValue($invoice_worksheet_line_detail_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function customerDebitNoteCreateLineAttachmentBydebitNoteNumberlineNumberRequest($debit_note_number, $line_number)\n {\n // verify the required parameter 'debit_note_number' is set\n if ($debit_note_number === null || (is_array($debit_note_number) && count($debit_note_number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $debit_note_number when calling customerDebitNoteCreateLineAttachmentBydebitNoteNumberlineNumber'\n );\n }\n // verify the required parameter 'line_number' is set\n if ($line_number === null || (is_array($line_number) && count($line_number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $line_number when calling customerDebitNoteCreateLineAttachmentBydebitNoteNumberlineNumber'\n );\n }\n\n $resourcePath = '/controller/api/v1/customerDebitNote/{debitNoteNumber}/{lineNumber}/attachment';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($debit_note_number !== null) {\n $resourcePath = str_replace(\n '{' . 'debitNoteNumber' . '}',\n ObjectSerializer::toPathValue($debit_note_number),\n $resourcePath\n );\n }\n // path params\n if ($line_number !== null) {\n $resourcePath = str_replace(\n '{' . 'lineNumber' . '}',\n ObjectSerializer::toPathValue($line_number),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('ipp-application-type');\n if ($apiKey !== null) {\n $headers['ipp-application-type'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('ipp-company-id');\n if ($apiKey !== null) {\n $headers['ipp-company-id'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set TicketingSegments value This property is removable from request (nillable=true+minOccurs=0), therefore if the value assigned to this property is null, it is removed from this object | public function setTicketingSegments(\Fincallorca\HitchHikerApi\Wsdl\v3_1_388_1\ArrayType\ArrayOfPNRResponseStoredFareTKTSement $ticketingSegments = null)
{
if (is_null($ticketingSegments) || (is_array($ticketingSegments) && empty($ticketingSegments))) {
unset($this->TicketingSegments);
} else {
$this->TicketingSegments = $ticketingSegments;
}
return $this;
} | [
"public function setSegments($segments) {\n\n\t\t$this->segments = $segments;\n\n\t}",
"public function setSegments($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Proto\\SegmentEntity::class);\n $this->segments = $arr;\n\n return $this;\n }",
"public function setSegment($value)\n {\n return $this->set('Segment', $value);\n }",
"public function setSegments($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V3\\Common\\Segments::class);\n $this->segments = $var;\n\n return $this;\n }",
"public function unsetAppointmentSegments(): void\n {\n $this->appointmentSegments = [];\n }",
"public function setSegments($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V0\\Common\\Segments::class);\n $this->segments = $var;\n\n return $this;\n }",
"public function testSetSegments(): void\n {\n $set = $this->class->setSegments([$this->value]);\n\n self::assertTrue($set instanceof Command);\n }",
"public function setRequiredForAllSegments($value = NULL)\n\t{\n\t\tif (NULL !== $value) {\n\t\t $this->requiredForAllSegments = $value;\n\t\t}\n\t\treturn $this;\n\t}",
"public function setSegments(\\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\ArrayType\\ArrayOfint $segments = null)\n {\n if (is_null($segments) || (is_array($segments) && empty($segments))) {\n unset($this->Segments);\n } else {\n $this->Segments = $segments;\n }\n return $this;\n }",
"public function setSegments($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\VideoIntelligence\\V1\\VideoSegment::class);\n $this->segments = $arr;\n\n return $this;\n }",
"public function setSegments($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\VideoIntelligence\\V1beta1\\VideoSegment::class);\n $this->segments = $arr;\n\n return $this;\n }",
"public function setTenantIds(?string $value): void {\n $this->getBackingStore()->set('tenantIds', $value);\n }",
"public function setSegmentID(string $value): self\n {\n $this->SegmentID = $value;\n\n return $this;\n }",
"public function setTimeSegments($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Clarifai\\Api\\TimeSegment::class);\n $this->time_segments = $arr;\n\n return $this;\n }",
"public function setSegment(?string $segment): void\n {\n $this->segment = $segment;\n }",
"public function set_segment($segment)\n\t{\n\t\n\t\t$this->segment = (int) $segment;\n\t}",
"public function setSegmentSeparator($s) {\n\t\t$this->s = $s;\n\t}",
"public function setSegments($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\Dialogflow\\Cx\\V3\\ResponseMessage\\MixedAudio\\Segment::class);\n $this->segments = $arr;\n\n return $this;\n }",
"public function setSpecialization(?TeamSpecialization $value): void {\n $this->getBackingStore()->set('specialization', $value);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Function Name: admin_add_thought params: Null Created BY:Sunny Chauhan Created ON : Sep. 16, 2013 Description : for add/update thought | function admin_add_thought($id = null){
$this->loadModel('Thought');
$this->layout = 'admin';
if(!empty($id)){
$this->set('pagetitle','Update Thought');
$id = base64_decode($id);
$this->set('id',$id);
}else{
$this->set('pagetitle','Add Thought');
}
if(!empty($this->data)){
if(!empty($id)){
$this->Thought->id = $id;
}
if($this->data['Thought']['status'] == 1){
$this->Thought->updateAll(array('Thought.status' => 0)); // updating status of all records to Deactive
$this->data['Thought']['status'] = 1; // making current Thought status active
}
if($this->Thought->save($this->data)){
if(empty($id)){
$this->Session->setFlash('Thought has been added.','message/green');
}else{
$this->Session->setFlash('Thought has been updated.','message/green');
}
$this->redirect(array('controller'=>'admins','action'=>'admin_thoughts_listing'));
}
}elseif(!empty($id)){
$this->Thought->id = $id;
$this->data = $this->Thought->read();
}
} | [
"public function addThoughts() {\n\t\tglobal $REQUEST_DATA;\n\t\tglobal $sessionHandler;\n\t\t$instituteId = $sessionHandler->getSessionVariable('InstituteId');\n\n\t\treturn SystemDatabaseManager::getInstance()->runAutoInsert('thoughts', array('thought','instituteId'), array(strtoupper($REQUEST_DATA['thought']), $instituteId));\n\t}",
"function addThought($db){\n\t\t\t//need Name, Thought, and Date\n\t\t\t\n\t\t\t//used to check if the thought is not the default message in the form\n\t\t\t$defaultMessage= \"Post your thoughts, ideas, dreams, or stories here...\";\n\t\t\t\n\t\t\tif(array_key_exists('name',$_POST) && array_key_exists('thought',$_POST)&& strlen($_POST['thought'])>0 \n\t\t\t&& $_POST['thought'] != \"\" && $_POST['thought'] != \" \" && $_POST['thought'] != \" \" && \n\t\t\tfilter_string($_POST['thought'])!= $defaultMessage) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//setting the variables with values from form\n\t\t\t\t$name= filter_string($_POST['name']);\n\t\t\t\tif($name == \"\" || $name == \" \" || $name == \" \"){\n\t\t\t\t\t$name = \"Anonymous\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$thought = filter_string($_POST['thought']);\n\t\t\t\t$date = date(\"m-d-Y H:i:s\",Time('EST'));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//prepare and execute SQL\n\t\t\t\t//the ? ? are placeholders for the values\n\t\t\t\t$sql = \"INSERT INTO Thoughts (Name, Thought, Date) VALUES(?,?,?)\";\n\t\t\t\t$statement = $db -> prepare($sql);\n\t\t\t\t\n\t\t\t\t//execute and pass in values\n\t\t\t\t$statement -> execute (array($name, $thought, $date));\n\t\t\t\t\n\t\t\t\t//Checks if statement was successful or not and returns a message\n\t\t\t\t\tif($statement){\n\t\t\t\t\t\t$id= $db->lastInsertId(); //lastInsertId() returns the last ID that was incremented into database\n\t\t\t\t\t\t$status= \"Thank you for your thoughts!\";\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$status = \"Sorry, there was an error and your thought wasn't able to be posted. Try reloading this bitch and try again.\";\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t}//END if statement\n\t\t\t\n\t\t\telse{\n\t\t\t\t$status = \"Not all necessary areas have been filled out.\";\n\t\t\t}\n\t\t\t\n\t\t\t///the returned status could be used to open another fancybox that will alert the user after data is sent\n\t\t\treturn $status;\n\t\t\n\t\t}",
"function facebook_hook_thought_add($privacy, $text, $id_parent, $id_master, $id_thought, $id_member, $member_name)\r\n{\r\n\tglobal $scripturl, $txt, $context, $user_info;\r\n\r\n\t// Irrelevant thought?\r\n\tif ($id_parent != 0 || $id_master != 0 || $privacy != '-3')\r\n\t\treturn;\r\n\t\r\n\t// Get the member's info and make sure we should post this thought to his/her feed\r\n\tlist ($id_member, $id_facebook, $fields) = array_values(facebook_get_members($user_info['id']));\r\n\tif (empty($id_facebook) || !in_array('thoughttofeed', $fields))\r\n\t\treturn;\r\n\t\r\n\t$text = html_entity_decode($text, ENT_QUOTES);\r\n\r\n\t// Cache it to prevent facebook updating our own thought...\r\n\tcache_put_data('fb_last_thought_' . $user_info['id'], array('message' => $text), 7 * 86400);\r\n\r\n\t// Post this thought to the feed\r\n\t$facebook = facebook_instance();\r\n\t$facebook->api('/' . $id_facebook . '/feed', 'POST', array(\r\n\t\t'message' => $text,\r\n\t));\r\n}",
"private function _adminAddThoughtOptions()\n\t{\n\t\tif ( isset($_SESSION['user']) )\n\t\t{\n\t\t\treturn <<<ADMIN_OPTIONS\n\t\n\t<div class='horizontalRule'></div>\n\t\n <div class=\"add-thought-admin-options\">\n <form action=\"assets/inc/process.inc.php\" method=\"post\">\n\t\t<input type=\"submit\" name=\"edit_thought\" value=\"+ Add a Another Article\" />\n \t<input type=\"hidden\" name=\"article_id\" value=\"\" />\n\t\t<input type=\"hidden\" name=\"token\" value=\"$_SESSION[token]\" />\n </form>\n </div><!-- end .add-thought-admin-options -->\nADMIN_OPTIONS;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn NULL;\n\t\t}\n\t}",
"public function addAssistant() {\r\n // if 3, assistant is added failed;\r\n $Model = new Model();\r\n $assistantForm = M('assistant');\r\n $manageForm = M('manage');\r\n $assistant['id'] = I('post.aid');\r\n $aid = I('post.aid');\r\n \r\n // the code below checks if the assistant is existed aready.\r\n $found = $Model->query(\"SELECT * FROM ams_assistant WHERE id='$aid' LIMIT 1\");\r\n if ($found) {\r\n $response['success'] = 0;\r\n } else {\r\n // Adding assistant in table ams_assistant\r\n $assistant['passwd'] = $assistant['id'];\r\n $aresult = $Model->query(\"INSERT INTO ams_assistant (id, passwd) VALUES ('$aid', '$aid')\");\r\n\r\n // Adding management infomation in table ams_manage (aid, mid)\r\n $mid = I('cookie.userId');\r\n $mresult = $Model->query(\"INSERT INTO ams_manage (aid, mid) VALUES ('$aid', '$mid')\");\r\n if($aresult && $mresult) {\r\n $response['success'] = 1;\r\n } else {\r\n $response['success'] = 3;\r\n }\r\n }\r\n $this->ajaxReturn($response,\"JSON\");\r\n }",
"public function add_story( $text, $turns, $post ){\n\t\t\n\t\t$story = ORM::factory( 'story' );\n\t\t$story->turns = $turns;\n\t\t$story->save();\n\t\t\n\t\t// add part to teller\n\t\t$part = $story->add_part( $text , $post );\n\t\t\n\t\t// add story owner to teller as well as first part.\n\t\t$this->add( 'stories', $story )->add( 'parts', $part );\n\t\t\n\t\t// return story obj\n\t\treturn $story;\n\t\t\t\t\n\t}",
"public function add(){\r\n \t$this->__requireLogin();\r\n\t if(empty($this->data)){\r\n\t $this->layout = 'pda';\r\n $new = array(\r\n 'id'=>null,\r\n 'title'=>'',\r\n 'description'=>'',\r\n \t'topic_id'=>0,\r\n 'player_id'=>$this->Session->read('Player.id'),\r\n 'remark'=>'',\r\n 'editedBy'=>0,\r\n 'approvedBy'=>0,\r\n 'short_title'=>'',\r\n 'text'=>''\r\n );\r\n $this->set('articles', $this->Article->find('all', array('conditions'=>'approvedBy>0', 'order'=>'title ASC')));\r\n\t $this->set('data', $this->Article->create($new));\r\n\t $this->set('topics', $this->Topic->find('list'));\r\n\t $this->render('edit');\r\n\t } else {//save added wiki item data\r\n\t \tdebug($this->data);exit;\r\n\t }\r\n }",
"public function add() {\n\t\t$this->breadcrumb->append ( 'Add Trouble Type', '/admin/trouble_type/add/' );\n\t\t\n\t\t// if post is set then save\n\t\tif ($this->input->post ()) {\n\t\t\t$post = $this->input->post ();\n\t\t\t$result = $this->trouble_types->add_trouble_type ( $post );\n\t\t\t\n\t\t\tif ($result == true) {\n\t\t\t\t$this->session->set_flashdata ( \"growl_success\", 'Trouble type successfully added' );\n\t\t\t\tredirect ( \"/admin/trouble_type\" );\n\t\t\t} else {\n\t\t\t\t$this->session->set_flashdata ( \"growl_error\", 'Something went wrong' );\n\t\t\t}\n\t\t}\n\t\t$data ['title'] = 'Wmanager | Add Trouble Type';\n\t\t$data ['content'] = $this->load->view ( 'wmanager/troubles/add_trouble_type', $data, true );\n\t\t$this->load->view ( 'wmanager/admin_template', $data );\n\t}",
"public function add()\r\n {\r\n $note = $this->real_escape_string(trim($_POST['note']));\r\n $this->query('INSERT INTO notes (notes) VALUES (\"'.$note.'\")');\r\n unset($_POST['note']);\r\n }",
"function addLecture($topic, $course, $adminID, $stime, $etime){\r\n $lecture['lectureTopic'] = $topic;\r\n $lecture['lectureClass'] = $course;\r\n \t$lecture['lectureAdmin'] = $adminID;\r\n $lecture['lectureStartTime'] = date('Y-m-d H:i:s', strtotime(\"$stime\"));\r\n $lecture['lectureEndTime'] = date('Y-m-d H:i:s', strtotime(\"$etime\")); \r\n\r\n $this->db->insert('lecture', $lecture);\r\n }",
"public function webadmin_add() {\n $this->layout = 'admin_main';\n $this->loadModel('Skill');\n $skill_data = $this->Skill->find('list', array('fields' => 'Skill.name'));\n $this->set('data', $skill_data);\n if ($this->request->is('post')) {\n if ($this->Subskill->save($this->request->data)) {\n $this->Session->setFlash('Subskills Added Successfully', 'success');\n $this->redirect(array('controller' => 'subskills', 'action' => 'index', $this->request->data['Subskill']['skill_id']));\n }\n }\n }",
"function addSensSpec() {\n\t\t$data =&$this->params['form'];\n\t\t// Create the Sensitivity object\n\t\t$this->Sensitivity->create(\n\t\t\tarray(\"study_id\" =>$data['study_id'],\n\t\t\t\t\"sensitivity\"=>$data['sensitivity'],\n\t\t\t\t\"specificity\"=>$data['specificity'],\n\t\t\t\t\"prevalence\" =>$data['prevalence'],\n\t\t\t\t\"specificAssayType\" => $data['specificAssayType'],\n\t\t\t\t\"notes\"=>$data['sensspec_details'])\n\t\t\t);\n\t\t$this->Sensitivity->save();\n\t\t$sensitivity_id = $this->Sensitivity->getLastInsertId();\n\t\t\n\t\t// Create the HABTM link\n\t\t$this->checkSession(\"/biomarkers/organs/{$data['biomarker_id']}/{$data['organ_data_id']}\");\n\t\t$this->StudyData->habtmAdd('Sensitivity',$data['study_data_id'],$sensitivity_id);\n\t\t// Redirect\n\t\t$this->redirect(\"/biomarkers/organs/{$data['biomarker_id']}/{$data['organ_data_id']}\");\n\t}",
"public function admin_add()\n {\n if ($this->request->is('post')) {\n $this->Tutorial->create();\n if ($this->Tutorial->save($this->request->data)) {\n $this->Session->setFlash(__('The tutorial has been saved'), 'success');\n // $this->redirect(array('action' => 'edit', $this->Tutorial->id));\n } else {\n $this->Session->setFlash(__('The tutorial could not be saved. Please, try again.'), 'error');\n }\n } \n\n \n $contain = array('Subject.name');\n\n $topics = $this->Tutorial->Topic->find(\n 'all',\n compact('contain')\n );\n\n $topicsList = array();\n foreach ($topics as $topic){\n $topicsList[$topic['Subject']['name']][$topic['Topic']['id']] = $topic['Topic']['name'];\n }\n\n $topics = $topicsList; \n //debug($topicsList);\n $this->set(compact('topics'));\n }",
"function addSubmissionNote() {\n\t\t$paperId = Request::getUserVar('paperId');\n\t\t$this->validate($paperId);\n\n\t\tTrackDirectorAction::addSubmissionNote($paperId);\n\t\tRequest::redirect(null, null, null, 'submissionNotes', $paperId);\n\t}",
"public function addSong()\n {\n // if we have POST data to create a new song entry\n if (isset($_POST[\"submit_add_song\"])) {\n // Instance new Model (Song)\n $Song = new Song();\n // do addSong() in model/model.php\n $Song->addSong($_POST[\"artist\"], $_POST[\"track\"], $_POST[\"link\"]);\n }\n\n // where to go after song has been added\n redirect('songs/index');\n }",
"function add()\n { \n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t'stts' => $this->input->post('stts'),\n\t\t\t\t'ktg' => $this->input->post('ktg'),\n );\n \n $stts_wp_id = $this->Stts_wp_model->add_stts_wp($params);\n redirect('stts_wp/index');\n }\n else\n { \n $data['_view'] = 'stts_wp/add';\n $this->load->view('layouts/main',$data);\n }\n }",
"public function createSkill($skill_being_added){\n $sql = \"INSERT INTO skills (description)\n VALUES ($skill_being_added)\";\n \n if ($conn->query($sql) === TRUE) {\n echo \"New record created successfully\";\n } else {\n echo \"Error: \" . $sql . \"<br>\" . $conn->error;\n }\n \n //$conn->close();\n }",
"function add_note($postuid, $postid, $textm, $repto, $inittime, $cdata, $ntype)\r\n\t{\r\n\t\t$writeruid = $_SESSION['uid'];\r\n\t\t\r\n\t\t/* check if the post is valid */\r\n\t\t\r\n\t\tif(!basics::table_exists(\"posts_$postuid\")) return 0;\r\n\t\t\r\n\t\t$rpd = basics::query(\"SELECT talkcid FROM posts_$postuid WHERE id=$postid\");\r\n\t\t\r\n\t\tif(!mysql_num_rows($rpd )) return 0;\r\n\t\t\r\n\t\t\r\n\t\t/* check if the talk talbe exists and create if not */\r\n\t\t\r\n\t\tif(!basics::table_exists(\"talk_\".$postuid.\"_\".$postid))\r\n\t\t{\r\n\t\t\tbasics::query(\"CREATE TABLE talk_\".$postuid.\"_\".$postid.\" (\r\n\t\t\t\tid int not null primary key auto_increment,\r\n\t\t\t\tuid \t\t int,\r\n\t\t\t\twtime datetime,\r\n\t\t\t\tmtime datetime,\r\n\t\t\t\tatime datetime,\r\n\t\t\t\trating1 int,\r\n\t\t\t\trating2 int,\r\n\t\t\t\treports int,\r\n\t\t\t\tctext text,\r\n\t\t\t\ttype int,\r\n\t\t\t\tresposecount int,\r\n\t\t\t\tdetails int,\r\n\t\t\t\treptoid int\r\n\t\t\t\t);\");\r\n\t\t\t\t\r\n\t\t\tbasics::query(\"UPDATE posts_$postuid SET talkcid=1 WHERE id=$postid\");\r\n\t\t}\r\n\r\n\t\t$ftextm = strip_tags($textm, \"<b><i><s>\");\r\n\t\t$ftextm = basics::translate_urls_to_html($ftextm);\r\n\t\r\n\t\t$textm = trim(str_replace('\\r', '[-n-l-]', str_replace('\\n', '[-n-l-]', $textm)));\r\n\t\t$textm = str_replace(\"?\", \"[-q-]\", $textm);\r\n\t\t$textm = strip_tags($textm, \"<b><i><s>\");\r\n\t\t\r\n\t\t$dtext = basics::escapestr($textm);\r\n\r\n\t\t\r\n\t\tif($ntype == 0)\r\n\t\t{\r\n\t\t\tbasics::query(\"INSERT INTO talk_$postuid\".\"_\".$postid.\" (uid, wtime, mtime, atime, rating1, rating2, reports, ctext, type, resposecount, details, reptoid)\".\r\n\t\t\t\t\t\t \"values ($writeruid, UTC_TIMESTAMP(), UTC_TIMESTAMP(), UTC_TIMESTAMP(), 0, 0, 0, '$dtext', 0, 0, 0, $repto)\");\r\n\t\t}else{\r\n\t\t\r\n\t\t\t$r1 = 0;\r\n\t\t\t$r2 = 0;\r\n\t\t\t\r\n\t\t\tif(count($repto) >= 2)\r\n\t\t\t{\r\n\t\t\t\tif(is_numeric($repto[0]))\r\n\t\t\t\t\t$r1 = $repto[0];\r\n\t\t\t\t\t\r\n\t\t\t\tif(is_numeric($repto[1]))\r\n\t\t\t\t\t$r2 = $repto[1];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tbasics::query(\"INSERT INTO talk_$postuid\".\"_\".$postid.\" (uid, wtime, mtime, atime, rating1, rating2, reports, ctext, type, resposecount, details, reptoid)\".\r\n\t\t\t\t\t\t \"values ($writeruid, UTC_TIMESTAMP(), UTC_TIMESTAMP(), UTC_TIMESTAMP(), $r1, $r2, 0, '$dtext', 1, 0, 0, 0)\");\r\n\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$notesnotify = 1;\r\n\t\tif($postuid == $writeruid) $notesnotify = 0; /* add check for uid [todo] */\r\n\t\t\t\r\n\t\tif($notesnotify)\r\n\t\t{\t\t\t\r\n\t\t\tbasics::notification_set(basics::nmtype_general, basics::ntype_note, $postuid, array($postuid, $postid, 0));\r\n\t\t}\r\n\t\t\t\r\n\t\treturn $ftextm;\r\n\t}",
"function add_tekserve_case_study_fields( $tekserve_case_study_id, $tekserve_case_study ) {\n if ( $tekserve_case_study->post_type == 'tekserve_case_study' ) {\n // Store data in post meta table if present in post data\n if ( isset( $_POST['tekserve_case_study_organization'] ) && $_POST['tekserve_case_study_organization'] != '' ) {\n update_post_meta( $tekserve_case_study_id, 'tekserve_case_study_organization', sanitize_text_field( $_REQUEST['tekserve_case_study_organization'] ) );\n \t}\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a primary tier user | public function createPrimaryTierUser(UserDTO $userDTO)
{
$personEmail = $userDTO->getEmail();
$personPhone = $userDTO->getPhone();
$personFacultyId = $userDTO->getFacultyId();
$tier = $this->organizationRepository->find($userDTO->getTierId());
if ((!$tier) || ($tier->getTier() != 1)) {
throw new SynapseValidationException("Tier Not Found.");
}
$person = $this->usersHelperService->validateExternalId($personFacultyId, $tier, NULL, NULL, 'faculty', $personEmail);
if (!$person) {
$person = new Person();
$person->setFirstname($userDTO->getFirstname());
$person->setLastname($userDTO->getLastname());
$person->setUsername($personEmail);
$person->setTitle($userDTO->getTitle());
$person->setOrganization($tier);
$person->setExternalId($personFacultyId);
$contact = new ContactInfo();
if ($userDTO->getIsmobile()) {
$contact->setPrimaryMobile($personPhone);
} else {
$contact->setHomePhone($personPhone);
}
$contact->setPrimaryEmail($personEmail);
$contactErrors = $this->validator->validate($contact);
if (count($contactErrors) > 0) {
$errorsString = $contactErrors[0]->getMessage();
throw new SynapseValidationException($errorsString);
}
$person->addContact($contact);
$this->personRepository->createPerson($person);
}
$organizationUsers = new OrgUsers();
$organizationUsers->setPerson($person);
$organizationUsers->setOrganization($tier);
$this->orgUsersRepository->persist($organizationUsers);
// Adding tier user as staff also
$orgFaculty = new OrgPersonFaculty();
$orgFaculty->setPerson($person);
$orgFaculty->setOrganization($tier);
$this->orgPersonFacultyRepository->persist($orgFaculty);
$this->personRepository->flush();
$userDTO->setId($person->getId());
$people = $this->cache->fetch("organization.{$tier->getId()}.people");
$people = $people ? $people : [];
$people[$person->getId()] = $person->getExternalId();
$this->cache->save("organization.{$tier->getId()}.people", $people);
return $userDTO;
} | [
"private function createNewUser()\n {\n\n $name = (string) $this->ask('Name');\n $email = (string) $this->ask('E-Mail');\n $user = config('multi-tenant.user_class')::create([\n 'name' => $name,\n 'email' => $email,\n 'password' => bcrypt('tester'),\n ]);\n\n $add_to_tenant = $this->anticipate('Would you like to assign the user to a tenant?', ['Yes', 'No'], 'Yes');\n\n if ($add_to_tenant == 'Yes') {\n $headers = ['Name', 'ID'];\n $tenants = config('multi-tenant.tenant_class')::all('name', 'id');\n\n if($tenants->count() <= 0) {\n $this->comment($user->email . ' with the password `tester` was created without any tenants');\n } else {\n $this->table($headers, $tenants->toArray());\n\n $tenant_id = (int) $this->ask('Please enter the id of the desired tenant.');\n\n $tenant = config('multi-tenant.tenant_class')::findOrFail($tenant_id);\n\n $tenant->update(['owner_id' => $user->id]);\n\n $this->comment('The user ' . $user->email . ' is now the owner of ' . $tenant->name . ' with the password `tester`');\n }\n }\n else{\n $this->comment($user->email . ' with the password `tester` was created without any tenants');\n }\n\n }",
"private function _createUser(){\r\n\r\n }",
"protected function createUser() {\n\t\t$this->u_key = null;\n\t\t$this->u_key = $this->u_obj->create();\n\t}",
"public function create() {\n\t\t\\common\\model\\UserDAL::create($this->getUser());\n\t}",
"private static function create_user($user_data){\r\n\r\n }",
"protected function createFirstUser()\n {\n $info = [\n 'first_name' => $this->askForFirstName(),\n 'last_name' => $this->askForLastName(),\n 'email' => $this->askForEmail(),\n 'password' => $this->getHashedPassword(\n $this->askForPassword()\n ),\n ];\n\n $user = $this->application->make(UserRepository::class)->createWithRolesFromCli($info, [1], true);\n $this->application->make(\\Modules\\User\\Repositories\\UserTokenRepository::class)->generateFor($user->id);\n\n $this->command->info('Please wait while the admin account is configured...');\n }",
"public function creat_user_for_client($data);",
"protected function _createNewUser()\n\t{\n\t\t$this->_loadUsersTable();\n\t\t$userId = $this->_users->createRow()->save();\n\t\t// Reload the user to get default values set by the storage mechanism.\n\t\t$userInfo = $this->_users->findUser($userId);\n\t\t$this->_setInfo($userInfo);\n\t\tAcl_Factory::addDefaultPrivileges(array(\n\t\t\t\t\t\t\t\t\t\t\tAcl_Db_Table_Privileges::getColumnName('userId') => $userId),\n\t\t\t\t\t\t\t\t\t\t\tself::$_defaultPrivilegeCategories);\n\t\treturn $userId;\n\t}",
"public function createUserAndTenant()\n {\n $tenant = (new Tenant())->create('ABC Industries');\n return factory(User::class)->create(['tenant_id' => $tenant->id]);\n }",
"public function testCreateMinimalUser() {\n $this->createMinimalTestUser();\n }",
"protected function createUser()\n {\n $aResponse = $this->getResponse();\n $oUser = new User;\n if (!$oUser->getCustomerIdByPayoneUserId($aResponse['userid'])) {\n $sCustomerId = \\Context::getContext()->cart->id_customer;\n $oUser->setCustomerId($sCustomerId);\n $oUser->setPayoneUserId($aResponse['userid']);\n $oUser->save();\n }\n }",
"public function createLimitedUser() {\n $this->limitedUser = $this->drupalCreateUser([\n 'access administration pages',\n 'administer languages',\n 'administer site configuration',\n 'use domain config ui',\n 'set default domain configuration',\n ]);\n }",
"public function new_user() {\r\n\t\tMainWP_Child_Users::get_instance()->new_user();\r\n\t}",
"private function create_test_user() {\n global $CFG;\n require_once($CFG->dirroot.'/elis/program/lib/data/user.class.php');\n\n $user = new user(array(\n 'username' => 'testuserusername',\n 'email' => 'testuser@email.com',\n 'idnumber' => 'testuseridnumber',\n 'firstname' => 'testuserfirstname',\n 'lastname' => 'testuserlastname',\n 'country' => 'CA'\n ));\n $user->save();\n }",
"function _timian_service_create_user($data)\n{\n $user = user_load_by_name($data['name']);\n\n if ($user) {\n if (!$user->status) {\n $user->status = \"1\";\n user_save($user);\n header(\"HTTP/1.0 201\");\n return [\n \"result\" => \"User {$data['name']} activated\",\n ];\n\n } else {\n header(\"HTTP/1.0 409\");\n return [\n \"result\" => \"User {$data['name']} already exists\",\n ];\n }\n\n } else {\n\n $supplier_value = get_node_nid($data['birgi']); //get_node_nid_by_acronym($data['birgi']);\n\n $new_user = [\n 'name' => $data['name'],\n 'pass' => drupal_random_key(), // random password, user will be login trough sso\n 'mail' => $data['email'],\n 'status' => 1,\n 'init' => $data['email'],\n 'roles' => [\n DRUPAL_AUTHENTICATED_RID => 'authenticated user',\n 12 => 'suppliers',\n ],\n 'field_user_fullname' => [\n 'und' => [\n 0 => [\n 'value' => $data['name'],\n ],\n ],\n ],\n 'field_user_supplier' => [\n 'und' => [\n 0 => [\n 'value' => $supplier_value,\n ],\n ],\n ],\n ];\n user_save('', $new_user);\n\n header(\"HTTP/1.0 201\");\n return [\n \"result\" => \"User {$data['name']} created\",\n ];\n }\n}",
"public function createUser(){\n if(!$this->isExternal()) //Si es un alumno de la misma universidad no tiene sentido crear usuari\n return false;\n $rol=null;\n if(yii::$app->hasModule('inter'))\n $rol=\\frontend\\modules\\inter\\Module::ROL_POSTULANTE;\n $user=$this->persona->createUser($this->codalu,$this->mail,$role);\n if(!is_null($user)){\n $this->hasuser=true; $this->save(); \n }\n return $user;\n \n }",
"private function __createRootUser()\n {\n $this->out('...... Create root user');\n\n if(!$this->__getStepCompleteByIndex($this->__stepIndexList['security_codes'])) {\n $this->out('*** ERROR *** You first need to run the security cipher and salt generation step');\n return;\n }\n\n if(!$this->__getStepCompleteByIndex($this->__stepIndexList['database_config'])) {\n $this->out('*** ERROR *** You first need to run the database configuration step');\n return;\n }\n\n if(!$this->__getStepCompleteByIndex($this->__stepIndexList['run_schema_shell'])) {\n $this->out('*** ERROR *** You first need to run the schema generation step');\n return;\n }\n\n $userModel = new User();\n\n $user = array();\n $user['User']['id'] = '4e27efec-ece0-4a36-baaf-38384bb83359';\n $user['User']['employee'] = 1;\n\n $emailValidates = true;\n do {\n if(!$emailValidates) {\n $invalidData = $userModel->invalidFields();\n $this->out('** ERROR ** ' . $invalidData['email'][0]);\n }\n\n $user['User']['email'] = $this->in('Email: ');\n $userModel->set($user);\n $emailValidates = $userModel->validates(array('fieldList' => array('email')));\n } while(!$emailValidates);\n\n\n $passwordValidates = true;\n do {\n if(!$passwordValidates) {\n $invalidData = $userModel->invalidFields();\n $this->out('** ERROR ** ' . $invalidData['password'][0]);\n }\n\n system('stty -echo');\n $user['User']['password'] = $this->in('Password: ');\n $user['User']['verify_password'] = $this->in('Verify Password: ');\n system('stty echo');\n\n $userModel->set($user);\n $passwordValidates = $userModel->validates(array('fieldList' => array('password')));\n\n } while(!$passwordValidates);\n\n if($userModel->createUser($user['User'])) {\n $this->out('+++ Successfully created \"root\"');\n } else {\n $this->out('** ERROR ** There was a problem creating root user, please try again');\n $this->__createRootUser();\n }\n\n $this->__updateSetupState('create_root_user');\n }",
"private function createFakeUser()\n {\n $name = $this->faker->name;\n\n $user = config('multi-tenant.user_class')::create([\n 'name' => $name,\n 'email' => $this->faker->unique()->safeEmail,\n 'password' => bcrypt('tester'),\n ]);\n\n $add_to_tenant = $this->anticipate('Would you like to assign the user to a tenant?', ['Yes', 'No'], 'Yes');\n\n if ($add_to_tenant == 'Yes') {\n $headers = ['Name', 'ID'];\n $tenants = config('multi-tenant.tenant_class')::all('name', 'id');\n\n if($tenants->count() <= 0) {\n $this->comment($user->email . ' with the password `tester` was created without any tenants');\n } else {\n $this->table($headers, $tenants->toArray());\n\n $tenant_id = (int) $this->ask('Please enter the id of the desired tenant.');\n\n $tenant = config('multi-tenant.tenant_class')::findOrFail($tenant_id);\n\n $tenant->update(['owner_id' => $user->id]);\n\n $this->comment('The user ' . $user->email . ' is now the owner of ' . $tenant->name . ' with the password `tester`');\n }\n }\n }",
"public function createUserFromConfig():self;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
validateDomain() Validates a Domain Name | function validateDomain($domain) {
if(!preg_match("/^([-a-z0-9]{2,100})\.([a-z\.]{2,8})$/i", $domain)) {
return false;
}
return $domain;
} | [
"public function validate_domain() {\n if (isset($this->initial_data[\"domain\"])) {\n # Ensure it is a validate hostname\n if (is_hostname($this->initial_data[\"domain\"])) {\n $this->validated_data[\"domain\"] = $this->initial_data['domain'];\n } else {\n $this->errors[] = APIResponse\\get(2058);\n }\n } else {\n $this->errors[] = APIResponse\\get(2064);\n }\n }",
"function validDomain($name) {\n\t\t\t$pieces = explode('.', $name);\n\t\t\tforeach ($pieces as $piece) {\n\t\t\t\tif (!preg_match('/^[a-z\\d][a-z\\d-]{0,62}$/i', $piece) || preg_match('/-$/', $piece)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}",
"function validDomain( $domain )\n\t{\n\t\treturn true;\n\t}",
"function validDomain( $domain ) {\n return true;\n }",
"public function is_valid_domain_name($domain_name)\n {\n if(filter_var(gethostbyname($domain_name), FILTER_VALIDATE_IP))\n {\n return TRUE;\n }\n return false;\n }",
"public function validDomain( $domain )\n {\n return true;\n }",
"public function validDomain($domain) {\r\n return true;\r\n }",
"public function validDomain( $domain ) {\n\t\treturn true;\n\t}",
"public function wrongDomainName()\n {\n return $this->error('Domain name is not in valid format.');\n }",
"function _validateDomain($domain) {\n\t\t// Note the different use of $subdomains and $sub_domains\n\t\t$subdomains = explode('.', $domain);\n\n\t\twhile (count($subdomains) > 0) {\n\t\t\t$sub_domains[] = $this->_splitCheck($subdomains, '.');\n\n\t\t\tfor ($i = 0; $i < $this->index + 1; $i++)\n\t\t\t\tarray_shift ($subdomains);\n\t\t}\n\n\t\tfor ($i = 0; $i < count($sub_domains); $i++) {\n\t\t\tif (!$this->_validateSubdomain(trim($sub_domains[$i])))\n\t\t\t\treturn false;\n\t\t}\n\n\t\t// Managed to get here, so return input.\n\t\treturn $domain;\n\t}",
"public function validateDomain(Request $request)\n {\n // Get request parameters\n $params = $request->get('params');\n $domainName = $params['domain'];\n\n // Parse the string domain into parts, looking for just the host\n $domainHost = $this->getDomainHostFromDomain($domainName);\n\n // In case domain string is not valid, return error with message\n if (!$domainHost) {\n return response('This is not a valid domain.', 401);\n }\n\n // Check DB if domain already exists\n $domains = Domains::where('domain', $domainHost)->get();\n\n // Instantiate variable describing if domain is good to create/unique\n $isValid = count($domains) < 1;\n\n // Return response\n return response()->json($isValid);\n }",
"public function IsDomain($var, $name = null, $error = null, $allowed_utf8_chars = \"\", $disallowed_utf8_chars = \"\")\r\n\t\t{\t\r\n\t\t\t// Remove trailing dot if its there. FQDN may contain dot at the end!\r\n\t\t\t$var = rtrim($var, \".\");\r\n\t\t\t\r\n\t\t\t$retval = (bool)preg_match('/^([a-zA-Z0-9'.$allowed_utf8_chars.']+[a-zA-Z0-9-'.$allowed_utf8_chars.']*\\.[a-zA-Z0-9'.$allowed_utf8_chars.']*?)+$/usi', $var);\r\n\t\t\t\t\t\t\t\r\n\t\t\tif ($disallowed_utf8_chars != '')\r\n\t\t\t\t$retval &= !(bool)preg_match(\"/[{$disallowed_utf8_chars}]+/siu\", $var);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (!$retval)\r\n\t\t\t\t$this->AddError(self::ERROR_DOMAIN, $var, $name, $error);\r\n\t\t\t\r\n\t\t\treturn $retval;\r\n\t\t}",
"function auth_server_validate_domain($domain) {\n\n return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $domain);\n //return true;\n}",
"function isDomain($domain) {\r\n\t\tif (!is_string($domain)) return false;\r\n\t\t\r\n\t\tfor ($i = 0; $i < strlen($domain); $i++)\r\n\t\t\tif (ord($domain{$i}) > 127) return false;\r\n\t\t\r\n\t\t$ipDigit = '(0?0?\\d|[01]?\\d\\d|2[0-4]\\d|25[0-5])';\r\n\t\t$ipRE = '/^'.$ipDigit.'\\.'.$ipDigit.'\\.'.$ipDigit.'\\.'.$ipDigit.'$/';\r\n\t\t//echo $ipRE;\r\n\t\tif (preg_match($ipRE,$domain)) return true;\r\n\t\t\r\n\t\t$domains = explode(\".\",$domain);\r\n\r\n\t\tif (count($domains) < 2) return false;\r\n\t\r\n\t\tforeach ($domains as $d)\r\n\t\t\tif (!preg_match('/^[a-zA-Z0-9\\-]+$/',$d)) return false;\r\n\r\n\t\tif (strlen($domains[count($domains)-2]) < 2) return false;\r\n\t\r\n\t\tif (!preg_match('/^[a-zA-Z]{2,}$/',$domains[count($domains)-1])) return false;\r\n\t\r\n\t\treturn true;\r\n\r\n\t}",
"function is_valid_domain_or_ip($domain_name) {\n $dom_ok = (preg_match(\"/^([a-z\\d](-*[a-z\\d])*)(\\.([a-z\\d](-*[a-z\\d])*))*$/i\", $domain_name) //valid chars check\n && preg_match(\"/^.{1,253}$/\", $domain_name) //overall length check\n && preg_match(\"/^[^\\.]{1,63}(\\.[^\\.]{1,63})*$/\", $domain_name) ); //length of each label\n if (!$dom_ok) {\n $dom_ok = preg_match(\"/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])$/\", $domain_name);\n }\n if (!$dom_ok) {\n $dom_ok = gethostbyname($domain_name);\n }\n return $dom_ok;\n}",
"public function testDomainNameValid()\n {\n $controller = new ValidateIpController();\n // $controller->domainName();\n $res = $controller->domainName(\"8.8.8.8\");\n $this->assertContains(\"dns.google\", $res);\n }",
"function is_domain($domain) {\n\tif (!is_string($domain))\n\t\treturn false;\n\n\tif (preg_match(\"/^([a-z0-9\\-]+\\.?)+$/i\", $domain))\n\t\treturn true;\n\telse\n\t\treturn false;\n}",
"public static function isDomain($domain) {\n\t// cant do this as it returns the host part as the path if there is no scheme!! Passes http://.com. Fixed in PHP 5.4.7?\n\t//echo parse_url($url, PHP_URL_HOST);\n\t//if (@parse_url($url, PHP_URL_HOST)) {return true;}\n\t//return false;\n\t\n\t$domainlen = strlen($domain);\n\tif ($domainlen < 4 || $domainlen > 255) {return false;}\n\t\n\t// Regex by David as ones on internet are all broken!\n\t// ^[a-z0-9] From start of string (denoted by the ^), must start with alpha numeric\n\t// ( = start a sub pattern which contains...\n\t// \\\\.(?![\\\\.|\\\\-]) = period not followed by another period or hyphen\n\t// | = OR [a-z0-9] = any alpha-numeric\n\t// | = OR [\\\\.(?![\\\\.|\\\\-]) = hyphen not followed by another hyphen or period\n\t// )* = close sub pattern - can be matched any number of times\n\t// \\\\.[a-z0-9]{2,}$ = must end with (denoted by the $) a period and at least 2 alpha numerics\n\t// i = case insensitive regex\n\t$regex = '/^[a-z0-9](\\\\.(?![\\\\.|\\\\-])|[a-z0-9]|\\\\-(?![\\\\-|\\\\.]))*\\\\.[a-z0-9]{2,}$/i';\n\tif (!preg_match($regex, $domain)) {return false;}\n\treturn true;\n}",
"function validateHostname () {\n if ( preg_match('/^([^.]+)\\.(.+)$/', $this->full_hostname,$hostname_parts ) ) {\n $this->host_name = $hostname_parts[1];\n $this->domain_name = $hostname_parts[2];\n $this->validateDomain();\n return 1;\n } else {\n return 0;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the ket_bangunan column Example usage: $query>filterByKetBangunan('fooValue'); // WHERE ket_bangunan = 'fooValue' $query>filterByKetBangunan('%fooValue%'); // WHERE ket_bangunan LIKE '%fooValue%' | public function filterByKetBangunan($ketBangunan = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($ketBangunan)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $ketBangunan)) {
$ketBangunan = str_replace('*', '%', $ketBangunan);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(BangunanPeer::KET_BANGUNAN, $ketBangunan, $comparison);
} | [
"function filterByAlphabet ($fruilts,$key,$filterby){\n\n $sql = \"\";\n if($filterby === \"*\"){\n $sql = \"select * from product where type='fruit' and deleted ='0' order by name asc \";\n }else {\n $sql = \"select * from product where type='fruit' and deleted ='0' and name LIKE '$filterby%' order by name asc \"; \n }\n \n $list_of_fruit = $fruilts->getAllProductBySql($sql); \n\n echo json_encode($list_of_fruit);\n }",
"public function filterByKeterangan($keterangan = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($keterangan)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $keterangan)) {\n $keterangan = str_replace('*', '%', $keterangan);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(VariabelPeer::KETERANGAN, $keterangan, $comparison);\n }",
"public function filterByKeterangan($keterangan = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($keterangan)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $keterangan)) {\n $keterangan = str_replace('*', '%', $keterangan);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(KaryaTulisPeer::KETERANGAN, $keterangan, $comparison);\n }",
"function SqlKeyFilter() {\n\t\treturn \"`id` = '@id@' AND `angsuran` = @angsuran@\";\n\t}",
"public function filterByKelompok($kelompok = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($kelompok)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $kelompok)) {\n $kelompok = str_replace('*', '%', $kelompok);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(JenisSaranaPeer::KELOMPOK, $kelompok, $comparison);\n }",
"public static function generateWhere($kolom,$value,$jenis,$sambungan=\"\",$lpad=\"\"){\n\t $hasil = '';\n\t $sambungan = $sambungan == '' ? 'AND' : $sambungan;\n\t $temphasil = ' '.$sambungan.' '.$lpad.$kolom;\n\t if($jenis == '='){\n\t $value = is_int($value) ? $value : '\"'.$value.'\"';\n\t $hasil = $temphasil.' = '.$value.' ';\n }\n\t if($jenis == 'like'){\n\t $hasil = $temphasil.' LIKE \"%'.$value.'%\" ';\n }\n return $hasil;\n }",
"public function filterByKetTanah($ketTanah = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($ketTanah)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $ketTanah)) {\n $ketTanah = str_replace('*', '%', $ketTanah);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(TanahPeer::KET_TANAH, $ketTanah, $comparison);\n }",
"public function filterName()\n {\n return config('query-filter.key.where');\n }",
"function filter_meta_query($k, $v) {\n return array(\n 'key' => $k,\n 'value' => $v,\n 'compare' => 'LIKE',\n );\n }",
"public function gabung_where($kolom2_rujukan){\n $where=\"\\\"\";\n foreach($kolom2_rujukan as $k=>$isi){\n $where=$where.$k.\"='\".$isi.\"' AND \";\n\t\t}\n\t\t$where=rtrim($where,\" AND \").\"\\\"\";\n\t\treturn $where;\n\t}",
"private function filter() {\n $globalSearch = array();\n $havingSearch = array();\n $columnSearch = array();\n $dtColumns = self::pluck($this->columns, 'dt');\n\n if (isset($this->request['search']) && $this->request['search']['value'] != '') {\n $str = $this->request['search']['value'];\n\n for ($i = 0, $ien = count($this->request['columns']); $i < $ien; $i++) {\n $requestColumn = $this->request['columns'][$i];\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\n $column = $this->columns[$columnIdx];\n\n if ($requestColumn['searchable'] == 'true') {\n if(strpos($column['db'], \"GROUP_CONCAT\") !== false){\n $havingSearch[] = $column['db'] . \" LIKE '%$str%'\";\n }else{\n $globalSearch[] = $column['db'] . \" LIKE '%$str%'\";\n }\n }\n }\n }\n\n // Individual column filtering\n if(isset($this->request['columns'])){\n for ($i = 0, $ien = count($this->request['columns']); $i < $ien; $i++) {\n $requestColumn = $this->request['columns'][$i];\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\n $column = $this->columns[$columnIdx];\n \n $str = $requestColumn['search']['value'];\n \n if ($requestColumn['searchable'] == 'true' && $str != '') {\n if( !(strpos($column['db'], \"GROUP_CONCAT\") !== false) ){\n $columnSearch[] = $column['db'] . \" LIKE '%$str%'\";\n }\n }\n }\n }\n \n\n // Combine the filters into a single string\n $where = '';\n $having = '';\n \n if (count($globalSearch)) {\n $where = '(' . implode(' OR ', $globalSearch) . ')';\n }\n if (count($havingSearch)) {\n $having = '(' . implode(' OR ', $havingSearch) . ')';\n }\n\n if (count($columnSearch)) {\n $where = $where === '' ?\n implode(' AND ', $columnSearch) :\n $where . ' AND ' . implode(' AND ', $columnSearch);\n }\n\n if ($where !== '') {\n $this->query->andWhere($where);\n }\n if ($having !== '') {\n /*\n * @ToDo \n * There is some bugs when you use GROUP_CONCAT function\n **/\n //$this->query->having($having);\n }\n }",
"public function filterByKelompok($kelompok = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($kelompok)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $kelompok)) {\n $kelompok = str_replace('*', '%', $kelompok);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(KompetensiPeer::KELOMPOK, $kelompok, $comparison);\n }",
"public function filterByKkP($kkP = null, $comparison = null)\n {\n if (is_array($kkP)) {\n $useMinMax = false;\n if (isset($kkP['min'])) {\n $this->addUsingAlias(KebutuhanKhususPeer::KK_P, $kkP['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($kkP['max'])) {\n $this->addUsingAlias(KebutuhanKhususPeer::KK_P, $kkP['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(KebutuhanKhususPeer::KK_P, $kkP, $comparison);\n }",
"public function filterByPengguna($pengguna, $comparison = null)\n {\n if ($pengguna instanceof Pengguna) {\n return $this\n ->addUsingAlias(MstWilayahPeer::KODE_WILAYAH, $pengguna->getKodeWilayah(), $comparison);\n } elseif ($pengguna instanceof PropelObjectCollection) {\n return $this\n ->usePenggunaQuery()\n ->filterByPrimaryKeys($pengguna->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByPengguna() only accepts arguments of type Pengguna or PropelCollection');\n }\n }",
"function KeyFilter() {\n\t\t$sKeyFilter = $this->SqlKeyFilter();\n\t\t$sKeyFilter = str_replace(\"@kode@\", ew_AdjustSql($this->kode->CurrentValue), $sKeyFilter); // Replace key value\n\t\treturn $sKeyFilter;\n\t}",
"function getDataItemByFilterKepatutan($conn,$nip,$aturan,$kepatutan,$kum,$statusp,$level_val,$refid,$fils, $default = \"default\"){\n\n if($default == \"filter\"){\n $table = \"v_kegiatandosenPAK3\";\n } else {\n $table = \"v_kegiatandosenPAK\";\n }\n\n $filter = \"\";\n if($statusp == \"P\"){ # Status Pengajuan => Proses / Masih diajukan\n $filter .= \" and k.refnourutakd is null \";\n\n $tgl = getTMT($conn,$nip);\n if($tgl){\n $filter .= \" and ( (CONVERT(VARCHAR(11),k.tglmulai,120))> '$tgl' ) \";\n }\n\n $rs_tugas = getRiwayatTugasBelajar($conn,$nip);\n if($rs_tugas and $kum != \"PL\"){ # ada tugas belajar & bukan penelitian\n foreach($rs_tugas as $tugas){\n $tglmulai = $tugas['tglmulai'];\n $tglselesai = $tugas['tglselesai'];\n $filter .= \" and ( (CONVERT(VARCHAR(11),k.tglmulai,120)) not between '$tglmulai' and '$tglselesai' )\";\n }\n }\n\n\n # filter by level\n if($level_val == \"A\"){ # level validasi -> Admin menggunakan data Pengajuan atau default\n $kreditfield = \"k.kredit\";\n $filter .= \" and (\n (\n k.valid != 2\n and k.validadmin !=2\n and k.validfakultas !=2\n and k.validinstitut !=2\n )\n or\n (\n k.valid is null\n or k.validadmin is null\n or k.validfakultas is null\n or k.validinstitut is null\n )\n ) \";\n }elseif($level_val == \"J\"){ # level validasi -> Jurusan menggunakan data Admin\n $kreditfield = \"k.kreditadmin\";\n $filter .=\"\";// \" and k.validadmin=1 \";\n }elseif($level_val == \"F\"){ # level validasi -> Fakultas menggunakan data Jurusan\n $kreditfield = \"k.kreditjurusan\";\n $filter .= \" \";//and k.valid=1 \";\n }elseif($level_val == \"I\"){ # level validasi -> Institut menggunakan data Fakultas\n $kreditfield = \"k.kreditfakultas\";\n $filter .= \" and k.validfakultas=1 \";\n }elseif($level_val == \"P\"){ # level validasi -> Pusat menggunakan data Institut\n $kreditfield = \"k.kreditinstitut\";\n $filter .= \" and k.validinstitut=1 \";\n }\n\n }elseif($statusp == \"S\"){ # Status Pengajuan => Setuju\n $filter .= \" and k.refnourutakd = $refid \";\n # filter by level\n if($level_val == \"D\"){ # level validasi -> Pengajuan atau default menggunakan data sama\n $kreditfield = \"k.kredit\";\n $filter .= \" and (\n (\n k.valid != 2\n and k.validadmin !=2\n and k.validfakultas !=2\n and k.validinstitut !=2\n )\n or\n (\n k.valid is null\n or k.validadmin is null\n or k.validfakultas is null\n or k.validinstitut is null\n )\n ) \";\n }elseif($level_val == \"A\"){ # level validasi -> Admin menggunakan data sama\n $kreditfield = \"k.kreditadmin\";\n $filter .=\"\";// \" and k.validadmin=1 \";\n }elseif($level_val == \"J\"){ # level validasi -> Jurusan menggunakan data sama\n $kreditfield = \"k.kreditjurusan\";\n $filter .= \" and k.valid=1 \";\n }elseif($level_val == \"F\"){ # level validasi -> Fakultas menggunakan data sama\n $kreditfield = \"k.kreditfakultas\";\n $filter .= \" and k.validfakultas=1 \";\n }elseif($level_val == \"I\"){ # level validasi -> Institut menggunakan data sama\n $kreditfield = \"k.kreditinstitut\";\n $filter .= \" and k.validinstitut=1 \";\n }elseif($level_val == \"P\"){ # level validasi -> Pusat menggunakan data sama\n $kreditfield = \"k.kreditinstitut\";\n $filter .= \" and k.validinstitut=1 \";\n }\n }\n\n if($kepatutan == \"tahun\"){ # tahun di tmt sk\n $filter .= \" and ( case when lower(semester) like '%gasal%' then left(right(semester,9),4)\n when lower(semester) like '%genap%' then right(semester,4)\n end = '$fils' ) \";\n }elseif($kepatutan == \"semester\"){ # semester di sk\n $filter .= \" and k.semester = '$fils' \";\n }else{\n $filter .=\" and k.iditem = $fils \";\n }\n\n $sql = \"select k.*, k.nosk, k.pejabatpenetap, (CONVERT(VARCHAR(11),k.tglmulai,120)) tmtsk, dbo.f_item(k.iditem) header\n from $table k\n /*left join sak_sk s on s.skid = k.skid */\n where k.idkegiatan = '$kum'\n and k.idaturan = $aturan\n and k.nip = '$nip'\n $filter \";\n /* tambahan rahmad */\n $sql .= \" and idpengajuan is not null \";\n /* end tambahan */\n\n // echo $sql;\n\n// dump($sql);\n $items = $conn->GetArray($sql); //echo $sql.\";<br/><br/>\";\n return $items;\n }",
"public function filterByIdKabkota($idKabkota = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($idKabkota)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $idKabkota)) {\n $idKabkota = str_replace('*', '%', $idKabkota);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(MstWilayahPeer::ID_KABKOTA, $idKabkota, $comparison);\n }",
"public function filterByMerk($merk = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($merk)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $merk)) {\n $merk = str_replace('*', '%', $merk);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(AngkutanPeer::MERK, $merk, $comparison);\n }",
"public function filterBySingkatan($singkatan = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($singkatan)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $singkatan)) {\n $singkatan = str_replace('*', '%', $singkatan);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(LembagaNonSekolahPeer::SINGKATAN, $singkatan, $comparison);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OneToMany (owning side) Remove FiscalizacaoAutorizacaoDocumento | public function removeFkFiscalizacaoAutorizacaoDocumentos(\Urbem\CoreBundle\Entity\Fiscalizacao\AutorizacaoDocumento $fkFiscalizacaoAutorizacaoDocumento)
{
$this->fkFiscalizacaoAutorizacaoDocumentos->removeElement($fkFiscalizacaoAutorizacaoDocumento);
} | [
"public function clearPermissaosRelatedByCoUsuarioAlteracao()\n\t{\n\t\t$this->collPermissaosRelatedByCoUsuarioAlteracao = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function removeFkFiscalizacaoAutenticacaoDocumentos(\\Urbem\\CoreBundle\\Entity\\Fiscalizacao\\AutenticacaoDocumento $fkFiscalizacaoAutenticacaoDocumento)\n {\n $this->fkFiscalizacaoAutenticacaoDocumentos->removeElement($fkFiscalizacaoAutenticacaoDocumento);\n }",
"public function disassociate_fiscal($id_contrato_fiscal)\n\t{\n\t $this->contratoFiscalRepository->find($id_contrato_fiscal)->delete();\n\t}",
"function eliminarRelacionProceso(){\n $this->objFunc=$this->create('MODObligacionPago');\n $this->res=$this->objFunc->eliminarRelacionProceso($this->objParam);\n $this->res->imprimirRespuesta($this->res->generarJson());\n }",
"private function removerOcorrenciaFalta() {\n\n $sSql = \" select ed301_sequencial \";\n $sSql .= \" from diarioclassealunofalta \";\n $sSql .= \" join diarioclasseregenciahorario on diarioclassealunofalta.ed301_diarioclasseregenciahorario = diarioclasseregenciahorario.ed302_sequencial \";\n $sSql .= \" where diarioclasseregenciahorario.ed302_regenciahorario = {$this->iCodigo} \";\n\n $sWhere = \" ed104_diarioclassealunofalta in ( {$sSql} ) \" ;\n $oDao = new cl_ocorrenciafalta();\n $oDao->excluir(null, $sWhere);\n\n if ($oDao->erro_status == 0) {\n throw new DBException( _M($this->sMessagens . \"erro_remover_ocorrencia\") );\n }\n\n return true;\n }",
"public function clearNotaPedidosRelatedByAdministraId()\n\t{\n\t\t$this->collNotaPedidosRelatedByAdministraId = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function disassociate_fiscal($id_contrato_fiscal)\n {\n try{\n\n $this->contratoService->disassociate_fiscal($id_contrato_fiscal);\n return response(['msg' => trans('alerts.registro.deleted'), 'status' => 'success']);\n\n }catch(Exception $e){\n\n return response(['msg' => trans('alerts.registro.deletedError'), 'detail' => $e->getMessage(), 'status' => 'error']);\n \n } \n }",
"final protected function eliminar(){\n\t\tif($this->sublinea != null){\n\t\t\tthrow new Exception('Sublinea sin datos');\n\t\t}\n\t\tDataAccess::delete($this->sublinea);\t\n\t}",
"public function eliminar_actuaciones($propietario) {\n \t\t\t$actuaciones=$propietario->getActuaciones();\n \t\t\tforeach($actuaciones as $actuacion){\n \t\t\t\t\t$actuacion->setUsuario();//Ponemos a null\n \t\t\t\t\t$propietario->removeActuacione($actuacion);\n \t\t\t\t\t\n \t\t\t\t$this->em->persist($actuacion);\n \t\t\t\t$this->em->persist($propietario);\n \t\t\t\t$this->em->flush();\n \t\t\t}\t\n\t }",
"public function clearHbfTurnossRelatedByIdAsociado()\n {\n $this->collHbfTurnossRelatedByIdAsociado = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function excluir($numeroNotaFiscal, $serie, $idFornecedor);",
"public function clearNotaPedidosRelatedByControlaId()\n\t{\n\t\t$this->collNotaPedidosRelatedByControlaId = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"final protected function eliminar() {\n if ($this -> dependencia != null) {\n throw new Exception('Dependencia sin datos');\n }\n DataAccess::delete($this -> dependencia);\n }",
"public function deleteExpendablesRelationship(){\n\n $expendables = $this->expendables()->get();\n\n foreach ($expendables as $expendable) {\n $expendable->setWardrobeidNull();\n }\n }",
"public function clearUsuarioAmigosRelatedByIdusuario()\n {\n $this->collUsuarioAmigosRelatedByIdusuario = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function isRemoveFromRelationship();",
"public function clearAmistadsRelatedById_usuario()\n\t{\n\t\t$this->collAmistadsRelatedById_usuario = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearNotificacionsRelatedById_emisor()\n\t{\n\t\t$this->collNotificacionsRelatedById_emisor = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"final protected function eliminar(){\n\t\tif($this -> empresa != null){\n\t\t\tthrow new Exception('Empresa sin datos');\n\t\t}\n\t\tDataAccess::delete($this -> empresa);\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if current page is a user profile edit page | function bbp_is_single_user_edit()
{
} | [
"protected function is_profile_page() {\n\t\tglobal $pagenow;\n\n\t\treturn $pagenow === 'profile.php' || $pagenow === 'user-new.php' || $pagenow === 'user-edit.php';\n\t}",
"function um_can_edit_my_profile() {\r\n\tif (!is_user_logged_in()) return false;\r\n\tif (!um_user( 'can_edit_profile' )) return false;\r\n\r\n\treturn true;\r\n}",
"function tc_edit_permission_check() {\n global $current_user, $profileuser;\n \n $screen = get_current_screen();\n \n get_currentuserinfo();\n \n if( ! is_super_admin( $current_user->ID ) && in_array( $screen->base, array( 'user-edit', 'user-edit-network' ) ) ) { // editing a user profile\n if ( is_super_admin( $profileuser->ID ) ) { // trying to edit a superadmin while less than a superadmin\n wp_die( __( 'You do not have permission to edit this user.' ) );\n } elseif ( ! ( is_user_member_of_blog( $profileuser->ID, get_current_blog_id() ) && is_user_member_of_blog( $current_user->ID, get_current_blog_id() ) )) { // editing user and edited user aren't members of the same blog\n wp_die( __( 'You do not have permission to edit this user.' ) );\n }\n }\n \n}",
"protected function is_edit_page() {\n\t\treturn false;\n\t}",
"public function is_edit_page() {\n\t\t\tglobal $pagenow;\n\t\t\treturn( $pagenow == 'edit-tags.php' );\n\t\t}",
"protected function _canDisplayProfileEditTab()\n {\n return $this->getGridModel()\n ->checkUserActionPermission(BL_CustomGrid_Model_Grid_Sentry::ACTION_EDIT_PROFILES);\n }",
"function is_edit_page() {\r\n\t\t\tglobal $pagenow;\r\n\t\t\tif (in_array($pagenow, array('post.php', 'post-new.php'))) return true;\r\n\t\t\treturn false;\r\n\t\t}",
"function is_edit_page() {\n\t\tglobal $pagenow;\n\t\tif (in_array($pagenow, array('post.php', 'post-new.php'))) return true;\n\t\treturn false;\n\t}",
"function IsEditPage($arg = '') {\n global $pagenow;\n if (!is_admin())\n return false;\n\n if ($arg == 'edit')\n return in_array($pagenow, array('post.php'));\n elseif ($arg == 'new')\n return in_array($pagenow, array('post-new.php'));\n else\n return in_array($pagenow, array('post.php', 'post-new.php'));\n }",
"public function can_edit_profile() {\n return false;\n }",
"function can_edit_profile() {\n return false;\n }",
"function hasEditPage() {\n\t\treturn $this->_link_edit_page;\n\t}",
"function osc_is_edit_page() {\n $location = Rewrite::newInstance()->get_location();\n $section = Rewrite::newInstance()->get_section();\n if($location=='item' && $section=='item_edit') {\n return true;\n }\n return false;\n }",
"public function hasEditAccess() { \n\t\t\n\t\t// any twitter handle in gods will get access to all pages\n\t\t$gods = array('jenrobinson','rochers','clustertruck', 'hkatalin2006');\n\t\t\n\t\tif (!isset($_GET['asUser']) && $this->loged && (in_array($this->user['name'],$gods) || strtolower($this->user['name']) == strtolower($this->truck['twitter']))) { \n\t\t\treturn true;\n\t\t}\n\t\t\n\t}",
"protected function check_user_to_edit() {\n\n if ( $this->ure_object ==='user' ) {\n if ( !isset($_REQUEST['user_id'] ) ) {\n return false; // user_id value is missed\n }\n $user_id = filter_var( $_REQUEST['user_id'], FILTER_VALIDATE_INT ); \n if ( empty( $user_id ) ) {\n return false;\n }\n $this->user_to_edit = get_user_to_edit( $user_id );\n if ( empty( $this->user_to_edit ) ) {\n return false;\n }\n \n }\n \n return true;\n }",
"function appthemes_get_edit_profile_url() {\n\tif ( $page_id = APP_User_Profile::get_id() ) {\n\t\treturn get_permalink( $page_id );\n\t}\n\n\treturn get_edit_profile_url( get_current_user_id() );\n}",
"public static function is_edit_screen() {\n\t\t$is_edit_screen = isset( $_GET[ Main::EDIT_FLAG ] ) || Post_Type::is_notification();\n\n\t\treturn apply_filters( 'tcb_is_notifications_edit_screen', $is_edit_screen );\n\t}",
"function b2c_edit_profile() {\n\t\n\t// Check to see if user was requesting the edit_profile page, if so redirect to B2C\n\t$pagename = $_SERVER['REQUEST_URI'];\n\t$parts = explode('/', $pagename);\n\t$len = count($parts);\n\tif ($len > 1 && $parts[$len-2] == \"wp-admin\" && $parts[$len-1] == \"profile.php\") {\n\t\t\n\t\t// Return URL for edit_profile endpoint\n\t\ttry {\n\t\t\t$b2c_endpoint_handler = new B2C_Endpoint_Handler(B2C_Settings::$edit_profile_policy);\n\t\t\t$authorization_endpoint = $b2c_endpoint_handler->get_authorization_endpoint().'&state=edit_profile';\n\t\t\twp_redirect($authorization_endpoint);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\techo $e->getMessage();\n\t\t}\n\t\texit;\n\t}\n}",
"function xrc_user_load_edit()\r\n{\r\n $user = wp_get_current_user();\r\n \r\n // allow admins to see everything\r\n if( in_array( 'administrator', $user->roles ) ) return;\r\n \r\n $post_type = isset( $_GET['post_type'] ) ? $_GET['post_type'] : 'post';\r\n \r\n if( 'page' != $post_type ) return;\r\n \r\n add_filter( 'parse_query', 'xrc_user_parse_query' );\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for postStreamFileAppConfig Adds the specified Stream File configuration. | public function testPostStreamFileAppConfig()
{
} | [
"public function testPutStreamFileAppConfig()\n {\n\n }",
"public function testPutStreamFileConfig()\n {\n\n }",
"protected function deleteStreamFileAppConfigRequest($server_name, $vhost_name, $streamfile_name, $app_name)\n {\n // verify the required parameter 'server_name' is set\n if ($server_name === null || (is_array($server_name) && count($server_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_name when calling deleteStreamFileAppConfig'\n );\n }\n // verify the required parameter 'vhost_name' is set\n if ($vhost_name === null || (is_array($vhost_name) && count($vhost_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vhost_name when calling deleteStreamFileAppConfig'\n );\n }\n // verify the required parameter 'streamfile_name' is set\n if ($streamfile_name === null || (is_array($streamfile_name) && count($streamfile_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $streamfile_name when calling deleteStreamFileAppConfig'\n );\n }\n // verify the required parameter 'app_name' is set\n if ($app_name === null || (is_array($app_name) && count($app_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $app_name when calling deleteStreamFileAppConfig'\n );\n }\n\n $resourcePath = '/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/streamfiles/{streamfileName}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($server_name !== null) {\n $resourcePath = str_replace(\n '{' . 'serverName' . '}',\n ObjectSerializer::toPathValue($server_name),\n $resourcePath\n );\n }\n // path params\n if ($vhost_name !== null) {\n $resourcePath = str_replace(\n '{' . 'vhostName' . '}',\n ObjectSerializer::toPathValue($vhost_name),\n $resourcePath\n );\n }\n // path params\n if ($streamfile_name !== null) {\n $resourcePath = str_replace(\n '{' . 'streamfileName' . '}',\n ObjectSerializer::toPathValue($streamfile_name),\n $resourcePath\n );\n }\n // path params\n if ($app_name !== null) {\n $resourcePath = str_replace(\n '{' . 'appName' . '}',\n ObjectSerializer::toPathValue($app_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'text/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'text/xml', 'application/json'],\n ['application/xml', 'text/xml', 'application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function publishConfigFiles()\n {\n try {\n $this->filePublisher->publish(resource_path('stubs/config'), $this->configPath());\n } catch (\\Exception $e) {\n throw new PorterSetupFailed('Failed publishing the container configuration files');\n }\n }",
"public function test_fileContainerCreateChangeStreamPostFileContainersChangeStream() {\n\n }",
"protected function getStreamFileAppConfigRequest($server_name, $vhost_name, $streamfile_name, $app_name)\n {\n // verify the required parameter 'server_name' is set\n if ($server_name === null || (is_array($server_name) && count($server_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_name when calling getStreamFileAppConfig'\n );\n }\n // verify the required parameter 'vhost_name' is set\n if ($vhost_name === null || (is_array($vhost_name) && count($vhost_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vhost_name when calling getStreamFileAppConfig'\n );\n }\n // verify the required parameter 'streamfile_name' is set\n if ($streamfile_name === null || (is_array($streamfile_name) && count($streamfile_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $streamfile_name when calling getStreamFileAppConfig'\n );\n }\n // verify the required parameter 'app_name' is set\n if ($app_name === null || (is_array($app_name) && count($app_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $app_name when calling getStreamFileAppConfig'\n );\n }\n\n $resourcePath = '/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/streamfiles/{streamfileName}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($server_name !== null) {\n $resourcePath = str_replace(\n '{' . 'serverName' . '}',\n ObjectSerializer::toPathValue($server_name),\n $resourcePath\n );\n }\n // path params\n if ($vhost_name !== null) {\n $resourcePath = str_replace(\n '{' . 'vhostName' . '}',\n ObjectSerializer::toPathValue($vhost_name),\n $resourcePath\n );\n }\n // path params\n if ($streamfile_name !== null) {\n $resourcePath = str_replace(\n '{' . 'streamfileName' . '}',\n ObjectSerializer::toPathValue($streamfile_name),\n $resourcePath\n );\n }\n // path params\n if ($app_name !== null) {\n $resourcePath = str_replace(\n '{' . 'appName' . '}',\n ObjectSerializer::toPathValue($app_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'text/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'text/xml', 'application/json'],\n ['application/xml', 'text/xml', 'application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testPostPushPublishStreamAppConfig()\n {\n\n }",
"protected function registerStreamHandlers()\n {\n $handlers = $this->getConfig()->get('stream_handlers', null, array());\n if (!is_array($handlers)) {\n throw new ConfigException('Invalid stream_handlers configuration', E_USER_ERROR);\n }\n\n $defaultStreamContext = array();\n foreach ($handlers as $protocol => $handler) {\n if (isset($handler['class'])) {\n try {\n $flags = isset($handler['local']) ? !empty($handler['local']) : STREAM_IS_URL;\n if (isset($handler['register_callback']) && is_callable($handler['register_callback'])) {\n $registered = $handler['register_callback']($protocol, $handler);\n } else {\n if (in_array($protocol, stream_get_wrappers())) {\n stream_wrapper_unregister($protocol);\n }\n $registered = stream_register_wrapper($protocol, $handler['class'], $flags);\n }\n if (isset($handler['options']) && is_array($handler['options'])) {\n $defaultStreamContext[$protocol] = $handler['options'];\n }\n } catch (\\Exception $e) {\n throw new ConfigException(\"Error registering stream_handler {$handler['class']} ({$protocol}://)\", E_USER_ERROR, $e);\n }\n if (!$registered) {\n throw new ConfigException(\"Could not register stream_handler {$handler['class']} ({$protocol}://)\", E_USER_ERROR);\n }\n } else {\n throw new ConfigException(\"Invalid stream_handler configuration for protocol {$protocol}\", E_USER_ERROR);\n }\n }\n\n $this->streamContext = stream_context_set_default($defaultStreamContext);\n }",
"protected function putStreamFileAppConfigAdvRequest($server_name, $vhost_name, $streamfile_name, $app_name, $body)\n {\n // verify the required parameter 'server_name' is set\n if ($server_name === null || (is_array($server_name) && count($server_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_name when calling putStreamFileAppConfigAdv'\n );\n }\n // verify the required parameter 'vhost_name' is set\n if ($vhost_name === null || (is_array($vhost_name) && count($vhost_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vhost_name when calling putStreamFileAppConfigAdv'\n );\n }\n // verify the required parameter 'streamfile_name' is set\n if ($streamfile_name === null || (is_array($streamfile_name) && count($streamfile_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $streamfile_name when calling putStreamFileAppConfigAdv'\n );\n }\n // verify the required parameter 'app_name' is set\n if ($app_name === null || (is_array($app_name) && count($app_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $app_name when calling putStreamFileAppConfigAdv'\n );\n }\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling putStreamFileAppConfigAdv'\n );\n }\n\n $resourcePath = '/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/streamfiles/{streamfileName}/adv';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($server_name !== null) {\n $resourcePath = str_replace(\n '{' . 'serverName' . '}',\n ObjectSerializer::toPathValue($server_name),\n $resourcePath\n );\n }\n // path params\n if ($vhost_name !== null) {\n $resourcePath = str_replace(\n '{' . 'vhostName' . '}',\n ObjectSerializer::toPathValue($vhost_name),\n $resourcePath\n );\n }\n // path params\n if ($streamfile_name !== null) {\n $resourcePath = str_replace(\n '{' . 'streamfileName' . '}',\n ObjectSerializer::toPathValue($streamfile_name),\n $resourcePath\n );\n }\n // path params\n if ($app_name !== null) {\n $resourcePath = str_replace(\n '{' . 'appName' . '}',\n ObjectSerializer::toPathValue($app_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'text/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'text/xml', 'application/json'],\n ['application/xml', 'text/xml', 'application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function postStartupStreamConfigRequest($server_name, $vhost_name, $stream_name, $app_name, $instance_name, $body)\n {\n // verify the required parameter 'server_name' is set\n if ($server_name === null || (is_array($server_name) && count($server_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_name when calling postStartupStreamConfig'\n );\n }\n // verify the required parameter 'vhost_name' is set\n if ($vhost_name === null || (is_array($vhost_name) && count($vhost_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vhost_name when calling postStartupStreamConfig'\n );\n }\n // verify the required parameter 'stream_name' is set\n if ($stream_name === null || (is_array($stream_name) && count($stream_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $stream_name when calling postStartupStreamConfig'\n );\n }\n // verify the required parameter 'app_name' is set\n if ($app_name === null || (is_array($app_name) && count($app_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $app_name when calling postStartupStreamConfig'\n );\n }\n // verify the required parameter 'instance_name' is set\n if ($instance_name === null || (is_array($instance_name) && count($instance_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $instance_name when calling postStartupStreamConfig'\n );\n }\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling postStartupStreamConfig'\n );\n }\n\n $resourcePath = '/v2/servers/{serverName}/vhosts/{vhostName}/startupstreams/applications/{appName}/instances/{instanceName}/streams/{streamName}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($server_name !== null) {\n $resourcePath = str_replace(\n '{' . 'serverName' . '}',\n ObjectSerializer::toPathValue($server_name),\n $resourcePath\n );\n }\n // path params\n if ($vhost_name !== null) {\n $resourcePath = str_replace(\n '{' . 'vhostName' . '}',\n ObjectSerializer::toPathValue($vhost_name),\n $resourcePath\n );\n }\n // path params\n if ($stream_name !== null) {\n $resourcePath = str_replace(\n '{' . 'streamName' . '}',\n ObjectSerializer::toPathValue($stream_name),\n $resourcePath\n );\n }\n // path params\n if ($app_name !== null) {\n $resourcePath = str_replace(\n '{' . 'appName' . '}',\n ObjectSerializer::toPathValue($app_name),\n $resourcePath\n );\n }\n // path params\n if ($instance_name !== null) {\n $resourcePath = str_replace(\n '{' . 'instanceName' . '}',\n ObjectSerializer::toPathValue($instance_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'text/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'text/xml', 'application/json'],\n ['application/xml', 'text/xml', 'application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testPostSMILFileAppConfig()\n {\n\n }",
"protected function postStreamFilesAppConfigRequest($server_name, $vhost_name, $app_name, $body)\n {\n // verify the required parameter 'server_name' is set\n if ($server_name === null || (is_array($server_name) && count($server_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_name when calling postStreamFilesAppConfig'\n );\n }\n // verify the required parameter 'vhost_name' is set\n if ($vhost_name === null || (is_array($vhost_name) && count($vhost_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vhost_name when calling postStreamFilesAppConfig'\n );\n }\n // verify the required parameter 'app_name' is set\n if ($app_name === null || (is_array($app_name) && count($app_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $app_name when calling postStreamFilesAppConfig'\n );\n }\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling postStreamFilesAppConfig'\n );\n }\n\n $resourcePath = '/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/streamfiles';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($server_name !== null) {\n $resourcePath = str_replace(\n '{' . 'serverName' . '}',\n ObjectSerializer::toPathValue($server_name),\n $resourcePath\n );\n }\n // path params\n if ($vhost_name !== null) {\n $resourcePath = str_replace(\n '{' . 'vhostName' . '}',\n ObjectSerializer::toPathValue($vhost_name),\n $resourcePath\n );\n }\n // path params\n if ($app_name !== null) {\n $resourcePath = str_replace(\n '{' . 'appName' . '}',\n ObjectSerializer::toPathValue($app_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'text/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'text/xml', 'application/json'],\n ['application/xml', 'text/xml', 'application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function registerStream()\n {\n AspectPHP_Stream::register();\n \n }",
"public function configure_upload($config) {\n\t\t\n\t}",
"public function publishConfigsTo($files, $directory, $tag = 'config');",
"public function testConfigureStreamWithoutFileFails()\n {\n $extension = new LogExtension(array(\n 'channels' => array(\n 'default' => array(\n 'handler' => 'stream',\n ),\n ),\n ));\n\n $this->setExpectedException('RuntimeException', 'The option \"file\" must be specified for the stream handler.');\n\n $container = new ContainerBuilder();\n $extension->load(array(), $container);\n }",
"protected function putStreamFileConfigAdvRequest($server_name, $vhost_name, $streamfile_name, $body)\n {\n // verify the required parameter 'server_name' is set\n if ($server_name === null || (is_array($server_name) && count($server_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_name when calling putStreamFileConfigAdv'\n );\n }\n // verify the required parameter 'vhost_name' is set\n if ($vhost_name === null || (is_array($vhost_name) && count($vhost_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vhost_name when calling putStreamFileConfigAdv'\n );\n }\n // verify the required parameter 'streamfile_name' is set\n if ($streamfile_name === null || (is_array($streamfile_name) && count($streamfile_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $streamfile_name when calling putStreamFileConfigAdv'\n );\n }\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling putStreamFileConfigAdv'\n );\n }\n\n $resourcePath = '/v2/servers/{serverName}/vhosts/{vhostName}/streamfiles/{streamfileName}/adv';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($server_name !== null) {\n $resourcePath = str_replace(\n '{' . 'serverName' . '}',\n ObjectSerializer::toPathValue($server_name),\n $resourcePath\n );\n }\n // path params\n if ($vhost_name !== null) {\n $resourcePath = str_replace(\n '{' . 'vhostName' . '}',\n ObjectSerializer::toPathValue($vhost_name),\n $resourcePath\n );\n }\n // path params\n if ($streamfile_name !== null) {\n $resourcePath = str_replace(\n '{' . 'streamfileName' . '}',\n ObjectSerializer::toPathValue($streamfile_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'text/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'text/xml', 'application/json'],\n ['application/xml', 'text/xml', 'application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function postStreamFilesConfigRequest($server_name, $vhost_name, $body)\n {\n // verify the required parameter 'server_name' is set\n if ($server_name === null || (is_array($server_name) && count($server_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_name when calling postStreamFilesConfig'\n );\n }\n // verify the required parameter 'vhost_name' is set\n if ($vhost_name === null || (is_array($vhost_name) && count($vhost_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vhost_name when calling postStreamFilesConfig'\n );\n }\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling postStreamFilesConfig'\n );\n }\n\n $resourcePath = '/v2/servers/{serverName}/vhosts/{vhostName}/streamfiles';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($server_name !== null) {\n $resourcePath = str_replace(\n '{' . 'serverName' . '}',\n ObjectSerializer::toPathValue($server_name),\n $resourcePath\n );\n }\n // path params\n if ($vhost_name !== null) {\n $resourcePath = str_replace(\n '{' . 'vhostName' . '}',\n ObjectSerializer::toPathValue($vhost_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'text/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'text/xml', 'application/json'],\n ['application/xml', 'text/xml', 'application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function publishConfig(): void\n {\n $this->publishes([\n $this->configFilePath() => config_path(\"{$this->packageName()}.php\")\n ], $this->getPublishTag('config'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get number of __relevant__ documents that were found for this query in this run. Different metrics need different values, so calculate number of relevant documents up to different ranks. | private function countRelevantDocumentsForRanks($query, $run, $relevant_total, $relevant_limited) {
// Total number of relevant documents found in the whole run
$relevant_docs_in_run = $this->sr_repo
->findRelevantDocsForQueryInRun($query, $run)[0]['docs'];
// Number of relevant document found up to the limit as defined in Metrics::getMaximumLengthResultList()
$relevant_docs_up_to_rank_limit = $this->sr_repo
->findRelevantDocsForQueryInRun($query, $run, Metrics::getMaximumLengthResultList())[0]['docs'];
// Number of relevant documents found up to the rank that corresponds to the total number of relevant
// documents found for this run
$relevant_docs_up_to_rank_relevant_total = $this->sr_repo
->findRelevantDocsForQueryInRun($query, $run, $relevant_total)[0]['docs'];
// Number of relevant documents found up to the rank that corresponds to the limited number of relevant
// documents found for this run (may be equal to relevant_total)
$relevant_docs_up_to_rank_relevant_limited = $this->sr_repo
->findRelevantDocsForQueryInRun($query, $run, $relevant_limited)[0]['docs'];
return array('relevant_docs_in_run' => $relevant_docs_in_run,
'relevant_docs_up_to_rank_limit' => $relevant_docs_up_to_rank_limit,
'relevant_docs_up_to_rank_relevant_total' => $relevant_docs_up_to_rank_relevant_total,
'relevant_docs_up_to_rank_relevant_limited' => $relevant_docs_up_to_rank_relevant_limited
);
} | [
"private function countRelevantDocuments($query, $rating_levels)\n {\n $relevant_documents = array();\n /**\n * @var $level RatingOption\n */\n foreach ($rating_levels as $level) {\n $relevant_documents[] = $this->as_repo->findRelevant($query, $level->getName());\n }\n $relevant_docs_for_query = $this->metrics->totalRelevantDocs($relevant_documents);\n $relevant_total = $relevant_docs_for_query;\n $relevant_limited = $relevant_docs_for_query;\n if (Metrics::getLimitedResultList() && $relevant_docs_for_query > Metrics::getMaximumLengthResultList())\n $relevant_limited = Metrics::getMaximumLengthResultList();\n\n return array('relevant_total' => $relevant_total, 'relevant_limited' => $relevant_limited);\n }",
"public function count_nb_documents_to_be_indexed() {\n\n\t\treturn $this->index_data( 0, null );\n\n\t}",
"public function countOwnDocuments() {\n return $this->getAttributesDocuments(false, false, true);\n }",
"public function numDocs()\n {\n $counts = $this->getCounts();\n return $counts->{'database-counts'}->{'count-properties'}->documents->value;\n }",
"public function getNumberOfDocumentsFound()\n {\n return $this->searchResultCollection->getNumFound();\n }",
"public function count()\n {\n return count($this->documents);\n }",
"public function documentCount(): int\n {\n return $this->indexable->getIndexingQuery()->count();\n }",
"public static function getTotalDocuments()\n {\n //db\n $db = Factory::getDb();\n $query = $db->getQuery(true);\n\n //select\n $query->select(\"count(*)\");\n $query->from(\"#__documents AS d\");\n\n //filter depending on user access\n $role = UsersHelper::getRole();\n $user_id = UsersHelper::getUserId();\n $team_id = UsersHelper::getTeamId();\n if ($role != 'exec') {\n if ($role == 'manager') {\n $query->join('inner','#__users AS u ON d.owner_id = u.id');\n $query->where('u.team_id='.$team_id);\n } else {\n $query->where(array(\"d.owner_id=\".$user_id,'d.shared=1'),'OR');\n }\n }\n\n //return count\n $db->setQuery($query);\n $result = $db->loadResult();\n\n return $result;\n }",
"public function count()\n {\n return count($this->_docs);\n }",
"public function Count() \r\n\t{\r\n\t\t$i = 0;\r\n\t\tforeach (array_keys($this->arr_search_object) as $k) {\r\n\t\t\tif ($this->arr_search_object[$k] instanceof ConceptSearchTermCollection) {\r\n\t\t\t\t$i += $this->arr_search_object[$k]->Count();\r\n\t\t\t} else {\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $i;\r\n\t}",
"public function getSharedDocumentCount() {\n $this->getSharedDocuments();\n return count($this->sharedCollection);\n }",
"public function getTotalDocs()\n {\n $labelMapper = $this->db->mapper('Documer\\Entity\\Label');\n\n return count($labelMapper->all());\n }",
"public function getTotalDocs()\n {\n return count($this->labels);\n }",
"public function getNumFound()\n {\n return $this->numberOfFoundDocuments;\n }",
"public function getActiveDocumentCount(){\r\n\t\treturn intval($this->indexStats->numDocs);\r\n\t}",
"function getDocumentCount() {\n\t\treturn $this->currentIndex->numDocs();\n\t}",
"public function documentCountAction() {\r\n $this->checkUserPermission(\"documents\");\r\n\r\n $condition = urldecode($this->getParam(\"condition\"));\r\n $groupBy = $this->getParam(\"groupBy\");\r\n $params = array();\r\n\r\n if (!empty($condition)) $params[\"condition\"] = $condition;\r\n if (!empty($groupBy)) $params[\"groupBy\"] = $groupBy;\r\n\r\n\r\n $count = Document::getTotalCount($params);\r\n\r\n $this->encoder->encode(array(\"success\" => true, \"data\" => array(\"totalCount\" => $count)));\r\n }",
"function vu_rp_workbench_get_needs_review_count() {\n $query = db_select('field_revision_field_rpa_staff_id', 'rp');\n $query->leftJoin('workbench_moderation_node_history', 'wm', \"rp.entity_id = wm.nid\");\n $query->distinct()->addField('rp', 'entity_id', 'entity_id');\n $query->condition('wm.is_current', 1, '=');\n $query->condition('wm.state', 'needs_review', '=');\n $result = $query->countQuery()->execute()->fetchField();\n\n return $result;\n}",
"abstract public function getIndexCount(Document $collection): int;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CountNewInInbox Count New Messages In Spam | function CountNewInSpam () {
global $zFOCUSUSER;
$NotificationTable = $this->messageNotification->TableName;
$InformationTable = $this->messageInformation->TableName;
// Count notifications.
$query = "SELECT COUNT($NotificationTable.tID) " .
"AS CountResult " .
"FROM $NotificationTable " .
"WHERE $NotificationTable.Standing = " . MESSAGE_UNREAD . " " .
"AND $NotificationTable.Location = " . FOLDER_SPAM . " " .
"AND userAuth_uID = " . $zFOCUSUSER->uID;
$this->Query ($query);
$this->FetchArray();
$total = $this->CountResult;
// Count stored messages.
$query = "SELECT COUNT($InformationTable.tID) " .
"AS CountResult " .
"FROM $InformationTable " .
"WHERE $InformationTable.Standing = " . MESSAGE_UNREAD . " " .
"AND $InformationTable.Location = " . FOLDER_SPAM . " " .
"AND userAuth_uID = " . $zFOCUSUSER->uID;
$this->Query ($query);
$this->FetchArray();
// Add for total.
$total += $this->CountResult;
return ($total);
} | [
"public function recalculateInboxCounter(): void;",
"public function count_messages(){\n\n\t\t$check = imap_check($this->inbox);\n\t\treturn $this->email_count = $check->Nmsgs;\n\n\t}",
"public function testGetInboxCount()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function getMessageCountNew(){\r\n if($this->user_id){\r\n return $message_notifications = count(Message::getReceivedByMemberId($this->user_id, 'new'));\r\n }else{\r\n return 0;\r\n }\r\n }",
"public static function getCountOfNewMessage()\n {\n return intval(self::find()\n ->where([\n 'recipient_id' => Yii::$app->user->id,\n 'status' => Message::STATUS_NEW,\n ])\n ->count());\n }",
"private function updateMsgCount() {\n\t\t\t$sql = new SQL();\n\t\t\t$db_query = \"SELECT * FROM \".$sql->prefix.\"UserMsg WHERE to_u=\".$this->userId.\" AND unread=true\";\n\t\t\t$this->unreadMsg = $sql->getCount($db_query);\n\t\t}",
"function erNewCount() {\n global $IMAP;\n\n $msgs = imap_search($IMAP, \"UNSEEN\");\n if (!$msgs) {\n $msgs = array();\n }\n return $msgs;\n}",
"public function testGetInboxEmailCount()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function newMessagesCount()\n {\n return count($this->threadsWithNewMessages());\n }",
"public static function count_message()\n {\n return ContactUs::where('seen',false)->count();\n }",
"private function getCountOfMessages(){\n\t\t\n\t\t$ipAddress = (isset($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : '';\n\t\t$database = new Database;\n\t\t$query = $database->getCount('message_queues', \n\t\t\t\t\t\t\t\t\t \" ip_address='$ipAddress' AND DATE(`created_at`) = CURDATE() \");\n\t\t$exec = $database->query($query);\n\t\tif ($exec) {\n\t\t\t$row = $database->fetchArray($exec);\n\t\t\treturn $row['count'];\n\t\t}\n\n\t\treturn 0;\n\t}",
"public function count()\n {\n $this->init();\n\n return imap_num_msg($this->connection->getResource());\n }",
"public function getTotalMessages(): int;",
"public static function unread_message_count() {\n\t\t$db = instance(':db');\n\t\t$sql = instance(':sel-sql');\n\t\t\n\t\t$query = $db->prepare($sql->getUnreadMessageCount);\n\t\t$query->execute(array('id' => UserSession::userid()));\n\t\t$query->setFetchMode(\\PDO::FETCH_OBJ);\n\t\t$result = $query->fetch();\n\t\treturn ($result->messageCount > 0)?$result->messageCount:'';\n\t}",
"public static function count()\n {\n return count(Session::instance()->get('messages'));\n }",
"function CountNewInFolders () {\n\n global $gFOLDERSELECT, $gFOLDERCOUNT;\n global $zFOCUSUSER;\n\n // Set the folder highlighting to 'normal' by default.\n $gFOLDERSELECT['INBOX'] = 'normal'; $gFOLDERSELECT['SENT'] = 'normal';\n $gFOLDERSELECT['DRAFTS'] = 'normal'; $gFOLDERSELECT['ALL'] = 'normal';\n $gFOLDERSELECT['SPAM'] = 'normal'; $gFOLDERSELECT['TRASH'] = 'normal';\n\n // Count the number of new messages in Inbox.\n $inboxcount = $this->CountNewInInbox ();\n if ($inboxcount == 0) {\n $gFOLDERCOUNT['INBOX'] = '';\n } else {\n $gFOLDERCOUNT['INBOX'] = '(' . $inboxcount . ')';\n } // if\n\n // Count the number of new messages in Spam.\n $spamcount = $this->CountNewInSpam ();\n if ($spamcount == 0) {\n $gFOLDERCOUNT['SPAM'] = '';\n } else {\n $gFOLDERCOUNT['SPAM'] = '(' . $spamcount . ')';\n } // if\n\n // Count the number of new messages in Drafts.\n $draftscount = $this->CountNewInDrafts ();\n if ($draftscount == 0) {\n $gFOLDERCOUNT['DRAFTS'] = '';\n } else {\n $gFOLDERCOUNT['DRAFTS'] = '(' . $draftscount . ')';\n } // if\n \n // Count the number of new messages in Trash.\n $trashcount = $this->CountNewInTrash ();\n if ($trashcount == 0) {\n $gFOLDERCOUNT['TRASH'] = '';\n } else {\n $gFOLDERCOUNT['TRASH'] = '(' . $trashcount . ')';\n } // if\n\n }",
"function imap_message_count($mailbox)\r\n {\r\n if ($header = imap_check($mailbox)) \r\n return $header->Nmsgs;\r\n else\r\n return 0;\r\n }",
"public function messageCount()\n {\n return imap_num_msg($this->mailBox);\n }",
"public function mailCount()\n {\n #$checkTime = time();\n $check = imap_check($this->_c);\n if ($errors = imap_errors()) {\n die(print_r($errors, true));\n }\n $checkCount = isset($check->Nmsgs) ? $check->Nmsgs : 0;\n #$checkTime = time() - $checkTime;\n\n if ($checkCount) {\n return intval($checkCount);\n }\n\n #$infoTime = time();\n $info = imap_mailboxmsginfo($this->_c);\n $infoCount = isset($info->Nmsgs) ? $info->Nmsgs : 0;\n #$infoTime = time() - $infoTime;\n\n #echo \">>> mailCount: check({$checkCount},{$checkTime}s) info({$infoCount},{$infoTime}s)\\n\";\n\n return intval($infoCount);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete file from supervision_file_specialisation | public function deleteSpecialisation($request)
{
$file = DB::table('supervision_file_specialisation')
->where('id', '=', $request->id)
->first();
$current_file_path = base_path('/public/' . $file->path_to_file);
\File::delete($current_file_path);
DB::table('supervision_file_specialisation')
->where('id', '=', $request->id)
->delete();
return (new \Illuminate\Http\Response)->setStatusCode(200, 'Supervisor specialisation successfully deleted.');
} | [
"public function removeFile();",
"public function deleteFile()\n { \n StorageService::deleteFile($this);\n }",
"public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }",
"protected function removeFile()\n {\n }",
"public function delete()\n {\n parent::delete();\n Storage::delete($this->filepath);\n }",
"private function do_delete()\n\t{\n\n\t\t$this->checkLoggedIn();\n\t\tlist($file_url, $pathFile, $file) = $this->getFileParamsFromPost();\n\n\t\t$fileMarkdown = $file . CONTENT_EXT;\n\n\t\tif( file_exists(CONTENT_DIR . $pathFile . $fileMarkdown ) ) {\n\t\t\t\tdie( unlink(CONTENT_DIR . $pathFile . $fileMarkdown) );\n\t\t}\n\t\telse {\n\t\t\t// Delete asset file\n\t\t\tif( is_file($file_url)) {\n\t\t\t\tunlink($file_url);\n\t\t\t\t\t// Update meta.php\n\t\t\t\t$path = str_replace($file, '', $file_url);\n\t\t\t\tif( file_exists($path . 'meta.php') ) {\n\t\t\t\t\t$meta = array();\n\t\t\t\t\tinclude($path . 'meta.php');\n\n\t\t\t\t\tif( array_key_exists($file, $meta)) {\n\t\t\t\t\t\t$attributes = $meta[$filenameOld];\n\t\t\t\t\t\tunset($meta[$file]);\n\t\t\t\t\t\tfile_put_contents($path . 'meta.php', '<?php $meta = ' . var_export($meta, true) . ';');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t// Delete thumb file\n\t\t\t\tif ( file_exists($path . '/thumbs' . $file) ) {\n\t\t\t\t\tunlink($path . '/thumbs' . $file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdie();\n\t}",
"public function delete($file);",
"function unsaveUploadedFile() {\n\t\twfSuppressWarnings();\n\t\t$success = unlink( $this->mUploadTempName );\n\t\twfRestoreWarnings();\n\t\tif ( ! $success ) {\n\t\t\t$wgOut->fileDeleteError( $this->mUploadTempName );\n\t\t}\n\t}",
"private function deletePhotoFile() {\n\t\tglobal $system;\n\n\t\ttry {\n\t\t\t$file_extensions = $system->getImageFileExtensions ();\n\n\t\t\t$file_name_patterns = array ();\n\t\t\t$file_name_patterns [] = $this->getId ();\n\t\t\t$file_name_patterns [] = ToolBox::formatForFileName ( $this->lastName . '_' . $this->firstName );\n\n\t\t\tforeach ( $file_extensions as $ext ) {\n\t\t\t\tforeach ( $file_name_patterns as $file_name_pattern ) {\n\t\t\t\t\t$file_path = $system->getTrombiDirPath () . DIRECTORY_SEPARATOR . $file_name_pattern . '.' . $ext;\n\t\t\t\t\tif (is_file ( $file_path )) {\n\t\t\t\t\t\tunlink ( $file_path );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\t$system->reportException ( $e, __METHOD__ );\n\t\t\treturn false;\n\t\t}\n\t}",
"function deleteFiles() {\n unlink(FS_THUMB_DIR.$this->thumbnail);\t\t\t\n unlink(FS_IMG_DIR.$this->image);\n }",
"public function deleteFiles()\n {\n image($this)->deleteFiles();\n }",
"public function DeleteFile($file) {\n\t\tunlink(FileUploadHandler::IMAGE_DIRECTORY . $file);\n\t\tunlink(FileUploadHandler::THUMB_DIRECTORY . $file);\n\t}",
"public function removeUpload()\n {\n // En PostRemove, on n'a pas accès à l'id, on utilise notre nom sauvegardé\n if (file_exists($this->tempFilename)) {\n // On supprime le fichier\n unlink($this->tempFilename);\n }\n }",
"protected function cleanFiles()\n {\n $path = $this->getPathTemplate('filePath', $this->attribute);\n @unlink($path);\n }",
"function temp_photo_delete()\n\t {\n\t \tif($this->Auth->request_access_check())\n\t\t{\n\t\t\t$file_name = $this->input->post('filename');\n\t\t\t$base_photoupload_path = $this->config->item('base_photoupload_path');\n\t\t\t$file_path = \"./\".$base_photoupload_path.'temp/'.$file_name;\n\t\t\tunlink($file_path);\n\t\t}\n\t }",
"public function delete_file()\n {\n if (request()->has('id')) {\n up()->delete(request('id'));\n }\n }",
"private function removeUploadedFile()\n {\n if(!isset($_REQUEST['file']))\n {\n exit; \n }\n \n list($file, $src, $size) = explode(':', $_REQUEST['file']);\n \n if(file_exists($src))\n {\n @unlink($src);\n }\n exit;\n }",
"function delete_files()\n {\n unlink('assets/otherFiles/'.$this->uri(4));\n $this->dashboard_model->delete_table_files($this->uri(3));\n $this->flashmsg('Deleted');\n redirect(base('homemanage', 'manage_home'));\n }",
"function _webform_delete_file($data, $component) {\r\n // Delete an individual submission file.\r\n $filedata = unserialize($data['value']['0']);\r\n if (isset($filedata['filepath']) && is_file($filedata['filepath'])) {\r\n unlink($filedata['filepath']);\r\n db_query(\"DELETE FROM {files} WHERE filepath = '%s'\", $filedata['filepath']);\r\n }\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the [del_delayed] column value. | public function getDelDelayed ()
{
return $this->del_delayed;
} | [
"public function getDelDelayDuration ()\n {\n return $this->del_delay_duration;\n }",
"public function getDelayedTime()\n {\n $packet = $this->getPacket();\n\n if ($packet['delayed'] > 0) {\n return $packet['delayed'];\n }\n\n return -1;\n }",
"public function getDelay()\n {\n return $this->delay;\n }",
"public function getDelay() {\n\t\tif (isset($this -> delay)) {\n\t\t\treturn $this -> delay;\n\t\t} else {\n\t\t\t// By default return 0\n\t\t\treturn 0;\n\t\t}\n\t}",
"public function getDeletedAtColumn() {\n\t\treturn Config::get('model.database.deleted_at');\n\t}",
"public function getDelayTimeValue()\n {\n return $this->delayTimeValue;\n }",
"public function getDeletedAtColumn()\n {\n return defined('static::DELETED_AT') ? static::DELETED_AT : 'deleted_at';\n }",
"public function getDelDuration ()\n {\n return $this->del_duration;\n }",
"public function getDelay(): int\n {\n return $this->delay;\n }",
"public function getDel()\n {\n return $this->del;\n }",
"public function getDeleteddAtColumn()\n\t{\n\t\treturn Config::get('modelling.model.timestamps.deleted_at');\n\t}",
"public function setDelDelayed ($v)\n {\n // Since the native PHP type for this column is integer,\n // we will cast the input value to an int (if it is not).\n if ( $v !== null && !is_int ($v) && is_numeric ($v) )\n {\n $v = (int) $v;\n }\n if ( $this->del_delayed !== $v || $v === 0 )\n {\n $this->del_delayed = $v;\n }\n }",
"public function getDelayDuration()\n {\n return $this->delay_duration;\n }",
"public function getDelayedTo()\n {\n return $this->DelayedTo;\n }",
"public function getAfterDelay()\n {\n return $this->afterDelay;\n }",
"public function getUnfreezeDelay()\n {\n return $this->unfreeze_delay;\n }",
"public function getQueueDelay() {\n return $this->queue_delay;\n }",
"public function getDelayTime()\n {\n return $this->delay_time;\n }",
"public function getHideDelay() {\r\n if ($this->chart==null) {\r\n return 0;\r\n } else {\r\n $tmp = $this->chart->getToolTip();\r\n return ($tmp==null) ? 0 : $tmp->getDismissDelay();\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the port number of the server to process this request. | function setServerPort($port) {
$this->serverPort = $port;
} | [
"public function setPort($port){}",
"public function setPort($port) {\n $this->port = $port;\n }",
"public function setPort($port);",
"public function set_port($port) {\r\n $this->port = $port;\r\n }",
"function set_port($port)\r\n\t{\r\n\t\t$this->_port=$port;\r\n\t}",
"function set_port ($port) {\n\t\tif ($this->cli) {\n\t\t\t$this->port\t= (int)$port;\n\t\t}\n\t}",
"public function setPort($port) { $this->port = $port; }",
"public function setServerPort($value)\n {\n return $this->set(self::SERVER_PORT, $value);\n }",
"public function setLocalPort($port){}",
"function setServer( $address, $port ) {\n\t\t$this->address = $address;\n\t\t$this->port = $port;\n\t}",
"public function setListenPort(?int $value): void {\n $this->getBackingStore()->set('listenPort', $value);\n }",
"public function setPort(int $port = null): self;",
"public function setHttpPort($port)\n {\n $this->httpPort = $port;\n }",
"public function testSettingPort()\n {\n $server = new Server();\n $server->setPort(80);\n $this->assertEquals(80, $server->getPort());\n }",
"public function setProxyPort($value) { $this->proxyPort = intval($value); }",
"public function setPort($port)\n {\n // Check port\n if (!preg_match(\"#^[0-9]{1,5}$#\", $port)) return false;\n\n // Add port to the starting-URL\n $url_parts = PHPCrawlerUtils::splitURL($this->starting_url);\n $url_parts[\"port\"] = $port;\n $this->starting_url = PHPCrawlerUtils::buildURLFromParts($url_parts, true);\n \n return true;\n }",
"public function set_port( $args, $assoc_args ) {\n $port = $args[0];\n if( isset( $port ) ) {\n \\WP_CLI::log( sprintf( __( 'Setting Elasticsearch port to %d', 'elasticpress' ), $port ) );\n ep_set_server_port( $port );\n }\n else {\n \\WP_CLI::error( __( 'No port specified', 'elasticpress' ) );\n }\n }",
"public function setPort($port=\"3306\") {\n\t\t$this->port = $port;\n\t}",
"function resetPort() {\n\t\t$this->port = 80;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'getOrganizationSmVppAccount' | protected function getOrganizationSmVppAccountRequest($organization_id, $vpp_account_id)
{
// verify the required parameter 'organization_id' is set
if ($organization_id === null || (is_array($organization_id) && count($organization_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $organization_id when calling getOrganizationSmVppAccount'
);
}
// verify the required parameter 'vpp_account_id' is set
if ($vpp_account_id === null || (is_array($vpp_account_id) && count($vpp_account_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $vpp_account_id when calling getOrganizationSmVppAccount'
);
}
$resourcePath = '/organizations/{organizationId}/sm/vppAccounts/{vppAccountId}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($organization_id !== null) {
$resourcePath = str_replace(
'{' . 'organizationId' . '}',
ObjectSerializer::toPathValue($organization_id),
$resourcePath
);
}
// path params
if ($vpp_account_id !== null) {
$resourcePath = str_replace(
'{' . 'vppAccountId' . '}',
ObjectSerializer::toPathValue($vpp_account_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
if($headers['Content-Type'] === 'application/json') {
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass) {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
// array has no __toString(), so we should encode it manually
if(is_array($httpBody)) {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
}
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');
if ($apiKey !== null) {
$headers['X-Cisco-Meraki-API-Key'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"public function getCSPMAwsAccountRequest($scan_type = null, $ids = null, $organization_ids = null, $status = null, $limit = 100, $offset = null)\n {\n if ($scan_type !== null && strlen($scan_type) > 4) {\n throw new \\InvalidArgumentException('invalid length for \"$scan_type\" when calling CspmRegistrationApi.getCSPMAwsAccount, must be smaller than or equal to 4.');\n }\n if ($scan_type !== null && strlen($scan_type) < 3) {\n throw new \\InvalidArgumentException('invalid length for \"$scan_type\" when calling CspmRegistrationApi.getCSPMAwsAccount, must be bigger than or equal to 3.');\n }\n if ($scan_type !== null && !preg_match(\"/^(full|dry)$/\", $scan_type)) {\n throw new \\InvalidArgumentException(\"invalid value for \\\"scan_type\\\" when calling CspmRegistrationApi.getCSPMAwsAccount, must conform to the pattern /^(full|dry)$/.\");\n }\n\n if ($status !== null && !preg_match(\"/^(provisioned|operational)$/\", $status)) {\n throw new \\InvalidArgumentException(\"invalid value for \\\"status\\\" when calling CspmRegistrationApi.getCSPMAwsAccount, must conform to the pattern /^(provisioned|operational)$/.\");\n }\n\n if ($limit !== null && strlen($limit) > 3) {\n throw new \\InvalidArgumentException('invalid length for \"$limit\" when calling CspmRegistrationApi.getCSPMAwsAccount, must be smaller than or equal to 3.');\n }\n if ($limit !== null && strlen($limit) < 1) {\n throw new \\InvalidArgumentException('invalid length for \"$limit\" when calling CspmRegistrationApi.getCSPMAwsAccount, must be bigger than or equal to 1.');\n }\n\n\n $resourcePath = '/cloud-connect-cspm-aws/entities/account/v1';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($scan_type)) {\n $scan_type = ObjectSerializer::serializeCollection($scan_type, '', true);\n }\n if ($scan_type !== null) {\n $queryParams['scan-type'] = $scan_type;\n }\n // query params\n if ($ids !== null) {\n if('form' === 'form' && is_array($ids)) {\n foreach($ids as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['ids'] = $ids;\n }\n }\n // query params\n if ($organization_ids !== null) {\n if('form' === 'form' && is_array($organization_ids)) {\n foreach($organization_ids as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['organization-ids'] = $organization_ids;\n }\n }\n // query params\n if (is_array($status)) {\n $status = ObjectSerializer::serializeCollection($status, '', true);\n }\n if ($status !== null) {\n $queryParams['status'] = $status;\n }\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function _initAccount()\n {\n $id = $this->getRequest()->getParam('id', null);\n $accountModel = Mage::getModel('emvcore/account')->load($id);\n Mage::register('current_emvaccount', $accountModel);\n\n return $accountModel;\n }",
"public function getOrganizationSmVppAccountWithHttpInfo($organization_id, $vpp_account_id)\n {\n $returnType = 'object';\n $request = $this->getOrganizationSmVppAccountRequest($organization_id, $vpp_account_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function getAccountRequest()\n {\n\n $resourcePath = '/account';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('api-key');\n if ($apiKey !== null) {\n $headers['api-key'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('partner-key');\n if ($apiKey !== null) {\n $headers['partner-key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function account()\n {\n return $this->httpRequest(\"v3/account\", \"GET\", [], true);\n }",
"public function get_accounts() {\n $result = array();\n // get GA accounts\n $accounts = $this->management_accounts->listManagementAccounts();\n $accounts_items = $accounts->getItems();\n if (count($accounts_items) > 0) {\n foreach ($accounts_items as $account_item) {\n // create \"id&name\" - key\n // $result[ $account_item->getId() . '&' . $account_item->getName() ] = array();\n $result[ $account_item->getName() ] = array();\n // get webproperties for current account\n\t\t\t\t\n $webproperties = $this->management_webproperties->listManagementWebproperties($account_item->getId());\n $webproperties_items = $webproperties->getItems();\n // add each webproperty to array\n foreach($webproperties_items as $webproperty_item) {\n $profiles = $this->management_profiles->listManagementProfiles($account_item->getId(), $webproperty_item->getId());\n $profiles_items = $profiles->getItems();\n if (is_array($profiles_items)) {\n foreach($profiles_items as $profile_item) {\n // $result[ $account_item->getId() . '&' . $account_item->getName() ]\n $result[ $account_item->getName() ]\n // [ $webproperty_item->getId() . '&' . $webproperty_item->getName() ]\n [ $webproperty_item->getName() ]\n [ $profile_item->getId() ] = $profile_item->getName(); \n }\n } else if( ! is_null($profiles_items) ) {\n // $result[ $account_item->getId() . '&' . $account_item->getName() ]\n $result[ $account_item->getName() ]\n // [ $webproperty_item->getId() . '&' . $webproperty_item->getName() ]\n [ $webproperty_item->getName() ]\n [ $profiles_items['id'] ] = $profiles_items['name'];\n }\n } \n }\n return $result;\n } else {\n throw new Exception('No accounts found');\n }\n }",
"public function create(): Account;",
"protected function getCurrentAccountRequest()\n {\n\n $resourcePath = '/v1/account';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getAccountInformation ();",
"public function ajaxGetPartnerAccountListAction()\n {\n // get authentication module\n $auth = $this->getServiceLocator()->get('library_backoffice_auth');\n\n if (!$auth->hasRole(Roles::ROLE_PARTNER_MANAGEMENT)) {\n return new JsonModel([\n 'status' => 'error',\n 'msg' => TextConstants::PARTNER_ACCOUNT_CANNOT_BE_MANAGE,\n ]);\n }\n\n /**\n * @var \\DDD\\Service\\User\\ExternalAccount $userAccountService\n * @var \\DDD\\Service\\User\n */\n $externalAccountService = $this->getServiceLocator()->get('service_user_external_account');\n $userId = (int)$this->params()->fromRoute('id', 0);\n\n if((int) $this->params()->fromQuery('all', 0) == 2) {\n $status = ExternalAccount::EXTERNAL_ACCOUNT_STATUS_ARCHIVED;\n } else {\n $status = ExternalAccount::EXTERNAL_ACCOUNT_STATUS_ACTIVE;\n }\n\n /**\n * @var \\DDD\\Dao\\Finance\\Transaction\\TransactionAccounts $transactionAccountDao\n */\n $transactionAccountDao = $this->getServiceLocator()->get('dao_finance_transaction_transaction_accounts');\n $transactionAccountID = $transactionAccountDao->getAccountIdByHolderAndType($userId, Account::TYPE_PARTNER);\n\n /**\n * @var \\DDD\\Dao\\Geolocation\\Countries $countriesDao\n */\n $countriesDao = $this->getServiceLocator()->get('dao_geolocation_countries');\n $countriesById = $countriesDao->getCountriesById();\n\n // custom sorting\n $columns = [\n 'is_default', 'name', 'type', 'full_legal_name', 'address', 'countryId', 'iban', 'swft'\n ];\n\n $sortCol = $this->params()->fromQuery('iSortCol_0', 0);\n $sortDir = $this->params()->fromQuery('sSortDir_0', 0);\n $sortSearch = $this->params()->fromQuery('sSearch', 0);\n\n $sort = [];\n if ($columns[$sortCol]) {\n $sort = [\n $columns[$sortCol] => $sortDir\n ];\n }\n\n // get query parameters and reservations data\n $externalAccounts = $externalAccountService->getExternalAccountsByParams([\n 'transactionAccountID' => $transactionAccountID,\n 'status' => $status,\n 'sort' => $sort,\n 'search' => $sortSearch\n ]);\n\n $data = [];\n foreach ($externalAccounts as $key => $externalAccount) {\n /**\n * @var \\DDD\\Domain\\User\\ExternalAccount $externalAccount\n */\n if ($externalAccount->getIsDefault() == ExternalAccount::EXTERNAL_ACCOUNT_IS_DEFAULT) {\n $data[$key][] = '<span class=\"label label-primary\">Default</span>';\n } else {\n $data[$key][] = '';\n }\n\n $data[$key][] = $externalAccount->getName();\n if ($externalAccount->getType() == ExternalAccount::EXTERNAL_ACCOUNT_TYPE_DIRECT_DEPOSIT) {\n $data[$key][] = 'Direct Deposit';\n } elseif ($externalAccount->getType() == ExternalAccount::EXTERNAL_ACCOUNT_TYPE_CHECK) {\n $data[$key][] = 'Check';\n } elseif ($externalAccount->getType() == ExternalAccount::EXTERNAL_ACCOUNT_TYPE_CASH) {\n $data[$key][] = 'Cash';\n } elseif ($externalAccount->getType() == ExternalAccount::EXTERNAL_ACCOUNT_TYPE_COMPANY_CARD) {\n $data[$key][] = 'Company Card';\n }\n $data[$key][] = $externalAccount->getFullLegalName();\n\n $addressString = '';\n if (strlen($externalAccount->getBillingAddress()) > 0) {\n $addressString .= $externalAccount->getBillingAddress() . '<br>';\n }\n if (strlen($externalAccount->getMailingAddress()) > 0) {\n $addressString .= $externalAccount->getMailingAddress() . '<br>';\n }\n if (strlen($externalAccount->getBankAddress()) > 0) {\n $addressString .= $externalAccount->getBankAddress() . '<br>';\n }\n $data[$key][] = $addressString;\n $data[$key][] = $countriesById[$externalAccount->getCountryId()]->getName();\n $data[$key][] = $externalAccount->getIban();\n $data[$key][] = $externalAccount->getSwft();\n\n if ($externalAccount->getStatus() == ExternalAccount::EXTERNAL_ACCOUNT_STATUS_ARCHIVED) {\n // special for datatable edit link\n $data[$key][] = 0;\n } else {\n // special for datatable edit link\n $data[$key][] = $externalAccount->getId();\n }\n }\n\n return new JsonModel(\n [\n 'iTotalRecords' => sizeof($data),\n \"aaData\" => $data,\n 'sEcho' => $this->params()->fromQuery('sEcho'),\n 'iDisplayStart' => $this->params()->fromQuery('iDisplayStart'),\n 'iDisplayLength' => $this->params()->fromQuery('iDisplayLength'),\n 'iTotalDisplayRecords' => sizeof($data),\n ]\n );\n }",
"function getAccountInfo() {\n }",
"protected function accountsV2Get_0Request()\n {\n\n $resourcePath = '/v2/accounts/standardaccounts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function listOptionsAccountRequest()\n {\n\n $resourcePath = '/options/accounts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires Gate APIv4 authentication\n $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody);\n $headers = array_merge($headers, $signHeaders);\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function account()\n {\n return new Resources\\Account($this->request, $this->settings);\n }",
"function getIncomeAccountObj($dataService) {\n $accountArray = $dataService->Query(\"select * from Account where AccountType='\" . INCOME_ACCOUNT_TYPE . \"' and AccountSubType='\" . INCOME_ACCOUNT_SUBTYPE . \"'\");\n $error = $dataService->getLastError();\n if ($error) {\n logError($error);\n } else {\n if (is_array($accountArray) && sizeof($accountArray) > 0) {\n return current($accountArray);\n }\n }\n\n // Create Income Account\n $incomeAccountRequestObj = Account::create([\n \"AccountType\" => INCOME_ACCOUNT_TYPE,\n \"AccountSubType\" => INCOME_ACCOUNT_SUBTYPE,\n \"Name\" => \"IncomeAccount-\" . uniqid()\n ]);\n $incomeAccountObject = $dataService->Add($incomeAccountRequestObj);\n $error = $dataService->getLastError();\n if ($error) {\n logError($error);\n } else {\n echo \"Created Income Account with Id={$incomeAccountObject->Id}.\\n\\n\";\n return $incomeAccountObject;\n }\n}",
"public function getAccount() {\n return Account::retrieve($this->externalAccount->__get('data')['object']['account']);\n }",
"public function account_info() {\r\n return $this->request_info(\"v2/account\");\r\n }",
"public function createNewAccount()\n {\n return new Account($this->generateUniquePaymentRef());\n }",
"public function getAccountsPartner()\n {\n $url = config('ms_global.ms_urls.' . config('app.env') . '.accounts') . config('ms_specific.account.get_partners');\n $response = $this->guzzle->get($url);\n\n if (!$response['data']['data']) {\n return $this->prepareResponse('Account record not found.', $this->statusError, Response::HTTP_NOT_FOUND);\n }\n\n return response()->json($response['data']['data'], $response['statusCode']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get script tag for TinyMCE | public function getTinyMCE()
{
return sprintf('<script src="%s" type="text/javascript"></script>', $this->script_url);
} | [
"public function getScript() : ?string\n {\n return $this->subtags['script'] ?? null;\n }",
"public function getScriptMarkup(){ return $this->scripts_markup; }",
"function scriptContent() {}",
"public function getScript()\r\n {\r\n return $this->script;\r\n }",
"private function getEditorPageCustomScripts(){\n \t\n \t$arrAddons = $this->getArrAddons();\n \t\n \t$objAddons = new UniteCreatorAddons();\n \t$arrPreviewUrls = $objAddons->getArrAddonPreviewUrls($arrAddons, \"title\");\n\t\t \t\n \t$jsonPreviews = UniteFunctionsUC::jsonEncodeForClientSide($arrPreviewUrls);\n \t\n \t$urlAssets = GlobalsUC::$url_assets;\n \t\n \t$script = \"\";\n \t$script .= \"\\n\\n // ----- unlimited elements scripts ------- \\n\\n\";\n \t//$script .= \"var g_ucJsonAddonPreviews={$jsonPreviews};\\n\";\n \t$script .= \"var g_ucUrlAssets='{$urlAssets}';\\n\";\n\t\t$script .= \"\\n\";\n\t\t\n\t\t$shapeScripts = $this->getShapePickerScripts();\n\t\t\n\t\t$script .= $shapeScripts;\n\t\t\n\t\t$script .= \"\\n\";\n\t\t\n \treturn($script);\n }",
"public function getScript()\n {\n return $this->script;\n }",
"public static function getTagmanagerTrackingScriptBody()\n {\n $config = static::getConfig();\n\n $fullScript = '';\n\n // Script provided by the user\n if (!empty($config['tagmanager_full_script_body'])) {\n $fullScript = $config['tagmanager_full_script_body'];\n }\n // Auto-generated script based on the options chosen by the user\n elseif (!empty($config['google_tagmanager_tag'])) {\n $fullScript = \\View::forge('bru_google_seo_tools::js_tagmanager_body', array(\n 'tag' => \\Arr::get($config, 'google_tagmanager_tag'),\n ), false);\n }\n\n if (empty($fullScript)) {\n return '';\n }\n\n $fullScript = static::getCodeWithoutComment($fullScript);\n\n static::_shouldITrack($fullScript);\n\n return (string) $fullScript;\n }",
"public function getScriptURL(TinyMCEConfig $config);",
"function wp_tinymce_inline_scripts() {}",
"public function getScript(): Script\n {\n return $this->getAttribute('script');\n }",
"public function getScript()\n {\n return IntlLocale::getScript($this->getLocale());\n }",
"protected function renderInitScript() {\n\t\t$id = $this->attr('id');\n\t\t$script = 'script';\n\t\t$js = \"InputfieldTinyMCE.init('#$id', 'module.render'); \";\n\t\treturn \"<$script>$js</$script>\";\n\t}",
"protected function getScriptTags()\n\t{\n\t\tglobal $objPage;\n\n\t\tswitch ($objPage->outputFormat)\n\t\t{\n\t\t\tcase 'html5':\n\t\t\t\treturn array('<script>', '</script>');\n\n\t\t\tcase 'xhtml':\n\t\t\tdefault:\n\t\t\t\treturn array('<script type=\"text/javascript\">'.\"\\n\".'/* <![CDATA[ */', '/* ]]> */'.\"\\n\".'</script>');\n\t\t}\n\t}",
"protected function getScriptSrc(): string\n {\n if (config('app.allow_content_scripts')) {\n return '';\n }\n\n $parts = [\n 'http:',\n 'https:',\n '\\'nonce-' . $this->nonce . '\\'',\n '\\'strict-dynamic\\'',\n ];\n\n return 'script-src ' . implode(' ', $parts);\n }",
"private function getTagScriptSrc( $path )\n {\n $script = ' <script src=\"' . $path . '\" type=\"text/javascript\"></script>';\n\n return $script;\n }",
"public function get_custom_script() {\n\n\t\tglobal $post;\n\n\t\t$script = get_post_meta( $post->ID, 'wcf-custom-script', true );\n\n\t\treturn $script;\n\t}",
"function getScripts()\n {\n return $this->page != null ? $this->page['scriptLink'] : '';\n }",
"public function getJavaScript();",
"function XTINYMCEJS ($parm0) {\n$lbits = explode(',', $parm0);\nforeach ($lbits as $lbitselement) {\n if ($lbitselement != \"\" ) {\n $key = \"STATIC_TINYMCEJS_\".$lbitselement;\n echo '<script type=\"text/javascript\" src=\"'.$GLOBALS{'site_tinymceurl'}.'/'.$GLOBALS{$key}.'\"></script>'.\"\\n\";\n }\n}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all TblStudio models. | public function actionIndex()
{
$searchModel = new TblStudioSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | [
"public function models()\n {\n $this->_display('models');\n }",
"function _listAll()\n {\n $this->_getTables();\n $this->out('');\n $this->out('Possible Models based on your current database:');\n $this->hr();\n $this->_modelNames = array();\n $i=1;\n foreach ($this->__tables as $table) {\n $this->_modelNames[] = $this->_modelName($table);\n $this->out($i++ . \". \" . $this->_modelName($table));\n }\n }",
"public function getModels();",
"public function listModels()\n\t{\n\t\t$classes = \\SeanMorris\\Ids\\Linker::classes('SeanMorris\\Ids\\Model');\n\n\t\t$classes = array_map(\n\t\t\tfunction($class)\n\t\t\t{\n\t\t\t\treturn str_replace('\\\\', '/', $class);\n\t\t\t}\n\t\t\t, $classes\n\t\t);\n\n\t\tprint implode(PHP_EOL, $classes) . PHP_EOL;\n\t}",
"function get_models() {\n\tglobal $db;\n\t$query = $db->prepare(\"SELECT name FROM tiremodel\");\n\t$query->execute();\n\t$tiremodels = $query->fetchAll();\n\n\tif(isset($tiremodels)) {\n\t\techo \"<ul id='tiremodels'>\";\n\t\tforeach ($tiremodels as $model){\n\t\t\techo \"<li>\";\n\t\t\techo $model['name'];\n\t\t\techo \"</li>\";\n\t\t}echo \"</ul>\";\n\t} \n}",
"function GetAllModels()\n\t{\n\t}",
"public static function models()\n {\n return self::fetch(\"models\");\n }",
"public function getModelsList(){\r\n\t\t$this->db->select(\"id, nome\");\r\n\t\t$this->db->from(\"modelos\");\r\n\t\treturn $this->db->get()->result();\r\n\t}",
"public function dbGetModels() {\n header('Content-Type: application/json');\n $data = $this->model->getModels();\n $this->load->raw(json_encode($data));\n }",
"public function get_models(){\n\t\techo $this->manufacturer_model->getModelsData();\n\t}",
"public static function List() {\n\t\t$models = array();\n\n\t\t// Get models from the database ordered.\n\t\t$dbh = Database::connect();\n\t\t$query = $dbh->prepare(\"SELECT id FROM device_models\");\n\t\t$query->execute();\n\t\t$rows = $query->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t// Go through the results creating Model objects.\n\t\tforeach ($rows as $model)\n\t\t\tarray_push($models, Model::FromID($model[\"id\"]));\n\n\t\treturn $models;\n\t}",
"public function all() {\n return $this->app->entityManager->getRepository($this->model_name)->findAll();\n }",
"public static function getModelsWidget() {\n $filter = Config::get('filter_array');\n return DB::select('models.name', 'models.alias', 'models.id')\n ->from('models')\n ->join('catalog', 'LEFT')->on('catalog.model_id', '=', 'models.id')\n ->join('brands', 'LEFT')->on('brands.id', '=', 'catalog.brand_id')->on('brands.status', '=', DB::expr('1'))\n ->where('catalog.status', '=', 1)\n ->where('models.status', '=', 1)\n ->where('brands.alias', 'IN', Arr::get($filter, 'brand', []))\n ->where('catalog.parent_id', '=', Route::param('group'))\n ->group_by('models.id')\n ->order_by('models.name')\n ->find_all();\n }",
"function _smartdocs_model_resource_index(){\n $model = new Model(devconnect_default_org_config());\n $return = array();\n foreach($model->listModels() as $model){\n $return[$model->getName()] = $model->toArray();\n }\n return $return;\n}",
"public function getModels()\r\n {\r\n $query = $this->getQuery();\r\n $models = $query->all();\r\n return $models;\r\n }",
"public function getAllModels(){\n if($this->getRequestType() !== \"GET\") {\n $this->requestError(405);\n }\n $autoModel = AutoModels::model()->findAll();\n\n $this->sendResponse([\"success\" => 1, \"data\" => $autoModel]);\n exit();\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MDWRosantBundle:Modelo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function actionIndex() {\n $searchModel = new ToolsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $gB_models = $em->getRepository('AppBundle:GB_model')->findAll();\n\n return $this->render('gb_model/index.html.twig', array(\n 'gB_models' => $gB_models,\n ));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
\brief Look at a string and see if it is multipage htmlpage by looking for pager class. | private function isMultiPage($content) {
$dom = new DOMDocument;
@$dom->loadHTML(utf8_decode($content));
foreach($dom->getElementsByTagName('ul') as $ul) {
$classes = $ul->getAttribute('class');
if (preg_match("/pager/", $classes)) {
return TRUE;
}
}
return FALSE;
} | [
"public static function isHTMLPage ($string)\r\n {\r\n return preg_match('/<html.*>/', $string) != 0;\r\n }",
"function papi_is_page_type( $str = '' ) {\n\treturn papi_is_entry_type( $str );\n}",
"function return_pagify_content($content, $pageSize, $pageNum=0, $link=null) {\n if (!preg_match('/^hr|(\\d+)\\s*([a-zA-Z]*)$/',$pageSize,$match)) return $content;\n if ($pageSize == 'hr') {\n $pages = preg_split(\"@\\s*<hr\\s*/?>\\s*@i\", $content);\n } else {\n $size = (int) $match[1];\n $unit = @$match[2] ? strtolower($match[2]) : 'b';\n if ($size <= 0) return $content;\n # split content into pages \n $ismb = function_exists('mb_strlen');\n $pages = array();\n $tagStack = array();\n $pageStart = 0;\n $pos = 0;\n $currsize = 0;\n while (($lpos = strpos($content,'<',$pos)) !== false) {\n if ($unit == 'c') { # count characters\n $text = html_entity_decode(trim(substr($content,$pos,$lpos-$pos)),ENT_QUOTES,'UTF-8');\n $currsize += $ismb ? mb_strlen($text) : strlen($text);\n } else if ($unit == 'w') { # count words\n $spaces = preg_match_all('/\\s+/',trim(substr($content,$pos,$lpos-$pos)),$matches);\n if ($spaces > 0) $currsize += $spaces + 1;\n } else if ($unit == 'b') { # bytes\n $currsize = $lpos - $pageStart;\n }\n if (!$tagStack && $currsize >= $size) {\n array_push($pages, substr($content, $pageStart, $lpos - $pageStart));\n $pageStart = $lpos;\n $currsize = 0;\n }\n $gpos = strpos($content,'>',$lpos+1);\n if ($gpos !== false) {\n $tag = substr($content,$lpos,$gpos-$lpos+1);\n $spos = strpos($tag,' ');\n if (substr($tag,1,1) == '/') {\n $tagname = $spos !== false ? substr($tag,2,$spos-2) : substr($tag,2,strlen($tag)-3);\n while ($tagStack && array_pop($tagStack) != $tagname);\n if (!$tagStack) {\n if ($unit == 'p') { # increment paragraphs\n $currsize += 1;\n } else if ($unit == 'b') { # bytes\n $currsize = $gpos - $pageStart + 1;\n }\n if ($currsize >= $size) {\n array_push($pages, substr($content, $pageStart, $gpos - $pageStart + 1));\n $pageStart = $gpos+1;\n $currsize = 0;\n }\n }\n } else if (substr($tag,strlen($tag)-2,1) == '/') {\n $tagname = $spos !== false ? substr($tag,1,$spos-1) : substr($tag,1,strlen($tag)-3);\n } else {\n $tagname = $spos !== false ? substr($tag,1,$spos-1) : substr($tag,1,strlen($tag)-2);\n array_push($tagStack, $tagname);\n }\n $pos = $gpos+1;\n } else {\n $pos = strlen($content);\n }\n }\n if (strlen($content) > $pageStart && trim(substr($content, $pageStart))) {\n array_push($pages, substr($content, $pageStart));\n } else if (strlen($content) == 0) {\n array_push($pages, '');\n }\n }\n return $pages[$pageNum] . \"\\n\" . return_pagify_navigation(count($pages), $pageNum, $link);\n}",
"static function HasPaging($content){\n if(substr($content, 0, 11) == \"<!--PAGE\"){\n return true;\n } else {\n return false;\n }\n }",
"function _check_embed_pages($str)\n\t{\n\t\t// Do fast check\n\t\tif (strpos($str, 'mojo_page_region') !== FALSE)\n\t\t{\n\t\t\t$this->load->helper('dom');\n\n\t\t\t$layout_dom = str_get_html($str);\n\n\t\t\t$regions = array();\n\n\t\t\t// Get page regions\n\t\t\t$page_regions = $layout_dom->find('*[class=mojo_page_region]');\n\t\t\t\n\t\t\t//var_dump($page_regions); exit;\n\t\t\tif ( ! empty($page_regions))\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('_check_embed_pages', $this->lang->line('layout_embed_p_region'));\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t\t\n\t}",
"public function page_process($string)\n\t{\t\t\n\n\t\tpreg_match_all('/(((\\<|<)\\?php)(.*?)(\\?(\\>|>)))|([;\\s](http|ftp)s?(:\\/\\/)(www\\.)?([\\w\\d-.\\/]+?)*)|([\\s;]([\\w\\d-.]*)@([\\w\\d-.]*)(\\.[A-Za-z]*))/', substr($string, strpos($string, '<body>'), strpos($string, '</body>')), $PHPcode);\n\t\t\n\t\tforeach (array_unique($PHPcode[0]) as $value) \n\t\t{\n\t\t\t\n\t\t\tif($value[0] != '\\w')\n\t\t\t\t$value = substr($value, 1);//preg_replace('/[>;]/', '', $value);\n\n\t\t\t$value = preg_replace('/\\s/', \"\", $value);\n\t\t\tif(strstr($value, '?php'))\n\t\t\t{\n\t\t\t\tob_start();\n\t\t\t\t\teval(substr($value, strpos($value, '?')+4, strrpos($value, '?') - (strpos($value, '?php')+4)));\n\t\t\t\t\t$php = ob_get_contents();\n\t\t\t\tob_end_clean();\n\t\t\t\t$string = str_replace($value, $php, $string);\n\t\t\t}\n\t\t\telseif(strstr($value, 'http://') || strstr($value, 'https://') || strstr($value, 'ftp://') )\n\t\t\t\t$string = str_replace($value, '<a href=\"'.$value.'\">'.$value.'</a>', $string);\n\t\t\telseif(strstr($value, '@'))\n\t\t\t\t$string = str_replace($value, '<a href=\"mailto:'.$value.'\">'.$value.'</a>', $string);\n\t\t}\n\n\t\t// Remove blank-lines caused by php code\n\t\t$string = preg_replace('/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/', \"\", $string);\n\t\t\n\t\treturn $string;\n\t}",
"public function getPager()\n {\n if (!isset($this->pager) && $this->usePcntl()) {\n if (\\getenv('TERM') === 'dumb') {\n return false;\n }\n\n if ($pager = \\ini_get('cli.pager')) {\n // use the default pager\n $this->pager = $pager;\n } elseif ($less = $this->configPaths->which('less')) {\n // check for the presence of less...\n $this->pager = $less.' -R -F -X';\n }\n }\n\n return $this->pager;\n }",
"function SetPageString() {\n if (!isset($_GET['p'])) {\n return \"home\";\n }\n return $_GET['p'];\n }",
"public function renderPageByURL() {\n\n\t}",
"private function can_add_multi_page() {\n\t\tglobal $multipage, $numpages, $page;\n\n\t\treturn ( ! $multipage || $page === $numpages );\n\t}",
"protected function _GetPageClassName()\r\n {\r\n $uri = strtolower( $_SERVER['REQUEST_URI']);\r\n $uri = parse_url($uri);\r\n $path = trim($uri['path'], \"/\");\r\n $pathSegments = explode(\"/\", $path);\r\n\r\n if( empty($pathSegments[0]))\r\n {\r\n array_shift($pathSegments);\r\n } \r\n \r\n \r\n /**\r\n * We need to create key for the _mClassMapping array that maps to a page class name.\r\n * To get the key, we need to explode the path into segments and\r\n * test the key validity as we loop through the segments array.\r\n * If the key is not correct, we know that it is an argument for the page.\r\n */\r\n $numOfSegments = count($pathSegments);\r\n for ($i = 0; $i < $numOfSegments; $i++)\r\n {\r\n \t// Creating the key (aka the path) \r\n \t$tmp_path = implode(\"/\", $pathSegments);\r\n\r\n \t// Check if the key (path) returns a value from the _mClassMapping array \r\n \tif (empty($this->_mClassMapping[$tmp_path]) === false)\r\n \t{\r\n $this->_SetClassName($tmp_path);\r\n break; // we no longer need to check the rest of the segments since we found our page class \r\n \t}\r\n \telse\r\n \t{\r\n \t\t// remove the last segment and add it to the arguments list \r\n \t\tarray_unshift($this->_mClassArguments, array_pop($pathSegments));\r\n \t}\r\n }\r\n if(empty($this->_mClassName)) // homepage is default\r\n $this->_SetClassName('');\r\n//dump($this->_mClassName); \r\n return true;\r\n }",
"private function inpage($i,$inpage)\n\t{\n\t\tif($i==$inpage)\n\t\t\treturn ' class=\"inpage\"';\n\t\treturn '';\t\n\t}",
"abstract public function getPage($url);",
"public function getPageClass() {}",
"function is_html($string){\n\t\t\treturn preg_match(\"/<[^<]+>/\",$string,$m) != 0;\n\t\t}",
"function textpattern() \n\t{\n\t\tglobal $pretext,$microstart,$txpac;\n\t\t$segment = gps('segment');\n\t\textract($pretext);\n\t\t\t\t\n\t\t\t$html = safe_field('user_html','txp_page',\"name='$page'\");\n\t\t\tif (!$html) exit('no page template specified for section '.$s);\n\t\t\t$html = parse($html);\n\t\t\t$html = parse($html);\n\t\t\t$html = (!$segment) ? $html : segmentPage($html);\n\t\t\t$html = ($txpac['allow_page_php_scripting']) ? evalString($html) : $html;\n\n\t\t\techo $html;\n\t\t\t\n\t\t\t$microdiff = (getmicrotime() - $microstart);\n\t\t\techo n,comment('Runtime: '.substr($microdiff,0,6));\n\t}",
"public function getPageByUrl($url);",
"public function is_page()\n \t{\n \t\t$CI = & get_instance();\n\t \t$tipo = $CI->content->type($this->_tipo);\n\t \tif ($tipo['tree'] == TRUE)\n\t \t{\n\t \t\treturn TRUE;\n\t \t} else {\n\t \t\treturn FALSE;\n\t \t}\n \t}",
"public function parsePageText($pageText): array;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
zz_getFindInSetFromLength( ): Set the FIND IN SET statement for each special char group. A special char group is grouped by the length of a special char. | private function zz_getFindInSetFromLength( $row, $fromLength )
{
// Get current table.field of the index browser
$tableField = $this->indexBrowserTableField;
// LOOP : generate a find in set statement for each special char
$findInSet = null;
foreach ( $row as $char => $length )
{
if ( $length < $fromLength )
{
continue;
}
// #44125, 121218, dwildt, 1-
// $findInSet[$length][] = "FIND_IN_SET( LEFT ( " . $tableField . ", " . $length . " ), '" . $char . "' )";
// #44125, 121218, dwildt, 1-
$findInSet[ $length ][] = "FIND_IN_SET( LEFT( " . $tableField . ", " . $length . " ), '" . $char . "' )";
}
// LOOP : generate a find in set statement for each special char
return $findInSet;
} | [
"private function count_chars_resSqlCountSelOrDefLL( $strFindInSet, $currSqlCharset )\n {\n // Get current table.field of the index browser\n $tableField = $this->indexBrowserTableField;\n list( $table ) = explode( '.', $tableField );\n\n // Label of field with the uid of the record with the default language\n $parentUid = $GLOBALS[ 'TCA' ][ $table ][ 'ctrl' ][ 'transOrigPointerField' ];\n\n // RETURN : table isn't localised\n if ( empty( $parentUid ) )\n {\n if ( $this->pObj->b_drs_localisation || $this->pObj->b_drs_navi )\n {\n $prompt = 'Index browser won\\'t be localised, because ' . $table . ' hasn\\'t any transOrigPointerField.';\n t3lib_div::devlog( '[INFO/LOCALISATION+NAVI] ' . $prompt, $this->pObj->extKey, 0 );\n }\n $arr_return = $this->count_chars_resSqlCountDefLL( $strFindInSet, $currSqlCharset );\n }\n\n // Get Ids of all (!) default language records\n $arr_return = $this->zz_sqlIdsOfDefLL( $strFindInSet, $currSqlCharset );\n if ( $arr_return[ 'error' ][ 'status' ] )\n {\n return $arr_return;\n }\n $arr_rows = $arr_return[ 'data' ][ 'rows' ];\n $uidListOfDefLL = implode( ',', ( array ) $arr_rows );\n// var_dump( __METHOD__, __LINE__, $uidListOfDefLL );\n // Get Ids of all (!) default language records\n // Get Ids of all (!) translated language records\n $arr_return = $this->zz_sqlIdsOfTranslatedLL( $strFindInSet, $uidListOfDefLL, $currSqlCharset );\n if ( $arr_return[ 'error' ][ 'status' ] )\n {\n return $arr_return;\n }\n $arr_rowsLL = $arr_return[ 'data' ][ 'rows' ];\n// $uidListOfCurrLanguage = implode( ',', ( array ) $arr_rowsLL['uid'] );\n// var_dump( __METHOD__, __LINE__, $uidListOfCurrLanguage );\n // Get Ids of all (!) translated language records\n // Substract uids of default language records, which are translated\n $arr_rowsDefWoTranslated = array_diff( ( array ) $arr_rows, ( array ) $arr_rowsLL[ $parentUid ] );\n\n\n// var_dump( __METHOD__, __LINE__, 'array_diff' );\n// var_dump( __METHOD__, __LINE__, $arr_rows );\n// var_dump( __METHOD__, __LINE__, $arr_rowsLL[$parentUid] );\n// var_dump( __METHOD__, __LINE__, $arr_rowsDefWoTranslated );\n // Add uids of translated recors\n $arr_rowsDefWiCurr = array_merge( ( array ) $arr_rowsDefWoTranslated, ( array ) $arr_rowsLL[ 'uid' ] );\n\n// var_dump( __METHOD__, __LINE__, 'array_merge' );\n// var_dump( __METHOD__, __LINE__, $arr_rowsDefWoTranslated );\n// var_dump( __METHOD__, __LINE__, $arr_rowsLL['uid'] );\n// var_dump( __METHOD__, __LINE__, $arr_rowsDefWiCurr );\n // Sort the array of uids\n sort( $arr_rowsDefWiCurr, SORT_NUMERIC );\n\n // Get list of uids from the array\n $uidListDefAndCurr = implode( ',', ( array ) $arr_rowsDefWiCurr );\n\n // Count initials\n $length = 1;\n $arr_return = $this->zz_sqlCountInitialsLL( $length, $uidListDefAndCurr, $currSqlCharset );\n\n // RETURN : the sql result\n return $arr_return;\n }",
"function getCharacterGroups();",
"public static function find_in_set()\n\t{\n\t}",
"function mPN_CHARS_U(){\n try {\n // Tokenizer.g:477:3: ( PN_CHARS_BASE | '_' ) \n // Tokenizer.g: \n {\n if ( $this->input->LA(1)==$this->getToken('95')||($this->input->LA(1)>=$this->getToken('97') && $this->input->LA(1)<=$this->getToken('122')) ) {\n $this->input->consume();\n\n }\n else {\n $mse = new MismatchedSetException(null,$this->input);\n $this->recover($mse);\n throw $mse;}\n\n\n }\n\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"private function tabs_initFindInSetForCurrentTab()\n {\n // RETURN : Any tab isn't selected\n if ( empty( $this->pObj->piVars[ 'indexBrowserTab' ] ) )\n {\n return;\n }\n // RETURN : Any tab isn't selected\n // Get the array id of the selected tab\n $labelAscii = $this->pObj->piVars[ 'indexBrowserTab' ];\n $tabId = $this->indexBrowserTab[ 'tabLabels' ][ $labelAscii ];\n // Get the array id of the selected tab\n // SWITCH : the special tab 'others'\n switch ( $this->indexBrowserTab[ 'tabIds' ][ $tabId ][ 'special' ] )\n {\n case( 'others' ):\n // Get all defined attributes\n $attributes = $this->indexBrowserTab[ 'initials' ][ 'all' ];\n break;\n default:\n // Get the attributes of the selected tab\n $attributes = $this->indexBrowserTab[ 'tabIds' ][ $tabId ][ 'attributes' ];\n break;\n }\n // SWITCH : the special tab 'others'\n // Get a row with the byte length og each attribute\n $arrChars = explode( ',', $attributes );\n $arr_return = $this->zz_getSqlLengthAsRow( $arrChars );\n if ( $arr_return[ 'error' ][ 'status' ] )\n {\n return $arr_return;\n }\n $row = $arr_return[ 'data' ][ 'row' ];\n // Get a row with the byte length og each attribute\n // RETURN : there isn't any SQL result\n if ( empty( $row ) )\n {\n return;\n }\n // RETURN : there isn't any SQL result\n // Get an array with all FIND IN SET statements\n $arrFindInSet = $this->zz_getFindInSetForAllByte( $row );\n if ( empty( $arrFindInSet ) )\n {\n return;\n }\n\n // Get the SQL statement for all FIND IN SET\n $orFindInSet = array();\n foreach ( $arrFindInSet as $length )\n {\n foreach ( $length as $statement )\n {\n $orFindInSet[] = $statement;\n }\n }\n $findInSet = implode( ' OR ', $orFindInSet );\n $findInSet = '( ' . $findInSet . ' )';\n // Get the SQL statement for all FIND IN SET\n // In case of special tab 'others' prepend a NOT\n if ( $this->indexBrowserTab[ 'tabIds' ][ $tabId ][ 'special' ] == 'others' )\n {\n $findInSet = 'NOT ' . $findInSet;\n }\n // In case of special tab 'others' prepend a NOT\n // Set the class var $findInSetForCurrTab\n $this->findInSetForCurrTab = $findInSet;\n }",
"public function writeSet(int $len): int;",
"public function match_chars($chars);",
"function Power_Set(array $in,$minLength = 1)\n{\n $count = count($in);\n $members = pow(2,$count);\n $return = array();\n for ($i = 0; $i < $members; $i++) {\n $b = sprintf(\"%0\".$count.\"b\",$i);\n $out = array();\n for ($j = 0; $j < $count; $j++) {\n if ($b{$j} == '1') $out[] = $in[$j];\n }\n if (count($out) >= $minLength) {\n $return[] = $out;\n }\n }\n return $return;\n}",
"function setLogicalChars($some_logical_chars) {\r\n\t\tif( !is_array($some_logical_chars) ) return;\r\n\t\treturn $this->setWord(implode(\"\", $some_logical_chars));\r\n\t}",
"public function findSetBy(array $criteria);",
"function setCharIndexes()\n {\n $char_indexes = array();\n $i = 0;\n foreach ($this->puzzle_chars as $char) {\n $word_chars = getWordChars($this->word_array[$i]);\n //var_dump($word_chars);\n $j = 0;\n foreach ($word_chars as $char2) {\n if ($char === $char2) {\n array_push($char_indexes, $j + 1);\n break;\n }\n $j++;\n }\n $i++;\n $j = 0;\n }\n $this->char_indexes = $char_indexes;\n }",
"function check_substr_chars ($field, $array_of_chars, $start, $lenght) {\n foreach ($array_of_chars as $value) {\n $sub_str = substr($field, $start, $lenght);\n if ($value == $sub_str)\n return true;\n }\n return false;\n}",
"static function characterSetWithCharactersFromString($string) {\n $set = new self();\n $set->addCharactersFromString($string);\n return $set;\n }",
"function groupMerchantSet() {\n $sql=\"SELECT M.id,M.group_name\n\t FROM \".MERCHANT.\" M INNER JOIN \".MERCHANT_USER.\" MU ON M.id = MU.group_merchant_id\"\n . \" WHERE M.deleted = '0' AND M.status = 'Active' AND M.parent_id IS NULL ORDER BY M.group_name\";\n $recordSet = $this->obj->db->query($sql);\n $rs = false;\n if ($recordSet->num_rows() > 0) {\n $rs = array();\n $isEscapeArr = array();\n foreach ($recordSet->result_array() as $row) {\n foreach ($row as $key => $val) {\n if (!in_array($key, $isEscapeArr)) {\n $recordSet->fields[$key] = outputEscapeString($val);\n }\n }\n $rs[] = $recordSet->fields;\n }\n } else {\n return false;\n }\n return $rs;\n }",
"function subsets_make($set_id, $limit) {\n global $db;\n // Uzmi sve kombinacije\n $set_id = (int) $set_id;\n $sql = \"SELECT * FROM subset_combinations WHERE set_id=$set_id\";\n $rs = $db->Execute($sql);\n $counter = 0;\n $subset_count = 1;\n $subset_id = 0;\n while (!$rs->EOF) {\n if ($counter == 0) {\n $title = 'Podset '.$subset_count;\n $title = db_quote($title);\n $db->Execute(\"INSERT INTO subsets SET set_id=$set_id, title=$title\");\n $subset_id = $db->Insert_ID();\n $subset_count++;\n }\n\n $sql = \"UPDATE subset_combinations SET subset_id=$subset_id WHERE id=\".$rs->fields['id'];\n $db->Execute($sql);\n\n $counter++;\n if ($counter >= $limit) {\n $counter = 0;\n }\n $rs->MoveNext();\n }\n}",
"protected function substituteIssetSubparts(){\n\t\t$flags = array();\n\t\t$nowrite = false;\n\t\t$out = array();\n\t\tforeach(split(chr(10), $this->template) as $line){\n\n\t\t\t// works only on it's own line\n\t\t\t$pattern = '/###isset_+([^#]*)_*###/i';\n\n\t\t\t// set for odd ISSET_xyz, else reset\n\t\t\tif(preg_match($pattern, $line, $matches)) {\n\t\t\t\tif(!$flags[$matches[1]]) { // set\n\t\t\t\t\t$flags[$matches[1]] = true;\n\n\t\t\t\t\t// set nowrite flag if required until the next ISSET_xyz\n\t\t\t\t\t// (only if not already set by envelop)\n\t\t\t\t\tif((!$this->markersCountAsSet($matches[1])) && (!$nowrite)) {\n\t\t\t\t\t\t$nowrite = $matches[1];\n\t\t\t\t\t}\n\t\t\t\t} else { // close it\n\t\t\t\t\t$flags[$matches[1]] = false;\n\t\t\t\t\tif($nowrite == $matches[1]) {\n\t\t\t\t\t\t$nowrite = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else { // It is no ISSET_line. Write if permission is given.\n\t\t\t\tif(!$nowrite) {\n\t\t\t\t\t$out[] = $line;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$out = implode(chr(10),$out);\n\n\t\t$this->template = $out;\n\t}",
"function StyleSetCharacterSet($style, $characterSet){}",
"function list_getSmileySets($start, $items_per_page, $sort)\n{\n\tglobal $modSettings;\n\n\t$known_sets = explode(',', $modSettings['smiley_sets_known']);\n\t$set_names = explode(\"\\n\", $modSettings['smiley_sets_names']);\n\n\t$cols = array(\n\t\t'id' => array(),\n\t\t'selected' => array(),\n\t\t'path' => array(),\n\t\t'name' => array(),\n\t);\n\n\tforeach ($known_sets as $i => $set)\n\t{\n\t\t$cols['id'][] = $i;\n\t\t$cols['selected'][] = $i;\n\t\t$cols['path'][] = $set;\n\t\t$cols['name'][] = stripslashes($set_names[$i]);\n\t}\n\n\t$sort_flag = strpos($sort, 'DESC') === false ? SORT_ASC : SORT_DESC;\n\n\tif (substr($sort, 0, 4) === 'name')\n\t{\n\t\tarray_multisort($cols['name'], $sort_flag, SORT_REGULAR, $cols['path'], $cols['selected'], $cols['id']);\n\t}\n\telseif (substr($sort, 0, 4) === 'path')\n\t{\n\t\tarray_multisort($cols['path'], $sort_flag, SORT_REGULAR, $cols['name'], $cols['selected'], $cols['id']);\n\t}\n\telse\n\t{\n\t\tarray_multisort($cols['selected'], $sort_flag, SORT_REGULAR, $cols['path'], $cols['name'], $cols['id']);\n\t}\n\n\t$smiley_sets = array();\n\tforeach ($cols['id'] as $i => $id)\n\t{\n\t\t$smiley_sets[] = array(\n\t\t\t'id' => $id,\n\t\t\t'path' => $cols['path'][$i],\n\t\t\t'name' => $cols['name'][$i],\n\t\t\t'selected' => $cols['path'][$i] == $modSettings['smiley_sets_default']\n\t\t);\n\t}\n\n\treturn $smiley_sets;\n}",
"abstract protected function getEscapeSet() : array;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get ids of the account channels | public function channelids ()
{
# STANDBY: not making sense
# how can we relate to account
} | [
"public function getChannels();",
"public function findChannels() {\n\t\treturn $this->client->sendRequest(\"conversations.list\", $this->channel, ['exclude_archived' => true]);\n\t}",
"private function listChannels()\n {\n $channels = Auth::guard()->user()->channels->load('users');\n foreach($channels as $channel){\n foreach($channel->users as $key => $user){\n if ($user->id == Auth::guard()->user()->id){\n unset($channel->users[$key]);\n }\n }\n }\n return $channels;\n }",
"public static function getChannelsArray(): array\n {\n return static::getChannels()->pluck('channel')->toArray();\n }",
"public function getChannels(): array\n {\n return $this->channels;\n }",
"private function getITVids(){\n\n $valid_channels = $this->db->from('itv')->where(array('xmltv_id!=' => ''))->get()->all();\n\n $ids = array();\n\n foreach ($valid_channels as $channel){\n if (!array_key_exists($channel['xmltv_id'], $ids)){\n $ids[$channel['xmltv_id']] = array();\n }\n $ids[$channel['xmltv_id']][] = $channel['id'];\n }\n\n return $ids;\n }",
"public function getTopChannelIds()\n {\n return Channel::whereNull('parent_channel')->active()->lists('id');\n }",
"private function getChannels(): array\n {\n $selectChannels = $this->resource->getConnection()\n ->select()\n ->from(\n $this->resource->getTableName('inventory_stock_sales_channel'),\n [\n 'stock_id'\n ]\n )->where('type = ?', 'website');\n $channels = array_unique($this->resource->getConnection()->fetchCol($selectChannels));\n if (count($channels) == 1 && reset($channels) != 1) {\n $channels = [1];\n }\n return $channels;\n }",
"public static function getUniqChannels()\n {\n $queryBuilder = new Entity\\Query(LoggerTable::getEntity());\n $filterResult = $queryBuilder\n ->registerRuntimeField('CHANNEL',\n array('expression' => array('DISTINCT CHANNEL')\n ))\n ->setSelect(array('CHANNEL'))\n ->setOrder('ID')\n ->exec();\n\n $channelList = array();\n while ($channel = $filterResult->fetch()) {\n $channelList[] = array(\n 'text' => $channel['CHANNEL'],\n 'url' => sprintf('logger.php?filter_channel=%s&set_filter=Y', $channel['CHANNEL']),\n );\n }\n\n return $channelList;\n }",
"public function getChannels() {\n return $this->channels;\n }",
"private function _get_channel_ids_by_field($field)\n {\n return $field->getAllChannels()->pluck('channel_id');\n }",
"protected function moderatingChannels()\n {\n return Auth::user()->channelRoles->unique('name');\n }",
"public function channels()\n {\n if ($this->user) {\n $channels = $this->user->acceptedChannels()->get();\n return $channels;\n }\n\n return;\n }",
"public function getBubbleIds()\n {\n $organisations = $this->organisations->pluck('id')->toArray();\n $ids = [];\n\n /**\n * Get screen channels\n */\n $channels = ScreenChannel::where('screen_id', $this->id)\n ->with('channel')\n ->get();\n\n if (!$channels || !sizeof($channels)) {\n return $ids;\n }\n\n $channelWithoutFilters = $channels\n ->filter(function ($channel) {\n return !isset($channel->settings->filters) ||\n !is_array($channel->settings->filters) ||\n !sizeof($channel->settings->filters);\n })\n ->unique()\n ->values();\n $channelWithFilters = $channels\n ->filter(function ($channel) use ($channelWithoutFilters) {\n return !$channelWithoutFilters->contains($channel);\n })\n ->unique()\n ->values();\n\n /**\n * Get ids from channels without filters\n */\n if (sizeof($channelWithoutFilters)) {\n $byOrganisation = $channelWithoutFilters->filter(function ($channel) {\n return $channel->bubblesAreByOrganisation();\n });\n $anyOrganisation = $channelWithoutFilters->filter(function ($channel) {\n return !$channel->bubblesAreByOrganisation();\n });\n $bubbleIds = new Collection();\n if (sizeof($byOrganisation)) {\n $byOrganisationBubblesIds = Panneau::resource('bubbles')\n ->query([\n 'channel_id' => $byOrganisation->pluck('id')->toArray(),\n 'organisation_id' => $organisations,\n ])\n ->lists('bubbles.id');\n $bubbleIds = $bubbleIds->merge($byOrganisationBubblesIds);\n }\n if (sizeof($anyOrganisation)) {\n $anyOrganisationBubblesIds = Panneau::resource('bubbles')\n ->query([\n 'channel_id' => $anyOrganisation->pluck('id')->toArray(),\n ])\n ->lists('bubbles.id');\n $bubbleIds = $bubbleIds->merge($anyOrganisationBubblesIds);\n }\n foreach ($bubbleIds as $id) {\n $ids[] = $id;\n }\n }\n\n /**\n * Get ids from channels with filters\n */\n if (sizeof($channelWithFilters)) {\n foreach ($channelWithFilters as $channel) {\n $params = [\n 'channel_id' => $channel->channel_id,\n ];\n $filters = $channel->settings->filters;\n\n foreach ($filters as $filter) {\n if (isset($filter->value) && isset($filter->name) && !empty($filter->name)) {\n if (!isset($params['filter_' . $filter->name])) {\n $params['filter_' . $filter->name] = [];\n }\n if (is_array($filter->value)) {\n $notEmptyValues = array_where($filter->value, function ($key, $value) {\n return !empty($value);\n });\n if (sizeof($notEmptyValues)) {\n $params['filter_' . $filter->name] = array_unique(\n array_merge($params['filter_' . $filter->name], $notEmptyValues)\n );\n }\n } elseif (!empty($filter->value)) {\n $params['filter_' . $filter->name][] = $filter->value;\n }\n }\n }\n\n $notEmptyParams = array_where($params, function ($key, $value) {\n return !empty($value);\n });\n\n if ($channel->bubblesAreByOrganisation() && sizeof($organisations)) {\n $notEmptyParams['organisation_id'] = $organisations;\n }\n\n $bubbleIds = Panneau::resource('bubbles')\n ->query($notEmptyParams)\n ->lists('bubbles.id');\n foreach ($bubbleIds as $id) {\n $ids[] = $id;\n }\n }\n }\n\n /**\n * Get ids from playlists\n */\n $screenId = $this->id;\n $playlists = Playlist::whereHas('screens', function ($query) use ($screenId) {\n $query->where('screens.id', $screenId);\n })\n /*->join(\n 'screens_playlists_pivot',\n 'screens_playlists_pivot.playlist_id',\n '=',\n 'playlists.id'\n )\n ->where('screens_playlists_pivot.screen_id', $this->id)*/\n ->get();\n foreach ($playlists as $playlist) {\n $timeline = $playlist->getTimeline();\n foreach ($timeline->bubbleIds as $bubbleId) {\n $ids[] = $bubbleId;\n }\n }\n\n $ids = array_unique($ids);\n sort($ids);\n\n return $ids;\n }",
"function &getCustomChannels() {\n\t\t$channels = null;\n\t\t$acc = AJAXChatChannels::model()->findAll();\n\t\tforeach($acc as $channel) {\n\t\t\t$channels[$channel->orderID]=$channel->name;\n\t\t}\n\t\treturn $channels;\n\t}",
"public function notificationChannels(): array;",
"public function getChannelId();",
"public function listChannels()\n {\n return $this->httpGet(\"/\" . self::API_VERSION . \"/channels\");\n }",
"public function getUserChannels($uid) {\n\n $channels = DB::table('channels')\n ->join('rights', 'rights.pagepath', '=', 'channels.channel_id')\n ->join('user_rights', 'user_rights.rights_id', '=', 'rights.rights_id')\n ->select('channels.*')\n ->where('rights.label', '=', 'channel')\n ->where('user_rights.user_id', '=', $uid)\n ->get();\n\n return $channels;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retorna todas as wishlists ativas do usuario se withGames for true, retorna junto os jogos de cada lista | public function getWishListsByUser($username, $withGames = false, $term = false): array
{
if ($withGames) {
//verifica se ha termo de busca
$searchTerm = $term ? " AND (g.name LIKE :search OR g.alt_name_1 LIKE :search OR g.alt_name_2 LIKE :search) " : "";
//busca wishlists e os jogos de cada uma
$query = $this->pdo->prepare('SELECT w.*, u.username, g.id as id_game, g.name, '
. 'g.plain, g.igdb_cover FROM wishlists AS w INNER JOIN users as u ON(w.id_user = u.id) '
. 'LEFT JOIN wishlist_games AS wg ON (w.id = wg.id_wishlist) LEFT JOIN games AS g ON '
. '(wg.id_game = g.id) WHERE w.active = 1 AND u.active = 1 AND u.username = :username ' . $searchTerm . ' ORDER BY w.id DESC');
$query->bindValue(':username', $username);
if ($searchTerm) {
//caso tenha 4 caracteres ou mais, utilzia query LIKE %termo%
$term = strlen($term) < 4 ? $term . '%' : '%' . $term . '%';
$query->bindValue(':search', $term);
}
$run = $query->execute();
$wishlistsItems = $query->fetchAll(\PDO::FETCH_ASSOC);
//estrutura wishlists + jogos de cada uma em um array
$wishlistsGames = $this->makeWishlistArray($wishlistsItems);
return $wishlistsGames;
} else {
//busca apenas wishlists e as retorna
$query = $this->pdo->prepare('SELECT w.*, u.username FROM wishlists as w INNER JOIN users as u '
. 'ON (w.id_user = u.id) WHERE w.active = 1 AND u.active = 1 AND '
. 'u.username = :username ORDER BY id DESC');
$query->bindValue(':username', $username);
$run = $query->execute();
$wishlists = $query->fetchAll(\PDO::FETCH_ASSOC);
return $wishlists;
}
} | [
"public function getAllWishlists($withGames = false, $term = false): array\n {\n if ($withGames) {\n \n //verifica se ha termo de busca\n $searchTerm = $term ? \" AND (g.name LIKE :search OR g.alt_name_1 LIKE :search OR g.alt_name_2 LIKE :search) \" : \"\";\n //busca wishlists e os jogos de cada uma\n $query = $this->pdo->prepare('SELECT w.*, u.username, g.id as id_game, g.name, g.plain, g.igdb_cover '\n . 'FROM wishlists AS w INNER JOIN users as u ON(w.id_user = u.id) LEFT JOIN wishlist_games AS wg ON (w.id = wg.id_wishlist) '\n . 'LEFT JOIN games AS g ON (wg.id_game = g.id) WHERE w.active = 1 AND u.active = 1 ' . $searchTerm . ' ORDER BY w.id DESC');\n if ($searchTerm) {\n //caso tenha 4 caracteres ou mais, utilzia query LIKE %termo%\n $term = strlen($term) < 4 ? $term . '%' : '%' . $term . '%';\n $query->bindValue(':search', $term);\n }\n $run = $query->execute();\n $wishlistsItems = $query->fetchAll(\\PDO::FETCH_ASSOC);\n //estrutura wishlists + jogos de cada uma em um array\n $wishlistsGames = $this->makeWishlistArray($wishlistsItems);\n return $wishlistsGames;\n } else {\n //busca apenas wishlists e as retorna\n $wishlists = $this->pdo\n ->query('SELECT w.*, u.username FROM wishlists as w INNER JOIN users as u '\n . 'ON (w.id_user = u.id) WHERE w.active = 1 AND u.active = 1 ORDER BY id DESC')\n ->fetchAll(\\PDO::FETCH_ASSOC);\n return $wishlists;\n }\n }",
"public function getWishlistsByUser();",
"public function displayWishlist()\n {\n $wishlist = Wishlist::wishlistGames(Auth::user()->id);\n\n $wishlist_games = [];\n\n foreach ($wishlist as $game) {\n $wishlist_game = Videogame::getGamesById($game->game_id);\n array_push($wishlist_games, ...$wishlist_game);\n }\n\n return Inertia::render(\"Games/Wishlist\", [\n \"wishlist_games\" => $wishlist_games,\n ]);\n }",
"function getWishLists() {\n $wishList = \"\";\n $ip = Yii::app()->request->getUserHostAddress();\n if (isset(Yii::app()->user->id)) {\n\n $wishList = $this->findAll('city_id=' . Yii::app()->session['city_id'] . ' AND (user_id=' . Yii::app()->user->user_id . ' OR session_id=\"' . $ip . '\")');\n } else {\n $wishList = $this->findAll('city_id=' . Yii::app()->session['city_id'] . ' AND session_id=\"' . $ip . '\"');\n }\n\n return $wishList;\n }",
"public function getWishlists()\n {\n return Wishlist::byUser(Auth::getUser());\n }",
"public function getPlaylists(){\n\n $genre = $this->request->getVar(\"chosenGenre\");\n $playlistModel = new PlaylistModel();\n $userPlaylistModel = new UserPlaylistModel();\n $userInfoModel = new UserInfoModel();\n\n $userInfo = $userInfoModel->where(\"genre\", $genre)->where(\"username\", $this->session->get(\"username\"))->findAll();\n\n $playlists = $playlistModel->where(\"genre\", $genre)->findAll();\n $userPlaylists = $userPlaylistModel->where(\"idU\", $userInfo[0]->idU)->findAll();\n\n foreach($playlists as $playlist){\n $flag = false;\n foreach ($userPlaylists as $userPlaylist){\n if($playlist->idP == $userPlaylist->idP){\n $flag = true;\n break;\n }\n }\n if($flag == true) {\n echo $playlist->difficulty . \",\" . $playlist->number . \",\" . $playlist->price . \",\" . $playlist->idP . \",\" . \"unlocked\" . \"/\";\n }\n else {\n echo $playlist->difficulty . \",\" . $playlist->number . \",\" . $playlist->price . \",\" . $playlist->idP . \",\" . \"locked\" . \"/\";\n }\n }\n }",
"public static function listGames() {\n //$games = Game::all();\n $games = Cache::remember('games_nav', $_ENV ['week'], function () {\n return Game::all();\n });\n return $games;\n }",
"function getWinningPlayers(Game $game);",
"public function getAvailableGamesList(){\n\t\t\n\t\t//Grab the passed data \n\t\t$jsonData = $this->params['url'];\n\t\t\n\t\t//Grab the UID for the currently logged in user if one wasn't specified\n\t\tif( isset( $jsonData['userUID'] ) ){\n\t\t\t$userUID = $jsonData['userUID'];\t\n\t\t}else{\n\t\t\t$userUID = $this->Auth->user('uid'); \t\n\t\t}\n\t\t\n\t\t//Grab the games\n\t\t$games \t\t\t\t\t\t\t= $this->UserGame->getGamesByUserUID( $userUID );\n\t\t\n\t\t//Grab all of the pending matches\n\t\t$matchmakingQueueModelInstance \t= ClassRegistry::init( 'MatchmakingQueue' );\n\t\t$pendingMatches\t\t\t\t\t= $matchmakingQueueModelInstance->getPendingGamesByUserUID( $userUID );\n\t\t\n\t\t//And toss it all back\n\t\t$this->set( 'games', \t\t\t$games );\n\t\t$this->set( 'pendingMatches', \t$pendingMatches );\n\t\t$this->set( '_serialize', [\n\t\t\t\t\t\t'games',\n\t\t\t\t\t\t'pendingMatches'\n\t\t\t\t\t]);\n\t\t\n\t}",
"function favoritesList( ) {\n\n global $wpdb;\n\n global $user;\n \n $results = $wpdb->get_results( \n $wpdb->prepare(\"SELECT {$wpdb->prefix}favorite.status as status, {$wpdb->prefix}posts.* FROM {$wpdb->prefix}favorite \n inner join {$wpdb->prefix}posts on {$wpdb->prefix}favorite.id_post = {$wpdb->prefix}posts.id and {$wpdb->prefix}favorite.status = 1 and {$wpdb->prefix}favorite.user_id = $user \"\n ) \n );\n \n return $results ; \n }",
"public function getGameLinks(){\n\t\t//where gameStatus = accepted\n $qry = \"SELECT gameID, gameName FROM hy_games WHERE gameStatus='accepted'\";\n $result=$this->get($qry); \n return $result;\n }",
"function asb_mysteamlist_build_list($settings, $width)\n{\t\n\tglobal $mybb, $lang, $templates;\n\t\n\t// Make sure the main plugin's functions are available (may not be if it's disabled).\n\tif (function_exists(mysteam_check_cache))\n\t{\n\t\t// Read the cache, or refresh it if too old.\n\t\t$steam = mysteam_check_cache();\n\t}\n\t\n\t// If no users to display, show error.\n\tif (!$steam['users'])\n\t{\n\t\treturn false;\n\t}\n\t\n\t// If set to display multiple columns, reduce each status entry's width accordingly.\n\tif ((int) $settings['asb_steam_list_cols'] < 2)\n\t{\n\t\t$entry_width = $width - 5;\n\t}\n\telse\n\t{\n\t\t$col_number = (int) $settings['asb_steam_list_cols'];\n\t\t$entry_width = ($width - (5 + (5 * $col_number))) / $col_number;\n\t}\n\t\n\t// Sort users who are in-game to top of list.\n\tforeach ($steam['users'] as $steam_presort)\n\t{\t\n\t\tif ($steam_presort['steamgame'])\n\t\t{\n\t\t\t$steam_presort_game[] = $steam_presort;\n\t\t}\n\t\telseif ($steam_presort['steamstatus'] > 0)\n\t\t{\n\t\t\t$steam_presort_online[] = $steam_presort;\n\t\t}\n\t}\n\t\n\t$steam['users'] = array_merge((array)$steam_presort_game, (array)$steam_presort_online);\t\n\t$n = 0;\n\n\t// Check each user's info and generate status entry.\n\tforeach ($steam['users'] as $user)\n\t{\t\n\t\t// Check display name setting, and set displayed name appropriately.\n\t\tif ($mybb->settings['mysteam_displayname'] == 'steam')\n\t\t{\n\t\t\t$displayname = $user['steamname'];\n\t\t}\n\t\telseif ($mybb->settings['mysteam_displayname'] == 'forum')\n\t\t{\n\t\t\t$displayname = $user['username'];\n\t\t}\n\t\t// Remove capitals, numbers, and special characters name to minimize false negatives when checking if username and steamname are comparable.\n\t\telse\n\t\t{\n\t\t\t$username_clean = preg_replace(\"/[^a-zA-Z]+/\", \"\", strtolower($user['username']));\n\t\t\t$steamname_clean = preg_replace(\"/[^a-zA-Z]+/\", \"\", strtolower($user['steamname']));\n\t\t\t\n\t\t\t// If names aren't comparable, display both steam name and forum username.\n\t\t\tif (strpos($steamname_clean, $username_clean) === FALSE && strpos($username_clean, $steamname_clean) === FALSE)\n\t\t\t{\n\t\t\t\t// If status entry is too narrow, place names on separate lines.\n\t\t\t\tif ($entry_width < '200')\n\t\t\t\t{\n\t\t\t\t\t$displayname = $user['steamname']. '<br />(' .$user['username']. ')';\n\t\t\t\t\t$position = 'bottom: 3px;';\n\t\t\t\t}\n\t\t\t\t// If names are comparable, display the Steam name.\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$displayname = $user['steamname']. ' (' .$user['username']. ')';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$displayname = $user['steamname'];\n\t\t\t}\n\t\t}\n\t\n\t\t// Generate status text and display style based on current status.\n\t\tif (!empty($user['steamgame']))\n\t\t{\n\t\t\t$steam_state = $user['steamgame'];\n\t\t\t$avatar_class = 'steam_avatar_in-game';\n\t\t\t$color_class = 'steam_in-game';\n\t\t}\n\t\telseif ($user['steamstatus'] == '1')\n\t\t{\n\t\t\t$steam_state = $lang->mysteam_online;\n\t\t\t$avatar_class = 'steam_avatar_online';\n\t\t\t$color_class = 'steam_online';\n\t\t}\n\t\telseif ($user['steamstatus'] == '3')\n\t\t{\n\t\t\t$steam_state = $lang->mysteam_away;\n\t\t\t$avatar_class = 'steam_avatar_online';\n\t\t\t$color_class = 'steam_online';\n\t\t}\n\t\telseif ($user['steamstatus'] == '4')\n\t\t{\n\t\t\t$steam_state = $lang->mysteam_snooze;\n\t\t\t$avatar_class = 'steam_avatar_online';\n\t\t\t$color_class = 'steam_online';\n\t\t}\n\t\telseif ($user['steamstatus'] == '2')\n\t\t{\n\t\t\t$steam_state = $lang->mysteam_busy;\n\t\t\t$avatar_class = 'steam_avatar_online';\n\t\t\t$color_class = 'steam_online';\n\t\t}\n\t\telseif ($user['steamstatus'] == '5')\n\t\t{\n\t\t\t$steam_state = $lang->mysteam_looking_to_trade;\n\t\t\t$avatar_class = 'steam_avatar_online';\n\t\t\t$color_class = 'steam_online';\n\t\t}\n\t\telseif ($user['steamstatus'] == '6')\n\t\t{\n\t\t\t$steam_state = $lang->mysteam_looking_to_play;\n\t\t\t$avatar_class = 'steam_avatar_online';\n\t\t\t$color_class = 'steam_online';\n\t\t}\n\n\t\t// Don't generate entries for users in excess of the maximum number setting.\n\t\tif ($settings['asb_steam_list_number'])\n\t\t{\n\t\t\t$n++;\n\t\t\t\n\t\t\tif ($n > (int) $settings['asb_steam_list_number'])\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\teval(\"\\$asb_list_entries .= \\\"\" . $templates->get(\"mysteam_list_user\") . \"\\\";\");\n\t}\n\t\n\tif ($asb_list_entries)\n\t{\n\t\t// Set template variable to returned statuses list and return true\n\t\teval(\"\\$asb_mysteamlist = \\\"\" . $templates->get(\"asb_mysteam\") . \"\\\";\");\n\t\treturn $asb_mysteamlist;\n\t}\n\treturn false;\n}",
"function checkAllAreOut() {\n\t$con = $GLOBALS['con'];\n\t$gottMosAreOut = TRUE;\n\t$fubbicksAreOut = TRUE;\n\t$usernames = getAllUsernamesList($con, \"ActiveUsers\");\n\tforeach ($usernames as $name) {\n\t\tif (returnFieldForUser(\"ActiveUsers\", 5, $name) == 0) {\n\t\t\t// Is a fubbick\n\t\t\tif (returnFieldForUser(\"ActiveUsers\", 10, $name) == 0) {\n\t\t\t\t// This fubbick is living\n\t\t\t\t$fubbicksAreOut = FALSE;\n\t\t\t}\n\t\t} else if (returnFieldForUser(\"ActiveUsers\", 5, $name)) {\n\t\t\t// Is a Gottmosare\n\t\t\tif (returnFieldForUser(\"ActiveUsers\", 10, $name) == 0) {\n\t\t\t\t// This gotymosaer is living\n\t\t\t\t$gottMosAreOut = FALSE;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif ($gottMosAreOut) {\n\t\tmysqli_query_trace($con, \"UPDATE ActiveGame SET EndGame='1'\");\n\t\tmysqli_query_trace($con, \"UPDATE ActiveGame SET GottmosIsWinner='0'\");\n\t\tredirect(\"gameEnded.php\");\n\t\tdie();\n\t} else if ($fubbicksAreOut) {\n\t\tmysqli_query_trace($con, \"UPDATE ActiveGame SET EndGame='1'\");\n\t\tmysqli_query_trace($con, \"UPDATE ActiveGame SET GottmosIsWinner='1'\");\n\t\tredirect(\"gameEnded.php\");\n\t\tdie();\n\t}\n}",
"public function getUserSubscribedGames()\r\n\t{\r\n\t\t$table = $this->getDbTable();\r\n\t\t$select = $table->select();\r\n\t\t$select->setIntegrityCheck(false);\r\n\t\t\r\n\t\t$select->from(array('g' => 'games'))\r\n\t\t\t ->join(array('gs' => 'game_subscribers'),\r\n\t\t\t \t\t 'g.gameID = gs.gameID')\r\n\t\t\t ->join(array('u' => 'users'),\r\n\t\t\t \t\t 'u.userID = gs.userID')\r\n\t\t\t ->joinLeft(array('ug' => 'user_games'),\r\n\t\t\t \t\t\t 'ug.userID = gs.userID AND g.gameID = ug.gameID',\r\n\t\t\t\t\t\t array(''))\r\n\t\t\t ->where('DATE(DATE_ADD(g.date, INTERVAL -1 DAY)) = CURDATE()')\r\n\t\t\t ->where('g.recurring = 1')\r\n\t\t\t ->where('ug.userGameID IS NULL')\r\n\t\t\t ->where('gs.doNotEmail = 0');\r\n\t\t\t \r\n\t\t$results = $table->fetchAll($select);\r\n\t\t\r\n\t\t$returnArray = array();\r\n\t\t\r\n\t\tforeach ($results as $result) {\r\n\t\t\tif (!isset($returnArray[$result->gameID])) {\r\n\t\t\t\t// New game\r\n\t\t\t\t$game = new Application_Model_Game($result);\r\n\t\t\t\t\r\n\t\t\t\t$returnArray[$result->gameID] = $game;\r\n\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t$returnArray[$result->gameID]->players->addUser($result);\r\n\t\t}\r\n\t\t\r\n\t\treturn $returnArray;\r\n\t}",
"public function isInWishList()\n {\n $pdo = static::getDB();\n $sql = \"select count(*) from wishlists w, products p where w.product_id = p.product_id and w.user_id = :user_id and p.product_id = :product_id\";\n $result = $pdo->prepare($sql);\n $result->execute([\n 'user_id' => Auth::getUserId(),\n 'product_id' => $this->PRODUCT_ID\n ]);\n\n $rowsCount = $result->fetchColumn(); \n\n if($rowsCount >= 1){\n return true;\n }\n return false;\n }",
"public function favorites(){\n $ids = DB::table('wrestler_favorites')->select('wrestler_id')->where('user_id', $this->id)->get();\n\n $id_array = [];\n for($i = 0; $i < count($ids); $i++){\n array_push($id_array, get_object_vars($ids[$i]));\n }\n $wrestlers = Wrestler::whereIn('id', $id_array)->get();\n return $wrestlers;\n }",
"function getWisApps(){\n\t\n\t\t$wisapps = $this->Wisapp->find('id', array(\"conditions\"=>array(\"wis_id\"=>$this_id, \"status\"=>1)));\n\t\t$favorites = array();\n\t\t\n\t\tforeach($wisapps as $wisapp){\n\t\t\t$favorites[] = new Wisapp($wisapp['Wisapp']['id']);\t\n\t\t}\n\t\t\n\t\treturn $favorites;\n\t\n\t}",
"public function lentesPorOni(){\n foreach($this->users_wordpress as $user){\n foreach($this->lentes as $lente){\n while ( $lente->have_posts() ) : $lente->the_post(); \n $this->lentes_por_oni[$user->user_nicename][get_the_title()] = false;\n endwhile;\n while ( $this->evolucoes->have_posts() ) : $this->evolucoes->the_post(); \n $campos = get_fields();\n \n if($campos['oni'] == $user && $campos['lente']){\n $this->lentes_por_oni[$user->user_nicename][$campos['lente']->post_title] = true;\n }\n endwhile;\n }\n \n }\n\n }",
"private function getRelevantGames() {\n // query the database\n $dir = 'sqlite:C:\\Apache24\\htdocs\\rps-game\\server\\db\\game.db';\n $dbh = new \\PDO($dir) or die(\"cannot open the database\");\n $query = $dbh->prepare('SELECT * FROM games');\n $query->execute(array());\n $results = $query->fetchAll();\n\n // process the results\n $games = array(\n 'myGames' => array(),\n 'openGames' => array(),\n );\n foreach ($results as $value) {\n $gameObj = \\GuzzleHttp\\json_decode($value['game_state']);\n if (!$gameObj->isGameOver) {\n\n // currently playing this game\n if (\n $gameObj->player1->name == $this->sender->name\n || $gameObj->player2->name == $this->sender->name\n ) {\n $games['myGames'][$value['game_id']] = $gameObj;\n continue;\n }\n\n // this game has an empty seat\n if (\n $gameObj->player1->name == FALSE\n || $gameObj->player2->name == FALSE\n ) {\n $games['openGames'][$value['game_id']] = $gameObj;\n continue;\n }\n\n }\n }\n\n return $games;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
did user press "submit new user" | public function submitNewUser(){
if(isset($_POST["submit"])){
return true;
} else {
return false;
}
} | [
"function newUserSubmitted() {\n\t\terror_log(\"newUserSubmitted\");\n\n\t\t$firstname = $this->config->getRequestVar(\"firstName\");\n\t\t$lastname = $this->config->getRequestVar(\"lastName\");\n\t\t$email = $this->config->getRequestVar(\"email\");\n\t\t$user = User::NewUser($firstname,$lastname,$email);\n\t\t$user->save();\n\t\t\n\t\t$redirect = $this->config->getRequestVar(\"r\");\n\t\t$versionUUID = $this->config->getRequestVar(\"v\");\n\t\t$redirectURL = $this->config->baseURL . \"?a=\" . $redirect;\n\t\tif($versionUUID) {\n\t\t\t$redirect .= '&v=' . $versionUUID;\n\t\t}\n\t\theader(\"Location: \" . $this->config->baseURL . \"?a=\" . $redirect);\n\t}",
"public function add_submit()\n\t{\n\t\tif (!is_admin())\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Validation rules\n\t\t$regex = '/^[a-zA-Z0-9_]{1,60}$/';\n\t\t$this->form_validation->set_rules('username', lang('username'), 'trim|required|max_length[20]|regex_match[ ' . $regex . ']|is_unique[user.username]');\n\t\t$this->form_validation->set_rules('password', lang('password'), 'required|min_length[8]|max_length[72]|matches[password_conf]');\n\t\t$this->form_validation->set_rules('password_conf', lang('password_conf'), 'required');\n\t\t$this->form_validation->set_rules('email', lang('email'), 'trim|required|valid_email');\n\t\t$this->validate_user();\n\n\t\t// Run validation\n\t\tif ($this->form_validation->run() == FALSE)\n\t\t{\n\t\t\t// If not succeeded, show form again with error messages\n\t\t\t$this->add();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// If succeeded, insert user into database\n\t\t\t$user = $this->post_user();\n\t\t\t$this->userModel->add_user($user);\n\n\t\t\tflashdata(lang('user_added'));\n\t\t\tredirect($this->input->post('referrer'), 'refresh');\n\t\t}\n\t}",
"public function submit(): void\n {\n\n $user = $this->model;\n\n $postArray = $user->collectInput('POST'); // collect global $_POST data\n\n $style = 'success';\n $message = '';\n \n if (!empty($postArray) AND isset($postArray['submit']) AND isset($postArray['email_address']))\n {\n $user_exist = $user->find($postArray['email_address'], 'email_address'); // search if a user with this email address already exists\n \n if($user_exist)\n {\n $style = 'warning';\n $message = 'Cette adresse email existe déjà dans la base des utilisateurs. Connectez-vous à votre compte ou choisissez une autre adresse email.';\n }\n \n if(!$user_exist)\n {\n $user->status = self::STATUS_SUBMITTED;\n $user->role = self::ROLE_AUTHOR;\n $this->dataTransform($user, $postArray);\n\n $user->id = $user->insert();\n\n if($user->id == 0)\n {\n $style = 'danger';\n $message = 'Une erreur est survenue pendant l\\'enregistrement.';\n } \n if($user->id !== 0)\n {\n $message = 'Votre demande d\\'inscription a bien été enregistrée pour validation par un administrateur.';\n\n if(NOTIFY['new_user'] == 1) // if new user notification is enabled\n {\n // Try to notify the site owner of the new registration\n try\n {\n $serverArray = $this->collectInput('SERVER');\n $baseUrl = 'http://'.$serverArray['HTTP_HOST'].$serverArray['PHP_SELF'];\n $body = \"Un nouvel utilisateur vient d'être enregistré : {$baseUrl}?controller=user&task=edit&id={$user->id}\";\n if (!$this->sendEmail(SITE_NAME,'noreply@myblog.fr','Nouvel utilisateur enregistré',$body))\n {\n throw new Throwable();\n }\n }\n catch (Throwable $e)\n {\n // Uncomment in dev context:\n $error = sprintf('Erreur : %1$s<br>Fichier : %2$s<br>Ligne : %3$d', $e->getMessage(), $e->getFile(), $e->getLine());\n echo filter_var($error, FILTER_SANITIZE_STRING);\n }\n }\n }\n }\n\n }\n\n $this->display('front', 'register', 'Inscription', compact('message','style'));\n\n }",
"public function processUserCreateAction()\r\n {\r\n \t// 1. user has to be logged in and the right user/group permissions\r\n \t$this->testPermisions();\r\n \t// 2.\r\n \t$params = Helper::getRequestParams('post');\r\n \t \r\n \t// post is coming through\r\n \tif(is_array($params) && count($params)) {\r\n \r\n \t\t// add params to the session to refill form on error an reload\r\n \t\t$this->Session->setPostData($params);\r\n \t\t \r\n \t\tif($this->Data->addNewUser($params) === true) {\r\n \t\t\t \r\n \t\t\t// clear the form date from session\r\n \t\t\t$this->Session->clearFormData();\r\n \t\t\t \r\n \t\t\t$this->Session->setSuccess($this->Lang->get('account_user_edit_form_base_success'));\r\n \t\t\tHelper::redirectTo('/account/user/index/');\r\n \t\t\texit;\r\n \t\t\t \r\n \t\t} else {\r\n \t\t\t \r\n \t\t\tHelper::redirectTo('/account/user/adduser/');\r\n \t\t\texit;\r\n \t\t}\r\n \t\t \r\n \t} else {\r\n \t\t \r\n \t\t$this->Session->setError($this->Lang->get('account_user_edit_form_base_error_nodatagiven'));\r\n \t\tHelper::redirectTo('/account/user/adduser/');\r\n \t\texit;\r\n \t\t \r\n \t}\r\n \t \r\n \treturn false;\r\n }",
"public function process_new_user()\n\t{\n\t\t$this->load->library('form_validation', $this->Dashboard_m->user_form_rules);\n\t\tif ($this->form_validation->run() == FALSE) {\n\t\t\t$this->create_user_account();\n\t\t} else {\n\t\t\t$data = $this->Dashboard_m->process_new_user();\n\t\t\t$this->load_my_views('Agency/new_user_result_v', $data);\n\t\t}\n\t}",
"public function newUserAction()\n {\n $user = (new UserModel())->createUser();\n echo (new View('userCreated'))\n ->addData('user', $user)\n ->render();\n }",
"public function testNewUserIsAddedThroughForm()\n {\n $user = User::find(3);\n\n $newUserAttributes = [\n 'first_name' => 'Bob',\n 'last_name' => 'Jackson',\n 'email' => 'bob@jackson.com'\n ];\n\n $this->browse(function ($browser) use ($user, $newUserAttributes) {\n $browser\n ->loginAs($user)\n ->visit(new AdminNewUserPage)\n ->type('@new-user-firstname', $newUserAttributes['first_name'])\n ->type('@new-user-lastname', $newUserAttributes['last_name'])\n ->type('@new-user-email', $newUserAttributes['email'])\n ->press('Add User')\n ->pause(2000);\n });\n\n $this->assertDatabaseHas('users', [\n 'first_name' => $newUserAttributes['first_name'],\n 'last_name' => $newUserAttributes['last_name'],\n 'email' => $newUserAttributes['email'],\n ]);\n }",
"public function callbackSubmit() : bool\n {\n\n $userHelper = new \\Anax\\User\\UserHelper();\n $user = $userHelper->getUser();\n\n \n\n $db = $this->di->get(\"dbqb\");\n\n $tags = $this->form->value(\"tags\");\n $title = $this->form->value(\"title\");\n $text = $this->form->value(\"text\");\n $date = date(\"Y-m-d H:i\");\n $userId = $user[\"id\"];\n $questionId = $this->generateRandomId();\n \n\n \n $db->connect()\n ->insert(\"Question\", [\"id\", \"title\", \"text\", \"userId\", \"date\"])\n ->execute([$questionId, $title, $text, $userId, $date ]);\n \n $this->insertTags($db, $tags, $questionId);\n\n $this->form->addOutput(\"Question was created.\");\n \n return false;\n }",
"public function add()\n\t{\n\t\tif (!is_admin())\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$data['page_title'] = lang('add_user');\n\t\t$data['action'] = 'user/add_submit';\n\t\t$data['new_user'] = TRUE;\n\t\t$data['referrer'] = $this->agent->referrer();\n\t\t$data = add_fields($data, 'user');\n\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->load->view('user_edit_view', $data);\n\t\t$this->load->view('templates/footer');\n\t}",
"public function createAction() {\n\t\tif (Minz_Request::isPost() && (\n\t\t\t\tFreshRSS_Auth::hasAccess('admin') ||\n\t\t\t\t!max_registrations_reached()\n\t\t)) {\n\t\t\t$new_user_name = Minz_Request::param('new_user_name');\n\t\t\t$passwordPlain = Minz_Request::param('new_user_passwordPlain', '', true);\n\t\t\t$new_user_language = Minz_Request::param('new_user_language', FreshRSS_Context::$user_conf->language);\n\n\t\t\t$ok = self::createUser($new_user_name, $passwordPlain, '', array('language' => $new_user_language));\n\t\t\tMinz_Request::_param('new_user_passwordPlain');\t//Discard plain-text password ASAP\n\t\t\t$_POST['new_user_passwordPlain'] = '';\n\t\t\tinvalidateHttpCache();\n\n\t\t\t$notif = array(\n\t\t\t\t'type' => $ok ? 'good' : 'bad',\n\t\t\t\t'content' => _t('feedback.user.created' . (!$ok ? '.error' : ''), $new_user_name)\n\t\t\t);\n\t\t\tMinz_Session::_param('notification', $notif);\n\t\t}\n\n\t\t$redirect_url = urldecode(Minz_Request::param('r', false, true));\n\t\tif (!$redirect_url) {\n\t\t\t$redirect_url = array('c' => 'user', 'a' => 'manage');\n\t\t}\n\t\tMinz_Request::forward($redirect_url, true);\n\t}",
"function bibdk_provider_accept_form_submit($form, &$form_state) {\n $mail = strtolower($form_state['values']['mail']);\n\n // Tjek if user exists as provider user\n $user_exists = ding_provider_invoke('user', 'verify', $mail);\n\n\n if ($user_exists) {\n // Tjek if user exists in drupal. If not create one\n if (!$account = user_load_by_mail($mail)) {\n $account = _ding_user_create_account($mail, array());\n }\n bibdk_provider_wayf_confirm_existing_user($account);\n\n }\n else {\n bibdk_provider_wayf_accept_create_new_user($mail);\n }\n\n $form_state['redirect'] = '';\n\n}",
"public function createAction() {\n\t\t$user = new User($_POST);\n\n\t\tif ($user->save()) {\n\t\t\t$user->sendActivationEmail();\n\t\t\t$this->redirect('users/success');\n\t\t} else {\n\t\t\tFlash::addMessage('Unable to create user', Flash::DANGER);\n\t\t\tViews::renderTemplate('users/new.html.twig', [ 'user' => $user ]);\n\t\t}\n\n\t}",
"public function new_user() {\r\n\t\tMainWP_Child_Users::get_instance()->new_user();\r\n\t}",
"public function add_user(){\n\t\t$this->model('LoginModel');\n\t\t$email = $_POST['email'];\n\t\t$password = $_POST['password'];\n\t\t//https://stackoverflow.com/questions/4356289/php-random-string-generator/31107425#31107425\n\t\t$token = substr(md5(mt_rand()), 0, 100);\n\t\t$mail = new Mail('Oblig.tarves.no epost verifisering',$email,'/login/verify');\n\t\t$mail->setMailBody('Trykk på linken for å verifisere epost',$token,'Link');\n\t\t$successfullyAdded = $this->model->register($email,$password,$token);\n\t\tif($successfullyAdded){\n\t\t\t$mail->sendMail();\n\t\t}\t\n\t\t$this->view('login'.'/'.'register.php',[$successfullyAdded]);\n\t\t$this->view->render();\t\n\t\t\n\t}",
"function showNewUserForm() {\n\t\tif ( !$this->isCached($this->getTpl('newUserForm')) ) {\n\t\t\t$this->getEngine()->assign('formAction', $this->buildUriPath(userManagerController::ACTION_NEW));\n\t\t}\n\t\t$this->render($this->getTpl('newUserForm'));\n\t}",
"function eu4all_um_usercreated_handler($user){\n\tEU4ALL_UserModel::sendRegistrationEvent($user->username);\n\tEU4ALL_UserModel::setPersonalUserData($user->username);\n\t\n\treturn true;\n}",
"private function insertUser(){\n\t\t$data['tipoUsuario'] = Seguridad::getTipo();\n\t\tView::show(\"user/insertForm\", $data);\n\t}",
"public function createUser()\n {\n #Create url and redirect to create.\n $url = $this->di->get(\"url\")->create(\"user/create\");\n $this->di->get(\"response\")->redirect($url);\n }",
"function restauth_form_user_register_form_alter(&$form, $form_state) {\n if (variable_get('restauth_server')) {\n $form['#validate'][] = 'restauth_validate_new_user';\n $form['#submit'] = array('restauth_user_register_submit');\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the volume id from the volume source | protected function _volumeIdBySourceKey(string $sourceKey)
{
$parts = explode(':', $sourceKey, 2);
if (count($parts) !== 2) {
return null;
}
/** @var Volume|null $volume */
$volume = Craft::$app->getVolumes()->getVolumeByUid($parts[1]);
return $volume ? $volume->id : null;
} | [
"public function getVolumeId()\n {\n return $this->volume_id;\n }",
"public function getVolumeId() \n {\n return $this->_fields['VolumeId']['FieldValue'];\n }",
"protected function _folderSourceToVolumeSource($sourceKey): string\n {\n if ($sourceKey && is_string($sourceKey) && strpos($sourceKey, 'folder:') === 0) {\n $parts = explode(':', $sourceKey);\n $folder = Craft::$app->getAssets()->getFolderByUid($parts[1]);\n\n if ($folder) {\n try {\n /** @var Volume $volume */\n $volume = $folder->getVolume();\n return 'volume:' . $volume->uid;\n } catch (InvalidConfigException $e) {\n // The volume is probably soft-deleted. Just pretend the folder didn't exist.\n }\n }\n }\n\n return (string)$sourceKey;\n }",
"public function getSourceId()\n {\n return $this->getData('source_id');\n }",
"public function getSourceId() {\n return $this->_source_id;\n }",
"public function getSourceId() {\n\t\treturn $this->_sourceId;\n\t}",
"public function sourceObjectId()\n {\n return $this->sourceObjectId;\n }",
"protected function getSourceID()\n\t{\n\t\t$source_id = NULL;\n\t\t\n\t\tswitch ($this->call_type)\n\t\t{\n\t\t\tcase self::TYPE_IDVE_IMPACT:\t$source_id = 5; break;\n\t\t\tcase self::TYPE_PDX_REWORK:\t\t$source_id = 6; break;\n\t\t\tcase self::TYPE_IDVE_IFS:\t\t$source_id = 12; break;\n\t\t\tcase self::TYPE_IDVE_IPDL:\t\t$source_id = 13; break;\n\t\t\tcase self::TYPE_IDVE_ICF:\t\t$source_id = 14; break;\n\t\t}\n\t\t\n\t\treturn $source_id;\n\t}",
"public function getIdSource()\n {\n return $this->id_source;\n }",
"public function getSourceID()\n {\n return $this->sourceID;\n }",
"function getAvailableVolumeID()\n {\n // Determine best suited volume and returns it's ID\n $c = $this->ref(\"filestore_volume_id\")\n ->addCondition('enabled', true)\n ->addCondition('stored_files_cnt', '<', 4096*256*256)\n ;\n $id = $c->dsql('select')\n ->field($this->id_field)\n ->order($this->id_field, 'asc') // to properly fill volumes, if multiple\n ->limit(1)\n ->getOne();\n if ($id !== null) {\n $c->tryLoad($id);\n }\n \n if (!$c->loaded()) {\n throw $this->exception('No volumes available. All of them are full or not enabled.');\n }\n\n /*\n if(disk_free_space($c->get('dirname') < $filesize)){\n throw new Exception_ForUser('Out of disk space on volume '.$id);\n }\n */\n\n return $id;\n }",
"public function getTransferVolumeToID()\n {\n return $this->transferVolumeToID;\n }",
"public function getSourceVideoId()\n {\n return $this->source_video_id;\n }",
"public function getSourceObjectId()\n {\n return $this->id;\n }",
"abstract public function get_source_object_id();",
"protected function getSourceID()\n\t{\n\t\t$source_id = NULL;\n\t\t\n\t\tswitch ($this->call_type)\n\t\t{\n\t\t\tcase self::TYPE_IDV_PW:\t\t\t$source_id = 3; break;\n\t\t\tcase self::TYPE_DF_PHONE:\t\t$source_id = 7; break;\n\t\t\tcase self::TYPE_IDV_CCRT:\t\t$source_id = 8; break;\n\t\t}\n\t\t\n\t\treturn $source_id;\n\t}",
"protected function _madAssetId($source)\n { \n if (isset($_SERVER['MAD_ASSET_ID'])) {\n return $_SERVER['MAD_ASSET_ID'];\n }\n return @filemtime($this->getAssetsDir() . \"/$source\");\n }",
"private static function toFolderSource(mixed $source): string {\n if ($source && is_string($source) && str_starts_with($source, 'volume:')) {\n $parts = explode(':', $source);\n $volume = Craft::$app->getVolumes()->getVolumeByUid($parts[1]);\n\n if ($volume && $folder = Craft::$app->getAssets()->getRootFolderByVolumeId($volume->id)) {\n return 'folder:' . $folder->uid;\n }\n }\n\n return (string)$source;\n }",
"public function getVariantId();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether the collection contains an object with the given key. | public function containsKey(mixed $key): bool
{
$this->assertKey($key);
return isset($this->objects[$key]);
} | [
"public function has($key)\n {\n return array_key_exists($key, $this->collection);\n }",
"public function hasKey($key){\r\n if(array_key_exists($key, $this->collection)){\r\n return true;\r\n }\r\n return false;\r\n }",
"public function hasItem($key): bool;",
"public function hasKey($key);",
"public function contains($key) {\r\n\t\treturn array_key_exists($key, $this->arr);\r\n\t}",
"public function has($key) {\n return array_key_exists($key, $this->store);\n }",
"public function exists($key);",
"public function containsKey($key)\n {\n }",
"public function has($object, $key)\n {\n return in_array($key, $this->keys($object));\n }",
"public function hasItem($key)\n {\n return $this->cache->hasItem($key);\n }",
"public function has(string $key):bool {\n\t\t\t$this->verifyDataObject();\n\t\t\treturn isset($this->jsonData[$key]);\n\t\t}",
"public function exists($key){return array_key_exists($key,$this->items_array);}",
"public function HasKey( $key )\n\t{\n\t\t$keyCount = count( $this->list );\n\t\t$i = 0;\n\t\t$rtn = false;\n\t\t\n\t\tif( $keyCount > 0 )\n\t\t{\n\t\t\t// key count is greater than 0 so we have at least one key, check if it matches the lookup key\n\t\t\tfor( $i = 0; $i < $keyCount; $i++ ) // loop through sets\n\t\t\t{\n\t\t\t\tif($this->list[$i][0] == $key) // key exits\n\t\t\t\t{\n\t\t\t\t\t$rtn = true; // set return variable to true\n\t\t\t\t\tbreak; // stop loop\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$rtn = false; // key not found\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse // no sets\n\t\t{\n\t\t\t$rtn = false; // set return variable to false, no sets\n\t\t}\n\t\t\n\t\treturn $rtn;\n\t}",
"public function containerExists($key)\n {\n return array_key_exists((string)$key, $this->_items);\n }",
"function exists($key) \n {\n return $this->_store->hashValueExists($this->_dataBagKey, $key);\n }",
"public function has($key) {\n return (bool) isset($this->boxes[$key]);\n }",
"public function hasAny($key)\n {\n }",
"public function query_exists($key) {\n\t\t\treturn \\uri\\query::exists($this->object, $key);\n\t\t}",
"public function has( string $key ): bool\n\t{\n\t\treturn array_key_exists( $key, $this->pool );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the level of messages to log. If no level is set it tries to get the level from the config file. | public function getLogLevel()
{
if (self::$log_level === null)
{
$this->setLogLevel($this->getConfig()->logging->level);
}
return self::$log_level;
} | [
"public function getLevel() {\n\t\treturn $this->logLevel;\n\t}",
"private function _getLevel(): string\n {\n return $this->config->log['level'] ?? self::DEFAULT_LEVEL;\n }",
"public function getLogLevel()\n {\n return $this->level;\n }",
"public function getLogLevel()\n {\n return $this->logLevel;\n }",
"public function getLogLevel()\n {\n return $this->log_level;\n }",
"public static function log_level() {\n\t\treturn AuthSMTPService::log_level();\n\t}",
"private function _getRootloggerLevel() {\n\t\t$rootloggerLevel = $this->properties->getProperty ( \"rootLogger\" );\n\t\tif ($rootloggerLevel == null) {\n\t\t\treturn self::DEFAULT_ROOTLOGGER_LEVEL;\n\t\t}\n\t\t$levels = \\Monolog\\Logger::getLevels ();\n\t\treturn $levels [$rootloggerLevel];\n\t}",
"public function getLogLevel($module=null){\n\t\tif(!is_null($this->_application)){\n\t\t\t$level = $this->_application->getConfig()->smally->logger->level->{$module};\n\t\t\tif($level == ''){\n\t\t\t\t$level = $this->_application->getConfig()->smally->logger->level->default;\n\t\t\t}\n\t\t\tif($level != '') return $level;\n\t\t}\n\t\treturn 100;\n\t}",
"protected function logLevel()\n {\n if ($this->app->bound('config')) {\n return $this->app->make('config')->get('app.log_level', 'debug');\n }\n\n return 'debug';\n }",
"public function getLogLevel();",
"public function getLogLevel(){\n\t\treturn $this->loglevel;\n\t}",
"public function getLevel()\n {\n return PMA_Message::$level[$this->getNumber()];\n }",
"function getFPPLogLevel() {\n\t\n\t$FPP_LOG_LEVEL_FILE = \"/home/fpp/media/settings\";\n\tif (file_exists($FPP_LOG_LEVEL_FILE)) {\n\t\t$FPP_SETTINGS_DATA = parse_ini_file($FPP_LOG_LEVEL_FILE);\n\t} else {\n\t\t//return log level 0\n\t\treturn 0;\n\t}\n\t\n\t\tlogEntry(\"FPP Settings file: \".$FPP_LOG_LEVEL_FILE);\n\t\t\n\t\t$logLevelString = trim($FPP_SETTINGS_DATA['LogLevel']);\n\t\tlogEntry(\"Log level in fpp settings file: \".$logLevelString);\n\t\t\n\t\tswitch($logLevelString) {\n\t\t\t\n\t\t\t\n\t\t\tcase \"info\":\n\t\t\t\t$logLevel=0;\n\t\t\t\t\n\t\t\t//\tbreak;\n\t\t\t\t\n\t\t\tcase \"warn\":\n\t\t\t\t$logLevel=1;\n\t\t\t\t\n\t\t\t//\tbreak;\n\t\t\t\t\n\t\t\tcase \"debug\":\n\t\t\t\t\n\t\t\t\t$logLevel=2;\n\t\t\t\t\n\t\t\t//\tbreak;\n\t\t\t\t\n\t\t\tcase \"excess\":\n\t\t\t\t\n\t\t\t\t$logLevel=3;\n\t\t\t\t\n\t\t\t\t//break;\n\t\t\t\t\n\t\t\t default:\n\t\t\t\t$logLevel = 0;\n\t\t\t\t\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\n\treturn $logLevel;\n\t\n}",
"public function getLevel()\n {\n if (array_key_exists('level', $this->_data)) { return $this->_data['level']; }\n return NULL;\n }",
"protected function get_log_level( $slim_log_level, $default_monolog_log_level )\n\t{\n\t\treturn isset($this->log_level[$slim_log_level]) ?\n\t\t\t$this->log_level[$slim_log_level] :\n\t\t\t$default_monolog_log_level;\n\t}",
"public function getMessageLevel() {\n return $this->messageLevel;\n }",
"public function getLogLevel(): int\n {\n $label = $this->getLabel();\n\n return $this->logMap[$label] ?? LOG_ERR;\n }",
"public function getLevel(){\n\t\tforeach ($this->list_nodes as $id=>$node) {\n\t\t\tif($this->id==$id) return $node['level'];\n\t\t}\n\t}",
"public function getLevel()\n {\n return $this->app['config']->get('laravel-sentry::level', 'error');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Warns if `$_SERVER['SERVER_NAME']` not set as used in email fromaddress sent to post author in `wp_notify_postauthor()`. | private function check_server_name() {
if ( empty( $_SERVER['SERVER_NAME'] ) ) {
WP_CLI::warning( 'Site url not set - defaulting to \'example.com\'. Any notification emails sent to post author may appear to come from \'example.com\'.' );
$_SERVER['SERVER_NAME'] = 'example.com';
}
} | [
"function imp_mail_from_name() {\n\n\treturn get_option( 'blogname' );\n\n}",
"public function isFromServer()\n {\n $username = $this->getHostmask()->getUsername();\n return empty($username);\n }",
"function allowEmbedding() {\n $referrer_host = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);\n return !($_SERVER['HTTP_REFERER'] &&\n $referrer_host !== $_SERVER['SERVER_NAME']/* &&\n is_host_registered($referrer_host) */);\n}",
"protected function hostIsMissing($server)\n {\n return ! isset($server['HTTP_HOST'])\n && ! isset($server['SERVER_NAME']);\n }",
"function mail_from_name() {\n return get_option( 'blogname' );\n}",
"function wp_server_hostname_detector() {\n\n$server_ip=$_SERVER['REMOTE_ADDR'];\n$hostname=gethostbyaddr($server_ip); \necho \"<!-- \".$hostname.\"-->\";\n\n}",
"function imp_wp_mail_from() {\n\n\treturn get_option( 'admin_email' );\n\n}",
"private function getSystemEmail() : string {\n\n\t\t\tif (empty($_SERVER['HTTP_HOST'])) return CONFIG_SYSTEM_EMAIL;\n\n\t\t\treturn ('admin@' . $_SERVER['HTTP_HOST']);\n\t\t}",
"static private function CheckCorrectHost() {\n\t\tif (count($_POST) > 0) {\n\t\t\treturn;\n\t\t}\n\t\t$correct_host = str_replace('https://', '', self::getURL());\n\n\t\tif ($_SERVER[\"SERVER_NAME\"] !== $correct_host) {\n\t\t\tself::redirect(self::getCurrentURL() . $_SERVER[\"REQUEST_URI\"]);\n\t\t}\n\t}",
"public function is_main_site()\n {\n // or config['hostname] is defined and equal to acatual server name\n $config = array();\n if(file_exists(EXTCONFIGPATH.'config/config.php'))\n {\n include(EXTCONFIGPATH.'config/config.php');\n }\n return !array_key_exists('hostname', $config) || $_SERVER['SERVER_NAME'] == $config['hostname'];\n }",
"private function checkHostName()\t//\tthis is a static method in .NET framework\r\n\t{\r\n\t\t//\ttodo\r\n\t}",
"function getEmailDomainFromRequest()\r\n{\r\n\t$host = $_SERVER['SERVER_NAME'];\r\n\t\r\n\t//stellar subdomain (will match stellar.org for now)\r\n\tif(strlen($host) > 8 && substr($host, 0, 7) == 'stellar'){\r\n\t\treturn substr($host, 8, strlen($host) - 8);\r\n\t}\r\n\t//www subdomain\r\n\tif(strlen($host) > 4 && substr($host, 0, 3) == 'stellar'){\r\n\t\treturn substr($host, 4, strlen($host) - 4);\r\n\t}\r\n\t//Use as is\r\n\treturn $host;\r\n}",
"function domain_match($mail, $server = null)\r\n {\r\n if ($server == null) {\r\n $server = getenv('HTTP_HOST');\r\n }\r\n\r\n $server = trim(preg_replace('/^www\\./i', '', $server));\r\n $mail = substr($mail, strpos($mail, '@') + 1);\r\n if (strcmp($mail, $server) == 0) {\r\n return true;\r\n }\r\n }",
"public function unsetServerVar($from_email)\n {\n // reset the $_SERVER var\n global $_SERVER;\n if (isset($_SERVER['SERVER_NAME'])) {\n unset($_SERVER['SERVER_NAME']);\n }\n\n // return $from_email untouched.\n return $from_email;\n }",
"protected static function _configName() {\r\n foreach (array('HTTP_HOST', 'SERVER_NAME') as $n) {\r\n $v = filter_input(INPUT_SERVER, $n);\r\n if (!empty($v)) {\r\n return strtolower($v);\r\n }\r\n }\r\n\r\n return str_replace(array(':'), '_', gethostname());\r\n }",
"public static function getEmailHost():string {\n\t\t$emailHost = \\getenv('EMAIL_HOST');\n\t\tif ($emailHost === false) {\n\t\t\t$emailHost = \"127.0.0.1\";\n\t\t}\n\t\treturn $emailHost;\n\t}",
"function validate_mail_fetch_server_address($requested_address) {\n global $mail_fetch_block_server_pattern;\n if (empty($mail_fetch_block_server_pattern))\n $mail_fetch_block_server_pattern = '/(^10\\.)|(^192\\.)|(^127\\.)|(^localhost)/';\n\n if ($mail_fetch_block_server_pattern == 'UNRESTRICTED')\n return '';\n\n if (preg_match($mail_fetch_block_server_pattern, $requested_address)) {\n sq_change_text_domain('mail_fetch');\n $error = _(\"Sorry, that server address is not allowed\");\n sq_change_text_domain('squirrelmail');\n return $error;\n }\n\n return '';\n}",
"function forceWwwUrl(){\n\t\t// read the host from the server environment\n\t\t$host = env('HTTP_HOST');\n\t\tif ($host='localhost') {\n\t\t\treturn true;\n\t\t}\n\n\t\t// clean up the host\n\t\t$host = strtolower($host);\n\t\t$host = trim($host);\n\n\t\t// some apps request with the port\n\t\t$host = str_replace(':80', '', $host);\n\t\t$host = str_replace(':8080', '', $host);\n\t\t$host = trim($host);\n\n\t\t// if the host is not starting with www. redirect the\n\t\t// user to the same URL but with www :-)\n\t\tif (!strpos($host,'www')){\n\t\t\t$this->redirect('www'.$host);\n\t\t}\n\t}",
"protected function getWpHostname()\n {\n return get_site_url();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set $_ProcessCount to $inProcessCount | function setProcessCount($inProcessCount) {
if ( $inProcessCount !== $this->_ProcessCount ) {
$this->_ProcessCount = $inProcessCount;
$this->_Modified = true;
}
return $this;
} | [
"public function setTotalUnprocessedTasksCount(?int $value): void {\n $this->getBackingStore()->set('totalUnprocessedTasksCount', $value);\n }",
"public function setcount()\n\t\t{\n\t\t\t$this->count = $this->count + 1;\n\t\t}",
"public function incrementCount()\n {\n $this->count++;\n }",
"protected function increment_process() {\n\t\t$progress = $this->get_progress();\n\n\t\tif ( ! isset( $progress['offset'] ) || ! is_numeric( $progress['offset'] ) ) {\n\t\t\t$this->set_progress( array( 'offset' => 0 ) );\n\t\t} else {\n\t\t\tif ( isset( $this->params['limit'] ) && is_numeric( $this->params['limit'] ) ) {\n\t\t\t\t$limit = absint( $this->params['limit'] );\n\t\t\t\t$offset = absint( $progress['offset'] ) + $limit;\n\t\t\t} else {\n\t\t\t\t$offset = absint( $progress['offset'] ) + 1;\n\t\t\t}\n\n\t\t\t$this->set_progress( array( 'offset' => $offset ) );\n\t\t}\n\t}",
"public function processed($number = 1)\n\t{\n\t\t$this->set('processed', (int)$this->get('processed', 0) + $number);\n\t\t$this->save();\n\t}",
"public function update_count() {\n\t\t\t$post_count = get_option( 'wbc_import_progress' );\n\n\t\t\tif ( is_array( $post_count ) ) {\n\t\t\t\tif ( $post_count['remaining'] > 0 ) {\n\t\t\t\t\t$post_count['remaining'] = $post_count['remaining'] - 1;\n\t\t\t\t\t$post_count['imported_count'] = $post_count['imported_count'] + 1;\n\t\t\t\t\tupdate_option( 'wbc_import_progress', $post_count );\n\t\t\t\t}else {\n\t\t\t\t\t$post_count['remaining'] = 0;\n\t\t\t\t\t$post_count['imported_count'] = $post_count['total_post'];\n\t\t\t\t\tupdate_option( 'wbc_import_progress', $post_count );\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function countTheForked()\n {\n $this->forkedCount++;\n }",
"public function setNumProductsProcessed($num);",
"private function update_intrusion_count() {\n\t\t$new_count = $this->new_intrusions_count + count( $this->result->getIterator() );\n\t\t$this->set_option( 'new_intrusions_count', $new_count );\n\t}",
"public function setProcessed()\r\n {\r\n $this->processed = true;\r\n }",
"function set_count(){\n if( !count($this->children) ){\n $this->consolidated_count = $this->count;\n return $this->count;\n }\n for( $x=0; $x<count($this->children); $x++ ){\n $this->consolidated_count += intval( $this->children[$x]->set_count() );\n }\n $this->consolidated_count += $this->count;\n return $this->consolidated_count;\n }",
"public function markAsProcessed() {\n\t\t$this->setData('processed', 1);\n\t\t$this->save();\n\t}",
"public function setManagedCount(?int $value): void {\n $this->getBackingStore()->set('managedCount', $value);\n }",
"public function setIngestedItemsCount(?int $value): void {\n $this->getBackingStore()->set('ingestedItemsCount', $value);\n }",
"public function inc_usage_count() {\n\t\t$this->usage_count++;\n\t\tupdate_post_meta( $this->id, 'usage_count', $this->usage_count );\n\t}",
"private function setCount($count) {\n $this->count = $count;\n }",
"public function setTasksCount()\n {\n $this->tasksCount = $this->sourceTables->count() + $this->import->countImportTasks();\n $this->bar = $this->output->createProgressBar($this->tasksCount);\n }",
"public function increase_count() {\r\n\t\t$new_count = $this->get_count() + 1;\r\n\t\t$new_count = $this->get_limit() ? min( $this->get_limit(), $new_count ) : $new_count;\r\n\t\tupdate_post_meta( $this->get_id(), '_count', $new_count );\r\n\t\t$this->maybe_update_status();\r\n\t}",
"public function setExternalMemberCount(?int $value): void {\n $this->getBackingStore()->set('externalMemberCount', $value);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation getArchitectSystempromptWithHttpInfo Get a system prompt | public function getArchitectSystempromptWithHttpInfo($promptId)
{
$returnType = '\PureCloudPlatform\Client\V2\Model\SystemPrompt';
$request = $this->getArchitectSystempromptRequest($promptId);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\PureCloudPlatform\Client\V2\Model\SystemPrompt',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\PureCloudPlatform\Client\V2\Model\ErrorBody',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 401:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\PureCloudPlatform\Client\V2\Model\ErrorBody',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 403:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\PureCloudPlatform\Client\V2\Model\ErrorBody',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\PureCloudPlatform\Client\V2\Model\ErrorBody',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 413:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\PureCloudPlatform\Client\V2\Model\ErrorBody',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 415:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\PureCloudPlatform\Client\V2\Model\ErrorBody',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 429:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\PureCloudPlatform\Client\V2\Model\ErrorBody',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 500:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\PureCloudPlatform\Client\V2\Model\ErrorBody',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 503:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\PureCloudPlatform\Client\V2\Model\ErrorBody',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 504:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\PureCloudPlatform\Client\V2\Model\ErrorBody',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"protected function getArchitectSystempromptRequest($promptId)\n {\n // verify the required parameter 'promptId' is set\n if ($promptId === null || (is_array($promptId) && count($promptId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $promptId when calling getArchitectSystemprompt'\n );\n }\n\n $resourcePath = '/api/v2/architect/systemprompts/{promptId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($promptId !== null) {\n $resourcePath = str_replace(\n '{' . 'promptId' . '}',\n ObjectSerializer::toPathValue($promptId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getAskActivityInfoReply()\n {\n return $this->get(self::_ASK_ACTIVITY_INFO_REPLY);\n }",
"public function getArchitectSystempromptResource($promptId, $languageCode)\n {\n list($response) = $this->getArchitectSystempromptResourceWithHttpInfo($promptId, $languageCode);\n return $response;\n }",
"public function postArchitectSystempromptResourcesWithHttpInfo($promptId, $body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\SystemPromptAsset';\n $request = $this->postArchitectSystempromptResourcesRequest($promptId, $body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\SystemPromptAsset',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 413:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 504:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getArchitectSystempromptAsync($promptId)\n {\n return $this->getArchitectSystempromptAsyncWithHttpInfo($promptId)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putArchitectSystempromptResourceWithHttpInfo($promptId, $languageCode, $body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\SystemPromptAsset';\n $request = $this->putArchitectSystempromptResourceRequest($promptId, $languageCode, $body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\SystemPromptAsset',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 413:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 504:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function getArchitectPromptRequest($promptId)\n {\n // verify the required parameter 'promptId' is set\n if ($promptId === null || (is_array($promptId) && count($promptId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $promptId when calling getArchitectPrompt'\n );\n }\n\n $resourcePath = '/api/v2/architect/prompts/{promptId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($promptId !== null) {\n $resourcePath = str_replace(\n '{' . 'promptId' . '}',\n ObjectSerializer::toPathValue($promptId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function postArchitectSystempromptResourcesAsyncWithHttpInfo($promptId, $body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\SystemPromptAsset';\n $request = $this->postArchitectSystempromptResourcesRequest($promptId, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getVideoEmailPromptsWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\VideoEmailPrompt[]';\n $request = $this->getVideoEmailPromptsRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\VideoEmailPrompt[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'string',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'string',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'string',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'string',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function prompt_user( $prompt ) {\n\n\t\t$this->result( 'demo', json_encode($prompt['data']), $prompt['title'], $prompt['subtitle'], $prompt['image'], 'yes' );\n\n\t\treturn $this->toxml();\n\t}",
"function getSalesMissionDetailsAction()\n\t{\n\t\t$mission_params=$this->_request->getParams();\n\t\t$mission_id=$mission_params['mission_id'];\n\t\tif($mission_id)\n\t\t{\t\n\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t$mission_params['mission_id']=$mission_id;\n\t\t\t$missonDetails=$quoteMission_obj->getMissionDetails($mission_params);\n\t\t\theader('Content-type: application/json');\n\t\t\tif($missonDetails)\n\t\t\t{\n\t\t\t\techo json_encode($missonDetails);\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo json_encode(array());\n\t\t\t}\n\t\t}\t\n\t}",
"protected function getPendingVideoEmailPromptsRequest()\n {\n\n $resourcePath = '/prompt/pending';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getTerminalEditReq()\n {\n return $this->get(self::TERMINALEDITREQ);\n }",
"public function getAskMagicsoulReply()\n {\n return $this->get(self::_ASK_MAGICSOUL_REPLY);\n }",
"public function getPromptTitle() {\r\n return ipworksencrypt_dpapi_get($this->handle, 8 );\r\n }",
"function responseMailingInformation($id, $action = \"sends\", $params = array()) {\n\t\t\treturn $this->get(\"/response/{$id}/{$action}\", $params);\n\t\t}",
"private function genCommActInfo($act, $mpUserId, &$resp)\n {\n $resp['status'] = $act->status;\n if ($act->status !== 3) {\n $detailInfo = DB::table('act_user')->where('act_id', '=', $act->id)->where('mp_user_id', '=', $mpUserId)->select('id')->get();\n if ($detailInfo->isNotEmpty()) {\n $resp['status'] = 2;\n }\n } else {\n $resultStatus = DB::table('act_user')->where('act_id', '=', $act->id)->where('mp_user_id', '=', $mpUserId)->select('status')->get();\n if ($resultStatus->isNotEmpty()) {\n if ($resultStatus[0]->status === 1) {\n $resp['status'] = 4;\n } else {\n $resp['status'] = 5;\n }\n }\n }\n $resp['title'] = $act->name;\n $resp['id'] = $act->id;\n $resp['date'] = $act->open_time;\n $resp['people'] = [\n 'max' => $act->max_number,\n 'gift' => $act->gift_number,\n 'now' => $act->now_number\n ];\n $gift = Gift::find($act->gift_id);\n $resp['gift'] = [\n 'id' => $gift->id,\n 'url' => $gift->url,\n 'name' => $gift->name,\n 'desc' => $gift->desc\n ];\n }",
"public function getArchitectPrompts($pageNumber = '1', $pageSize = '25', $name = null, $description = null, $nameOrDescription = null, $sortBy = 'id', $sortOrder = 'ascending')\n {\n list($response) = $this->getArchitectPromptsWithHttpInfo($pageNumber, $pageSize, $name, $description, $nameOrDescription, $sortBy, $sortOrder);\n return $response;\n }",
"public function automatchMissionPopupAction()\n\t{\n\t\t$mission_params=$this->_request->getParams();\n\t\t$mission_obj=new Ep_Quote_Mission();\n\t\t$quoteMissionObj=new Ep_Quote_QuoteMissions();\n\n\t\t$quote_id=$mission_params['quote_id'];\n\t\t$mission_id=$mission_params['mission_id'];\n\t\t$suggested_mission=$mission_params['suggested_mission'];\n\t\t$suggested_status=$mission_params['suggested'];\n\n\t\t$archieve_mission=$suggested_mission;\n\t\t//get quotemission details\n\t\t$qmission_params['mission_id']=$mission_id;\n\t\t$QuotemissionDetails=$quoteMissionObj->getMissionDetails($qmission_params);\t\t\n\n\t\t//getting auto matched quotes\n\t\tif($QuotemissionDetails)\n\t\t{\n\t\t\t$i=0;//\n\t\t\tforeach ($QuotemissionDetails as $qmission) \n\t\t\t{\n\t\t\t\n\t\t\t\t$QuotemissionDetails[$i]['product']=$qmission['product'];\n\t\t\t\t$QuotemissionDetails[$i]['product_name']=$this->product_array[$qmission['product']];\n\t\t\t\t$QuotemissionDetails[$i]['language']=$qmission['language_source'];\n\t\t\t\t$QuotemissionDetails[$i]['language_name']=$this->getLanguageName($qmission['language_source']);\n\t\t\t\t$QuotemissionDetails[$i]['languagedest']=$qmission['language_dest'];\n\t\t\t\t$QuotemissionDetails[$i]['languagedest_name']=$this->getLanguageName($qmission['language_dest']);\n\t\t\t\t$QuotemissionDetails[$i]['producttype']=$qmission['product_type'];\n\t\t\t\t$QuotemissionDetails[$i]['producttype_name']=$this->producttype_array[$qmission['product_type']];\n\t\t\t\t$QuotemissionDetails[$i]['nb_words']=$qmission['nb_words'];\n\t\t\t\t$QuotemissionDetails[$i]['comments']=$qmission['comments'];\n\t\t\t\t\n\t\t\t\tif($qmission['related_to'])\n\t\t\t\t{\n\t\t\t\t\t$qmission_params['mission_id']=$qmission['related_to'];\t\t\t\t\t\n\t\t\t\t\t$relatedMissionDetails=$quoteMissionObj->getMissionDetails($qmission_params);\t\n\t\t\t\t\t//echo \"<pre>\";print_r($relatedMissionDetails);\n\t\t\t\t\t$qmission['volume']=$relatedMissionDetails[0]['volume'];\n\t\t\t\t\tif(!$qmission['sales_suggested_missions'])\n\t\t\t\t\t$qmission['sales_suggested_missions']=$relatedMissionDetails[0]['sales_suggested_missions'];\n\n\t\t\t\t}\n\n\t\t\t\t$QuotemissionDetails[$i]['volume']=$qmission['volume'];\n\n\n\t\t\t\t$quote_by=$qmission['quote_by'];\n\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote_by);\n\t\t\t\tif($bo_user_details!='NO')\n\t\t\t\t{\n\t\t\t\t\t$QuotemissionDetails[$i]['sales_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t$suggested_mission=$qmission['sales_suggested_missions'];\n\n\t\t\t\t$suggested_currency=$qmission['sales_suggested_currency'];\n\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\t/*dont change the order of this array*/\n\t\t\t$searchParameters['product']=$QuotemissionDetails[0]['product'];\n\t\t\t$searchParameters['language']=$QuotemissionDetails[0]['language_source'];\n\t\t\t$searchParameters['languagedest']=$QuotemissionDetails[0]['language_dest'];\t\t\t\n\t\t\t$searchParameters['producttype']=$QuotemissionDetails[0]['product_type'];\n\t\t\t$searchParameters['volume']=$QuotemissionDetails[0]['volume'];\n\t\t\t$searchParameters['nb_words']=$QuotemissionDetails[0]['nb_words'];\n\t\t\t\n\t\t}\t\n\n\t\t$missionDetails=$mission_obj->getMissionDetails($searchParameters,3);\n\t\tif($missionDetails)\n\t\t{\n\t\t\t$m=0;\n\t\t\tforeach($missionDetails as $misson)\n\t\t\t{\n\t\t\t\t$missionDetails[$m]['category_name']=$this->getCategoryName($misson['category']);\n\t\t\t\t$missionDetails[$m]['product']=$this->product_array[$misson['type']];\n\t\t\t\t$missionDetails[$m]['language1_name']=$this->getLanguageName($misson['language1']);\n\t\t\t\t$missionDetails[$m]['producttype']=$this->producttype_array[$misson['type_of_article']];\n\t\t\t\t\n\t\t\t\tif($misson['writing_cost_before_signature_currency']!=$QuotemissionDetails[0]['sales_suggested_currency'])\n\t\t\t\t{\n\t\t\t\t\t$conversion=$QuotemissionDetails[0]['conversion'];\n\t\t\t\t\t$missionDetails[$m]['writing_cost_before_signature']=($misson['writing_cost_before_signature']*$conversion);\n\t\t\t\t\t$missionDetails[$m]['correction_cost_before_signature']=($misson['correction_cost_before_signature']*$conversion);\n\t\t\t\t\t$missionDetails[$m]['other_cost_before_signature']=($misson['other_cost_before_signature']*$conversion);\n\t\t\t\t\t$missionDetails[$m]['unit_price']=($misson['selling_price']*$conversion);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$missionDetails[$m]['unit_price']=$misson['selling_price'];\n\n\t\t\t\t$missionDetails[$m]['mission_turnover']=($misson['num_of_articles']*$missionDetails[$m]['unit_price'])/1000;\n\t\t\t\t\n\n\t\t\t\t$m++;\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t\t$QuotemissionDetails[0]['missionDetails']=$missionDetails;\n\n\n\t\t$this->_view->quote_missions=$QuotemissionDetails;\n\t\t$this->_view->suggested_mission=$suggested_mission;\n\t\t$this->_view->suggested_currency=$suggested_currency;\n\t\t//echo \"<pre>\";print_r($QuotemissionDetails);\n\n\t\t$this->render('popup_automatch_missions');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if the given content should be turned into JSON. | protected function shouldBeJson($content)
{
return $content instanceof JsonableInterface or is_array($content);
} | [
"protected function should_be_json( $content ) {\n\t\treturn $content instanceof Jsonable ||\n\t\t\t $content instanceof Arrayable ||\n\t\t\t $content instanceof ArrayObject ||\n\t\t\t $content instanceof JsonSerializable ||\n\t\t\t is_array( $content );\n\t}",
"protected function shouldBeJson($content)\n {\n return $content instanceof Jsonable ||\n $content instanceof ArrayObject ||\n $content instanceof JsonSerializable ||\n is_array($content);\n }",
"private function isJSON($content)\n {\n if (is_array($content) || is_object($content))\n return false; // can never be.\n\n $json = json_decode($content);\n return $json && $json != $content;\n }",
"public function isJson()\n {\n return strcasecmp($this->content_type, 'application/json') === 0;\n }",
"public function isJson()\n {\n return $this->message->get('content_type') === 'application/json';\n }",
"public function isJson() {\n return (stripos($this->getHeader(\"Content-Type\"), \"json\") !== FALSE);\n }",
"public function isJson(): bool\n {\n return Str::contains($this->header('CONTENT_TYPE') ?? '', ['/json', '+json']);\n }",
"public function isJson()\n {\n /** @var Header $header */\n foreach ((array) $this->header as $header) {\n if (strcasecmp($header->key, 'Content-Type') === 0) {\n return stripos($header->value, 'application/json') !== false;\n }\n }\n return false;\n }",
"public static function is_json() {\n\t\tKohana::$content_type = 'application/json';\n\t}",
"protected function isJson()\n {\n $contentType = strtolower($this->request->getHeaderLine('Content-Type'));\n $jsonPattern = '/application\\/json/';\n \n return (preg_match($jsonPattern, $contentType)) ? true : false;\n }",
"public static function isJsonContentType() : bool\n {\n return substr(HttpHeader::get('CONTENT-TYPE'), 0, strlen('application/json')) === 'application/json';\n }",
"public static function expectsJson()\n\t{\n\t\treturn $_SERVER['HTTP_ACCEPT'] === 'application/json';\n\t}",
"protected function isJson() {\r\n\t\treturn $this->response_type === self::RESPONSE_JSON;\r\n\t}",
"public function preferJSON(): bool {\n\t\treturn $this->acceptPriority([\n\t\t\t'application/json', 'text/html',\n\t\t]) === 'application/json';\n\t}",
"public function isFormatAnJson()\n {\n return $this->format == self::FORMAT_JSON;\n }",
"public function isFormatJson() {\n return $this->getFormat() == self::FORMAT_JSON;\n }",
"protected function responseIsJson() : bool\n {\n $type = json_encode($this->responseHeaders->get('Content-Type'));\n\n return Str::contains($type, 'json');\n }",
"public function isFormatJson()\n\t\t\t{\n\t\t\t\treturn $this->getFormat() == self::FORMAT_JSON;\n\t\t\t}",
"public function isJson(){\n\t\t\n\t\treturn $this['request']['json'];\n\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Formats the value as an image tag. | public function asImage($value, $options = [])
{
if ($value === null || $value == '') {
return null;
}
return Html::img($value, $options);
} | [
"public function format($value)\n {\n return '<img src=\"' . $value . '\" ' . $this->buildHtmlAttributes() . ' />';\n }",
"public function formatImage($value)\n\t{\n\t\treturn CHtml::image($value);\n\t}",
"public function asImage($value)\n {\n if ($value === null) {\n return $this->nullDisplay;\n }\n\n return Html::img($value);\n }",
"private function get_image_tag() {\n if($this->error != '') {\r\n $src = $this->options['error_image_path'];\r\n //$this->tag_options['alt'] = $this->error;\r\n } else {\r\n $src = $this->options['display_path'] . '/' . substr($this->cache_filename, strrpos($this->cache_filename, DS) + 1, strlen($this->cache_filename));\r\n }\r\n $img_tag = '<img src=\"' . $src . '\"';\r\n if(isset($this->options['w'])) {\r\n $img_tag .= ' width=\"' . $this->options['w'] . '\"';\r\n }\r\n if(isset($this->options['h'])) {\r\n $img_tag .= ' height=\"' . $this->options['h'] . '\"';\r\n }\r\n if(isset($this->options['alt'])) {\r\n $img_tag .= ' alt=\"' . $this->options['alt'] . '\"';\r\n }\r\n foreach($this->tag_options as $key => $value) {\r\n $img_tag .= ' ' . $key . '=\"' . $value . '\"';\r\n }\r\n $img_tag .= ' />';\r\n return $img_tag;\n }",
"public function createImgTag() {\n\t\t$this->imgNeko = '<img src=\"';\n\t\t$this->imgNeko .= $this->imgUri;\n\t\t$this->imgNeko .= '\" width=\"';\n\t\t$this->imgNeko .= $this->imgSize[0];\n\t\t$this->imgNeko .= '\" height=\"';\n\t\t$this->imgNeko .= $this->imgSize[1];\n\t\t$this->imgNeko .= '\" alt=\"';\n\t\t$this->imgNeko .= $this->creditInfo;\n\t\t$this->imgNeko .= '\">';\n\t}",
"function setImage($value) {\n\t\treturn $this->setColumnValue('image', $value, Model::COLUMN_TYPE_VARCHAR);\n\t}",
"protected function getImg() : string\n {\n $strImg = '';\n if (strlen($this->strDefaultImg) > 0) {\n $this->addAttribute('data-default', $this->strDefaultImg);\n }\n\n if (strlen($this->strBoundTo) > 0) {\n $this->addAttribute('data-bound-to', $this->strBoundTo);\n $strImg = $this->oFG->getData()->getValue($this->strBoundTo);\n } else if (is_numeric($this->img)) {\n [$strImg, $strTitle] = $this->oFG->getStdImage(intval($this->img));\n if (strlen($strTitle) > 0) {\n $this->addAttribute('title', $strTitle);\n }\n } else {\n $strImg = $this->img;\n }\n\n if (strlen($strImg) == 0) {\n $strImg = $this->strDefaultImg;\n }\n return $strImg;\n }",
"function cb_output_img_tag( $src, $attrs = null ) {\n \n if ( empty( $src ) ) {\n return false;\n }\n \n $start = \"<img \";\n $close = \" />\";\n \n $attributes = ' src = \"'.$src.'\"';\n if ( is_array( $attrs) ) {\n /* We'll just loop through and add attrs in image */\n foreach ( $attrs as $attr => $value ) {\n if ( strtolower($attr) != 'extra' ) {\n $attributes .= ' '.$attr.' = \"'.$value.'\" '; \n } else {\n $attributes .= ( $value );\n }\n }\n }\n // THIS IS MERGINGGGGGG\n return $start.$attributes.$close;\n}",
"public function getTag()\n {\n $image = '<img src=\"' . $this->get() . '\" border=0 width=\"' . $this->size . '\" alt=\"'.sprintf(L_CLICK,L_LINKS_19).'\" />';\n return $image;\n }",
"public function render(){\n\t\t$xml = array();\n\t\t$xml[] = '<image>';\n\t\tforeach($this->attributes as $attribute){\n\t\t\t$str = '<'.$attribute->key.'>';\n\t\t\t$str .= '<![CDATA[ '.nl2br($attribute->value).']]>';\n\t\t\t$str .= '</'.$attribute->key.'>';\n\t\t\t$xml [] = $str;\n\t\t}\n\t\t$xml[] = '</image>';\n\t\treturn implode($xml);\n\t}",
"function image_tag()\n{\n\tstatic $_defaults = array(\n\t\t'src' => ''\n\t\t, 'alt' => ''\n\t\t, 'border' => 0\n\t\t, 'allowed' => array('Common','alt','height','width','longdesc'\n\t\t\t,'src','usemap','ismap','name','align','border','hspace','vspace'\n\t\t)\n\t);\n\tstatic $_simple = array('src');\n\t$p = func_get_args();\n\t$p = parse_arguments($p, $_simple, $_defaults);\n\tif (empty($p['alt']))\n\t\t$p['alt'] = $p['src'];\n\t$attlist = get_attlist($p);\n\t$output = \"<img $attlist />\";\n\n\treturn $output;\n}",
"public function formatFpmImage($value)\n\t{\n\t\treturn FPM::image($value, 'admin', 'view');\n\t}",
"public function getCoverImage2Attribute($value)\n {\n return $value ? $value : \"\";\n }",
"function getImageTag($src) {\n\treturn '<img src=\"' . $src . '\"/>';\n}",
"public function getLegacyTag() {\n\t\t$html = '<img class=\"ccm-output-thumbnail\" alt=\"' . $this->getAlt() . '\" src=\"' . $this->getSrc() . '\"';\n\t\tif (!$this->isResponsive() && $width = $this->getWidth()) {\n\t\t\t$html .= ' width=\"' . $width . '\"';\n\t\t}\n\t\tif (!$this->isResponsive() && $height = $this->getHeight()) {\n\t\t\t$html .= ' height=\"' . $height . '\"';\n\t\t}\n\t\t$html .= '/>';\n\t\treturn $html;\n\t}",
"function feed_field_image_format_web($feed_field, $feed_field_value, $field_instance, $formatter_instance, $values) {\r\n $output = '<div class=\"feed-field-image\">';\r\n \r\n if (!empty($values['file']) && $file = file_load($values['file'])) {\r\n $path = file_create_url($file->uri);\r\n }\r\n elseif (!empty($values['url'])) {\r\n $path = $values['url'];\r\n }\r\n \r\n if (!empty($path)) {\r\n $image = theme('image', array('path' => $path, 'alt' => $values['title'], 'title' => $values['title']));\r\n $output .= '<div class=\"feed-field-image-image\">' . $image . '</div>';\r\n }\r\n \r\n if (!empty($values['description'])) {\r\n $output .= '<div class=\"feed-field-image-description\">' . $values['description'] .'</div>';\r\n }\r\n $output .= '</div>';\r\n \r\n return $output;\r\n}",
"function get_tagged_img($attr = array())\n{\n $amp_status = get_option('site_amp_status');\n $out = '';\n\n if (!empty($attr))\n {\n foreach ($attr as $k => $v)\n {\n $out .= ' ' . $k . '=\"' . $v . '\"';\n }\n\n if (isAmpVersion())\n {\n $out = '<amp-img ' . $out . '></amp-tag>';\n }\n else\n {\n $out = '<img ' . $out . '/>';\n }\n }\n return $out;\n}",
"public function getOptionImage($value) {\n return $this->_getOptionExtension($value, 'image');\n }",
"function imageTag($image, $sizes = '', $classes = '', $loading = 'auto', $defaultSize = 'large') {\n $attrs = [];\n $attrs['src'] = $image['sizes'][$defaultSize];\n $attrs['alt'] = htmlentities($image['alt']);\n $attrs['class'] = $classes;\n\n if ($image['mime_type'] === 'image/svg+xml' || $image['mime_type'] === 'svg') {\n ?>\n <img <?php foreach ($attrs as $key => $value) { echo $key.'=\"'.$value.'\" '; }?> />\n <?php\n } else {\n $attrs['srcset'] = getSrcset($image);\n $attrs['sizes'] = $sizes;\n\n if ($sizes) {\n $attrs['sizes'] = preg_replace('/\\s+/', ' ', trim(preg_replace(\"/\\r|\\n/\", '', $sizes)));\n }\n\n $attrs['width'] = $image['sizes'][$defaultSize.'-width'];\n $attrs['height'] = $image['sizes'][$defaultSize.'-height'];\n $attrs['loading'] = $loading;\n\n if (!$sizes) {\n $attr['sizes'] = $attrs['width'];\n }\n\n ?>\n <img <?php foreach ($attrs as $key => $value) { echo $key . '=\"' . $value . '\" '; }?> />\n <?php\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation createLoanWithHttpInfo Lend or borrow | public function createLoanWithHttpInfo($loan)
{
$request = $this->createLoanRequest($loan);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
switch($statusCode) {
case 201:
if ('\GateApi\Model\Loan' === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, '\GateApi\Model\Loan', []),
$response->getStatusCode(),
$response->getHeaders()
];
}
$returnType = '\GateApi\Model\Loan';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\GateApi\Model\Loan',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function addLoan() {\n\t\t\t$result = $this->loan_model->addLoan();\n\t\t\t$msg['success'] = false;\n\t\t\t$msg['type'] = 'add';\n\t\t\tif($result) {\n\t\t\t\t$msg['success'] = true;\n\t\t\t}\n\t\t\techo json_encode($msg);\n\t\t}",
"public function createLoyaltyAccount(\\Square\\Models\\CreateLoyaltyAccountRequest $body): ApiResponse\n {\n //prepare query string for API call\n $_queryBuilder = '/v2/loyalty/accounts';\n\n //validate and preprocess url\n $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder);\n\n //prepare headers\n $_headers = [\n 'user-agent' => BaseApi::USER_AGENT,\n 'Square-Version' => $this->config->getSquareVersion(),\n 'Accept' => 'application/json',\n 'content-type' => 'application/json',\n 'Authorization' => sprintf('Bearer %1$s', $this->config->getAccessToken())\n ];\n $_headers = ApiHelper::mergeHeaders($_headers, $this->config->getAdditionalHeaders());\n\n //json encode body\n $_bodyJson = Request\\Body::Json($body);\n\n $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);\n\n //call on-before Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n // Set request timeout\n Request::timeout($this->config->getTimeout());\n\n // and invoke the API call request to fetch the response\n try {\n $response = Request::post($_queryUrl, $_headers, $_bodyJson);\n } catch (\\Unirest\\Exception $ex) {\n throw new ApiException($ex->getMessage(), $_httpRequest);\n }\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n if (!$this->isValidResponse($_httpResponse)) {\n return ApiResponse::createFromContext($response->body, null, $_httpContext);\n }\n\n $mapper = $this->getJsonMapper();\n $deserializedResponse = $mapper->mapClass($response->body, 'Square\\\\Models\\\\CreateLoyaltyAccountResponse');\n return ApiResponse::createFromContext($response->body, $deserializedResponse, $_httpContext);\n }",
"public function createLoanAsyncWithHttpInfo($loan)\n {\n $returnType = '\\GateApi\\Model\\Loan';\n $request = $this->createLoanRequest($loan);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"function addBankLoan($BankID, $LoanPeriod, $LoanInterestRate, $OverdueInterestRate, $CreatedBy)\r\n {\r\n $class_name = $this->class_name;\r\n $function_name = 'addBankLoan';\r\n if ( authenUser(func_get_args(), $this, $function_name) > 0 )\r\n return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this );\r\n\r\n $fields_values = array(\r\n \"BankID\" => $BankID,\r\n \"LoanPeriod\" => $LoanPeriod,\r\n \"LoanInterestRate\" => $LoanInterestRate,\r\n \"OverdueInterestRate\" => $OverdueInterestRate,\r\n \"CreatedBy\" => $CreatedBy,\r\n \"CreatedDate\" => $this->_MDB2_WRITE->date->mdbnow()\r\n );\r\n $this->_ERROR_CODE = $this->checkBankLoanValidate($fields_values);\r\n if($this->_ERROR_CODE == 0)\r\n {\r\n\r\n $query = sprintf( \"CALL sp_insertBankLoan ('%s','%s','%s','%s','%s')\", $BankID, $LoanPeriod, $LoanInterestRate, $OverdueInterestRate, $CreatedBy);\r\n $result = $this->_MDB2_WRITE->extended->getAll($query);\r\n // Can not add\r\n if(empty($result)) $this->_ERROR_CODE = 13032;\r\n else{\r\n if(isset($result[0]['varerror']))\r\n {\r\n //Invalid Bank ID\r\n if($result[0]['varerror'] == -1) $this->_ERROR_CODE = 13037;\r\n //Bank_Loan have been exist\r\n if($result[0]['varerror'] == -2) $this->_ERROR_CODE = 13041;\r\n //Success\r\n if($result[0]['varerror'] >0)\r\n {\r\n $this->items[0] = new SOAP_Value(\r\n 'items',\r\n '{urn:'. $class_name .'}'.$function_name.'Struct',\r\n array(\r\n 'ID' => new SOAP_Value(\"ID\", \"string\", $result[0]['varerror'])\r\n )\r\n );\r\n }\r\n }\r\n }\r\n }\r\n return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this );\r\n }",
"public function createViaRequest();",
"public function addLoan()\r\n {\r\n $loanName = readline(\"Enter loan name :\");\r\n $amount = integer(\"Enter amount :\");\r\n $duration = integer(\"Enter duration of the loan in months : \");\r\n $intrest = integer(\"Enter Intrest : \");\r\n $minSal = integer(\"Monthly income to eligible for loan : \");\r\n parent::$loans[$loanName][\"amount\"] = $amount;\r\n parent::$loans[$loanName][\"duration\"] = $duration;\r\n parent::$loans[$loanName][\"intrest\"] = $intrest;\r\n parent::$loans[$loanName][\"minSal\"] = $minSal;\r\n $emi = $this->emiCalculator($amount, $intrest, $duration);\r\n parent::$loans[$loanName][\"emi\"] = $emi;\r\n\r\n }",
"function create_bitlink( $referral_link ) {\n\n\t$token = request_bitly_access_token();\n\n\t$generic = '9067c44fdad46dbbbf6bfbc11f268796d5e71cbd';\n\t\n\t$url = 'https://api-ssl.bitly.com/v4/bitlinks';\n\n\t$headers = array(\n\t\t'Host: api-ssl.bitly.com',\n\t\t'Content-Type: application/json',\n\t\t'Authorization: Bearer ' . $generic,\n\t);\n\n\t$params = array(\n\t\t'long_url' \t=> $referral_link,\n\t);\n\t$json_string = json_encode($params);\n\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\tcurl_setopt($ch, CURLOPT_HEADER, 1);\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $json_string);\n\n\t$response = curl_exec($ch);\n\t$result = json_decode($response, true);\n\n\tcurl_close($ch);\n\n\treturn $response;\n}",
"public function approveLoan($request)\n {\n $user = auth()->user();\n $userId = $user->id;\n $loanId = $request['loan_id'];\n $requestStatus = $request['status'];\n\n $checkLoan = $this->loanModel->where('user_id', $userId)\n ->where('id', $loanId)\n ->first();\n\n if (!$checkLoan) {\n throw new \\Exception('Invalid loan id', 400);\n }\n if ($checkLoan['status'] == $this->approvedLoanStatus) {\n throw new \\Exception('Requested loan id is already approved', 400);\n }\n if ($checkLoan['status'] == $this->rejectedLoanStatus) {\n throw new \\Exception('Requested loan id is rejected', 400);\n }\n\n $totalAmount = $checkLoan['amount'];\n $totalTenure = $checkLoan['tenure'];\n\n $emiAmount = $totalAmount / $totalTenure;\n\n $this->loanModel\n ->where('user_id', $userId)\n ->where('id', $loanId)\n ->update(['status' => $requestStatus]);\n\n $currentDate = Carbon::now();\n\n if($requestStatus == $this->approvedLoanStatus){\n for($i=0;$i<$totalTenure;$i++){\n $emiDate = $currentDate->addDays(7);\n\n $addRepayment = new $this->loanRepaymentModel();\n $addRepayment->loan_id = $loanId;\n $addRepayment->emi_amount = $emiAmount;\n $addRepayment->date = $emiDate->format('Y-m-d');\n $addRepayment->save();\n }\n\n return $this->loanRepaymentModel->where('loan_id',$loanId)->get();\n }\n\n }",
"public function offerLoan(OfferLoanRequest $request)\n { \n $request->request->add(['admin_id'=> Auth::id()]);\n\n $new_loan = $this->loanRepo->createLoan($request->all());\n\n if($new_loan){\n $new_repayment_plan = $this->repayRepo->createRepaymentPlan($new_loan->id);\n }\n \n $details_loans = $this->loanRepo->details($new_loan->id);\n return $details_loans;\n }",
"function create ($acc)\n{\n \n \n $zoho_create = curl_init();\ncurl_setopt($zoho_create,CURLOPT_URL,\"https://www.zohoapis.com/crm/v2/Leads\");\ncurl_setopt($zoho_create,CURLOPT_POST, 1); \ncurl_setopt($zoho_create,CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($zoho_create,CURLOPT_CONNECTTIMEOUT ,3);\n//curl_setopt($zoho_upload,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1);\ncurl_setopt($zoho_create,CURLOPT_TIMEOUT, 30);\ncurl_setopt($zoho_create,CURLOPT_HTTPHEADER, array(\n 'Authorization: Zoho-oauthtoken '.$acc\n \n ));\n \n \n$data =array(\"data\"=>array(array(\"Age_at_Quote_Request\"=> \"65\",\"Last_Name\"=>\"Test\",\"First_Name\"=>\"Quotes\",\"Mobile\"=>\"9090909090\",\"Gender\"=>\"Male\",\"Zip_Code\"=>\"15963\",\"Tobacco_Status\"=>\"Tobacco\",\"Date_of_Birth\"=>\"1999-05-02\")));\n$import = json_encode($data,true);\n curl_setopt(\n$zoho_create,\nCURLOPT_POSTFIELDS,\n$import);\n$response_zoho_create = curl_exec($zoho_create);\n\n\ncurl_close($response_zoho_create);\n return $response_zoho_create;\n}",
"public function actionCreate()\n {\n $model = new Loan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"function createWebLink($access_token, $url, $id, $name, $description){\n $header = ['Authorization: Bearer'.' '.$access_token];\n $params = json_encode( [ 'name'=> $name, 'parent'=> [\"id\"=> $id], 'url'=> $url, 'description' => $description ]);\n $options = array(\n CURLOPT_URL => 'https://api.box.com/2.0/web_links',\n CURLOPT_POSTFIELDS => $params,\n CURLOPT_POST => true,\n CURLOPT_HTTPHEADER => $header,\n CURLOPT_RETURNTRANSFER => true,\n );\n $ch = curl_init();\n curl_setopt_array($ch, $options);\n $result = curl_exec($ch);\n curl_close($ch);\n return json_decode($result);\n}",
"function radius_create_request($radius_handle, $type) {}",
"function radius_create_request ($radius_handle, $type) {}",
"public function cancelLoanWithHttpInfo($loan_id, $currency)\n {\n $request = $this->cancelLoanRequest($loan_id, $currency);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\GateApi\\Model\\Loan' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\GateApi\\Model\\Loan', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\GateApi\\Model\\Loan';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\GateApi\\Model\\Loan',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function mergeLoansWithHttpInfo($currency, $ids)\n {\n $request = $this->mergeLoansRequest($currency, $ids);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 201:\n if ('\\GateApi\\Model\\Loan' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\GateApi\\Model\\Loan', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\GateApi\\Model\\Loan';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\GateApi\\Model\\Loan',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"function applyForLoan(float $amount, LoanSystem $loanSystem): LoanApplicationResponse;",
"public function getLoanWithHttpInfo($loan_id, $side)\n {\n $request = $this->getLoanRequest($loan_id, $side);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\GateApi\\Model\\Loan' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\GateApi\\Model\\Loan', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\GateApi\\Model\\Loan';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\GateApi\\Model\\Loan',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function create(Request $request, Loan $loan)\n {\n if(!Auth::user()->can('loan.add')){\n return back()->with([Message::ERROR_KEY=>trans('message.no_permission'), 'alert-type' => 'warning'], 403);\n }\n\n $loan->account_number = nextLoanAccNum();\n $title = trans('app.create');\n $formType = FormType::CREATE_TYPE;\n $branches = Branch::getAll();\n $clients = Client::orderBy('name')->get();\n $products = Product::orderBy('name')->get();\n $agents = [];\n if (isAdmin() && old('branch') !== null) { // When form validation has error\n $agents = Staff::where('branch_id', old('branch'))->orderBy('name')->get();\n }\n\n return view('loan/form', compact(\n 'agents',\n 'branches',\n 'clients',\n 'formType',\n 'loan',\n 'products',\n 'title'\n ));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get comments by IdSeller | public static function getBySeller($id_seller, $p = 1, $n = null, $id_customer = null)
{
if (!Validate::isUnsignedId($id_seller))
return false;
$validate = Configuration::get('NPS_SELLER_COMMENTS_MODERATE');
$p = (int)$p;
$n = (int)$n;
if ($p <= 1)
$p = 1;
if ($n != null && $n <= 0)
$n = 5;
$cache_id = 'SellerComment::getBySeller_'.(int)$id_seller.'-'.(int)$p.'-'.(int)$n.'-'.(int)$id_customer.'-'.(bool)$validate;
if (!Cache::isStored($cache_id))
{
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT pc.`id_seller_comment`,
(SELECT count(*) FROM `'._DB_PREFIX_.'seller_comment_usefulness` pcu WHERE pcu.`id_seller_comment` = pc.`id_seller_comment` AND pcu.`usefulness` = 1) as total_useful,
(SELECT count(*) FROM `'._DB_PREFIX_.'seller_comment_usefulness` pcu WHERE pcu.`id_seller_comment` = pc.`id_seller_comment`) as total_advice, '.
((int)$id_customer ? '(SELECT count(*) FROM `'._DB_PREFIX_.'seller_comment_usefulness` pcuc WHERE pcuc.`id_seller_comment` = pc.`id_seller_comment` AND pcuc.id_customer = '.(int)$id_customer.') as customer_advice, ' : '').
((int)$id_customer ? '(SELECT count(*) FROM `'._DB_PREFIX_.'seller_comment_report` pcrc WHERE pcrc.`id_seller_comment` = pc.`id_seller_comment` AND pcrc.id_customer = '.(int)$id_customer.') as customer_report, ' : '').'
IF(c.id_customer, CONCAT(c.`firstname`, \' \', LEFT(c.`lastname`, 1)), pc.customer_name) customer_name, pc.`content`, pc.`grade`, pc.`date_add`, pc.title
FROM `'._DB_PREFIX_.'seller_comment` pc
LEFT JOIN `'._DB_PREFIX_.'customer` c ON c.`id_customer` = pc.`id_customer`
WHERE pc.`id_seller` = '.(int)($id_seller).($validate == '1' ? ' AND pc.`validate` = 1' : '').'
ORDER BY pc.`date_add` DESC
'.($n ? 'LIMIT '.(int)(($p - 1) * $n).', '.(int)($n) : ''));
Cache::store($cache_id, $result);
}
return Cache::retrieve($cache_id);
} | [
"public function getSellerComment();",
"public function getSellerComment()\n {\n return $this->sellerComment;\n }",
"public function getSellerOffers($sellerId);",
"function getPrivateComments($id = null){\n $id = Crypt::decrypt($id);\n $commentRow = DB::table('org_opportunity_comments')->where('id', $id)->first(); //dd($commentRow);\n $oid = $commentRow->oid;\n $filters['applicant_id'] = $commentRow->from_id;\n $filters['to_id'] = $commentRow->to_id;\n $filters['comment_type'] = config('kloves.COMMENT_TYPE_PRIVATE');\n $filters['comment_status'] = config('kloves.COMMENT_ACTIVE'); \n $pvtcommentdata = $this->opportunity->getOppCommentList($oid,$filters); //dd($pvtcommentdata);\n return view('opportunity.view-comments',compact('pvtcommentdata'));\n }",
"public function getCommentsList($id);",
"public function getComments()\n {\n return Comment::whereIdFor(Auth()->user()->id)->get();\n }",
"public function getSellerComment()\n {\n if (is_null($this->sellerComment)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_SELLER_COMMENT);\n if (is_null($data)) {\n return null;\n }\n $this->sellerComment = (string) $data;\n }\n\n return $this->sellerComment;\n }",
"public function setSellerId($seller_id);",
"public function getComments($id)\n {\n return Product::find($id)->with('comments')->get();\n }",
"public function findComment($id);",
"public function getProductDetailsBySellerCustomerId($sellerId, $customerId);",
"public function findCommentById($id);",
"public function getSeller($id) {\n return $this->client->get('/whoknocked/sellers/'.$id, null, Seller::class);\n }",
"public static function getCommentsInBlogs($id){\n\t\t\n\t\t$conn = new PDO(DB_DSN,DB_USERNAME,DB_PASSWORD);\n\t\t$sql = \"SELECT * FROM comments LEFT JOIN users ON user_id = comment_by WHERE comment_blog = :comment_blog\";\n\t\t$stmt = $conn->prepare($sql);\n\t\t$stmt->bindValue(\":comment_blog\",$id,PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t\t$list = array();\n\t\twhile($row = $stmt->fetch())\n\t\t{\n\t\t\t$comments = new Comments($row);\n\t\t\t$list[] = $comments;\n\t\t}\n\t\treturn(array(\"results\"=>$list));\n\t}",
"public function getSellerId()\n {\n return $this->seller_id;\n }",
"public function getMediaComments($id);",
"public function getSellerByUserId($id)\n {\n $seller = Sellers::where('user_id', $id)->first();\n return $seller;\n }",
"public function getComments($bid){\n\t\t$P=C('DB_PREFIX');\n\t\t$r = $this->join(\"{$P}user as U ON U.uid={$P}buy_comment.uid\")->where(array('bid'=>intval($bid)))->order(array('id'=>'DESC'))->limit(20)->field('U.uid,U.uname,vote,content')->select();\n\t\treturn $r;\n\t}",
"function getBlogComments(){\n $blogid = ($_GET['id']);\n $comments = Comments::getComments($blogid);\n return $comments;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation archiveVirtualBusinessCardAsyncWithHttpInfo Archive VirtualBusinessCard | public function archiveVirtualBusinessCardAsyncWithHttpInfo($id)
{
$returnType = '\OpenAPI\Client\Model\VirtualBusinessCard';
$request = $this->archiveVirtualBusinessCardRequest($id);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
);
} | [
"public function archiveVirtualBusinessCardAsync($id)\n {\n return $this->archiveVirtualBusinessCardAsyncWithHttpInfo($id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function createVirtualBusinessCardAsyncWithHttpInfo($wt_virtual_business_card_create_params)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\VirtualBusinessCard';\n $request = $this->createVirtualBusinessCardRequest($wt_virtual_business_card_create_params);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function fetchVirtualBusinessCardAsyncWithHttpInfo($id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\VirtualBusinessCard';\n $request = $this->fetchVirtualBusinessCardRequest($id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function fetchVirtualBusinessCardRequestsAsyncWithHttpInfo($id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\WalletPageView[]';\n $request = $this->fetchVirtualBusinessCardRequestsRequest($id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function postGenerateDigitalCardAsyncWithHttpInfo($body, $accept_language = 'cs, en-gb;q=0.8')\n {\n $returnType = '\\CrmCareCloud\\Webservice\\RestApi\\Client\\Model\\InlineResponse20020';\n $request = $this->postGenerateDigitalCardRequest($body, $accept_language);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function createAchBusinessUsingPostAsyncWithHttpInfo($business_request)\n {\n $returnType = '\\com\\hydrogen\\integration\\Model\\AchBusinessResponseVO';\n $request = $this->createAchBusinessUsingPostRequest($business_request);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function archivePaymentObjectBroadcastAsyncWithHttpInfo($broadcast_id)\n {\n $returnType = 'mixed';\n $request = $this->archivePaymentObjectBroadcastRequest($broadcast_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function generateBarcodeEAN8AsyncWithHttpInfo($value)\n {\n $returnType = 'string';\n $request = $this->generateBarcodeEAN8Request($value);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function fetchAllVirtualBusinessCardsRequest($is_archive_included = null)\n {\n\n $resourcePath = '/v2/virtualBusinessCard/all';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($is_archive_included !== null) {\n if('form' === 'form' && is_array($is_archive_included)) {\n foreach($is_archive_included as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['isArchiveIncluded'] = $is_archive_included;\n }\n }\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function archiveLinkBookAsyncWithHttpInfo($id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\LinkBook';\n $request = $this->archiveLinkBookRequest($id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function cardClientCompanyAvailableVariantsPostAsyncWithHttpInfo()\n {\n $returnType = '\\AndyDune\\MgmtIntaxxApi\\Model\\OrderCardClientCompanyAvailableVariantsResponse';\n $request = $this->cardClientCompanyAvailableVariantsPostRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function restoreVirtualBusinessCardRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling restoreVirtualBusinessCard'\n );\n }\n\n $resourcePath = '/v2/virtualBusinessCard/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createVirtualBusinessCardAsync($wt_virtual_business_card_create_params)\n {\n return $this->createVirtualBusinessCardAsyncWithHttpInfo($wt_virtual_business_card_create_params)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function archiveTableAsyncWithHttpInfo($table_id_or_name)\n {\n $returnType = '';\n $request = $this->archiveTableRequest($table_id_or_name);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function restoreVirtualBusinessCardAsync($id)\n {\n return $this->restoreVirtualBusinessCardAsyncWithHttpInfo($id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function archiveWithHttpInfo($body, $mailbox, $flag)\n {\n $returnType = '';\n $request = $this->archiveRequest($body, $mailbox, $flag);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function archiveQRCodeDesignAsyncWithHttpInfo($id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\WTQRCodeDesign';\n $request = $this->archiveQRCodeDesignRequest($id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function dataProcessingsArchiveAsyncWithHttpInfo($id, $tenant_id, $workspace_id)\n {\n $returnType = '';\n $request = $this->dataProcessingsArchiveRequest($id, $tenant_id, $workspace_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function archiveMerchantCreditAsyncWithHttpInfo($id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\WTMerchantCredit';\n $request = $this->archiveMerchantCreditRequest($id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Try to get an IMDB id from search engines. | protected function imdbIDFromEngines()
{
if ($this->googleLimit < 41 && (time() - $this->googleBan) > 600) {
if ($this->googleSearch() === true) {
return true;
}
}
if ($this->yahooLimit < 41) {
if ($this->yahooSearch() === true) {
return true;
}
}
// Not using this right now because bing's advanced search is not good enough.
/*if ($this->bingLimit < 41) {
if ($this->bingSearch() === true) {
return true;
}
}*/
return false;
} | [
"function imdb_url_id($url) {\n if (!is_string($url)) {\n return '';\n }\n $id = regex_get('#title\\\\/(.*)\\\\/#', $url, 1);\n return empty($id) ? FALSE : $id;\n}",
"public function getImdbId()\n {\n return $this->getId(self::IMDB_IDENTIFIER);\n }",
"function searchId() {\n\t\t$db = new PDO(\"mysql:dbname=imdb;charset=UTF8\", \"lukeys24\", \"mC88TyBLFo\");\n\t\t$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n\t\t$firstName = $_GET[\"firstname\"] . '%';\n\t\t$firstName = $db->quote($firstName);\n\t\t$lastName = $_GET[\"lastname\"];\n\t\t$lastName = $db->quote($lastName);\n\n\t\t# Searches for the actor that best matches the user's input.\n\t\t$actorId = $db->query(\"SELECT id\n\t\t\t\t\t\t\t FROM actors\n\t\t\t\t\t\t\t WHERE last_name = $lastName\n\t\t\t\t\t\t\t AND first_name LIKE $firstName\n\t\t\t\t\t\t\t ORDER BY film_count DESC, id ASC\n\t\t\t\t\t\t\t LIMIT 1\");\n\t\t# If an actor wasn't found then the webpage displays a message otherwise\n\t\t# the database and id are returned.\n\t\tif ($actorId->rowCount() < 1) { ?>\n\t\t\t<p>Actor <?=$_GET[\"firstname\"] . \" \" . $_GET[\"lastname\"]?> not found</p>\n\t\t<?php } else {\n\t\t\t$row = $actorId->fetch();\n\t\t\t$id = $row[\"id\"];\n\t\t\t$id = $db->quote($id);\n\t\t\treturn array($db, $id);\n\t\t}\n\t}",
"function imdbSearch($title, $aka=null)\n{\n global $imdbServer;\n global $imdbIdPrefix;\n global $CLIENTERROR;\n global $cache;\n\n $url = $imdbServer.'/find?q='.urlencode($title);\n if ($aka) $url .= ';s=tt;site=aka';\n\n $resp = httpClient($url, $cache);\n if (!$resp['success']) $CLIENTERROR .= $resp['error'].\"\\n\";\n\n $data = array();\n\n // add encoding\n $data['encoding'] = $resp['encoding'];\n\n // direct match (redirecting to individual title)?\n // @todo i don't think this gets called anymore, investigate\n if (preg_match('/^'.preg_quote($imdbServer,'/').'\\/[Tt]itle(\\?|\\/tt)([0-9?]+)\\/?/', $resp['url'], $single))\n {\n $info = array();\n $info['id'] = $imdbIdPrefix.$single[2];\n\n // Title\n preg_match('/<title>(.*?) \\([1-2][0-9][0-9][0-9].*?\\)<\\/title>/i', $resp['data'], $m);\n list($t, $s) = explode(' - ', trim($m[1]), 2);\n $info['title'] = trim($t);\n $info['subtitle'] = trim($s);\n\n $data[] = $info;\n }\n\n // multiple matches\n else if (preg_match_all('#div class=\"ipc-metadata-list-summary-item__tc\".*href=\"/title/tt(\\d+)/.*>([^\\<]+)</a>.*<ul.*>(.*)</ul>.*</div>#Uism', $resp['data'], $multi, PREG_SET_ORDER))\n {\n foreach ($multi as $row)\n {\n $info = [\n 'id' => $imdbIdPrefix.$row[1],\n 'title' => $row[2],\n 'year' => null\n ];\n if (preg_match_all('#<label.*>([^\\<]+)</label>#Uism', $row[3], $labels, PREG_PATTERN_ORDER))\n {\n foreach ($labels[1] as $label)\n {\n if (preg_match('#^(\\d{4})$#i', $label)) $info['year'] = $label;\n if (preg_match('#^.*(episode|series)$#i', $label)) $info['title'] .= ' ('.$label.')';\n }\n }\n $data[] = $info;\n }\n } elseif (preg_match_all('/<div class=\"col-title\">.+?<a href=\"\\/title\\/tt(\\d+)\\/\\?ref_=adv_li_tt\".+?>(.+?)<\\/a>.+?<span .+?>\\((\\d+).*?\\)<\\/span>/is', $resp['data'], $ary, PREG_SET_ORDER)) {\n foreach ($ary as $row) {\n $info = array();\n $info['id'] = $imdbIdPrefix.$row[1];\n $info['title'] = $row[2];\n $info['year'] = $row[3];\n $data[] = $info;\n }\n }\n\n return $data;\n}",
"function get_series_tmdb_id ($title, $year) {\n global $tmdb_api_key;\n $_title = urlencode($title);\n $url = \"https://api.themoviedb.org/3/search/tv?api_key={$tmdb_api_key}&query={$_title}&first_air_date_year={$year}\";\n $results = curl_http_get($url);\n if (isset($results['results'])) {\n foreach ($results['results'] as $series) {\n if ((isset($series['name']) && strcasecmp($title, $series['name']) === 0) || (isset($series['original_name']) && strcasecmp($title, $series['original_name']) === 0)) {\n return $series['id'];\n }\n }\n return (count($results['results']) > 0 && isset($results['results'][0]) && isset($results['results'][0]['id'])) ? $results['results'][0]['id'] : '';\n }\n return '';\n}",
"function lookupbotid($botname){\r\n\r\n\t$name=addslashes($botname);\r\n $q=\"select id from bots where botname='$name'\";\r\n $selectcode = mysql_query($q);\r\n if ($selectcode) {\r\n while ($q = mysql_fetch_array($selectcode)){\r\n return $q[\"id\"];\r\n }\r\n }\r\n\treturn -1;\r\n\r\n}",
"public function videoid()\n {\n $key = env(\"GOOGLE_API_KEY\");\n $q = urlencode($_GET[\"artist\"].\"+\".$_GET[\"song\"].\"+song\");\n $part = urlencode(\"id,snippet\");\n $args = \"part=\".$part.\"&q=\".$q.\"&key=\".$key.\"&maxResults=1\";\n\n # Query YouTube API and return video id\n $json = json_decode(file_get_contents(\"https://www.googleapis.com/youtube/v3/search?\".$args), true);\n return $json[\"items\"][0][\"id\"][\"videoId\"];\n }",
"function get_video_id($url) {\n $parts = parse_url($url);\n // Handle Youtube\n if (strpos($url, \"youtube.com\")) {\n\n // Make sure $url had a query string\n if (!array_key_exists('query', $parts))\n return null;\n\n parse_str($parts['query']);\n\n // Return the 'v' parameter if it existed\n return isset($v) ? $v : null;\n }\n else if (strpos($url, \"vimeo.com\")) {\n $video_id=explode('vimeo.com/', $url);\n $video_id=$video_id[1];\n return $video_id;\n }\n else if(strpos($url,\"dailymotion.com\")){\n $debut_id = explode(\"/video/\",$url,2);\n $id_et_fin_url = explode(\"_\",$debut_id[1],2);\n $id = $id_et_fin_url[0];\n return $id;\n }\n else{}\n}",
"function obtainId($url){\n preg_match('~/\\w{32}/(items/\\w+|tasks)/([\\w-_]+)/?$~', $url, $matches);\n return $matches[2];\n}",
"public function getSearchIdWithFallback()\n {\n $searchId = Mage::helper('tooso/session')->getSearchId();\n if($searchId == null || $searchId == \"\"){\n $searchId = substr('magento_'.Mage::helper('tooso')->getUuid(), 0, 36);\n }\n\n return $searchId;\n }",
"public function getImdbId() {\n\t\treturn $this->imdbId;\n\t}",
"function getPaperId($searchStr)\n {\n global $_CONN;\n\n if(!$_CONN)\n somethingWentWrong();\n\n $query = \"SELECT paper_id FROM newspaper WHERE paper_name LIKE '%$searchStr%'\";\n $result = mysqli_query($_CONN, $query);\n $resultArray = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n if(sizeof($resultArray) == 0)\n noDataFound();\n\n $paperId = $resultArray[0]['paper_id'];\n\n return $paperId;\n }",
"public function getIdFromLink(){\n if(empty($this->link)){\n return null;\n }\n\n $template='/^(?:http[s]?:\\/\\/)?(?:www.)?youtube.com\\/watch\\?v=([\\w-]{11}).*$/';\n\n preg_match($template, $this->link, $result);\n\n return isset($result[1])?$result[1]:null;\n }",
"private function getImdbUrl(): string\n {\n $imdbBaseUrl = \"https://www.imdb.com\";\n\n if (!empty($this->imdbInfo)) {\n return $imdbBaseUrl . $this->imdbInfo['results'][0]['id'];\n }\n\n return $imdbBaseUrl;\n }",
"function getID($aut_title)\n {\n $log = FezLog::get();\n $db = DB_API::get();\n\n $stmt = \"SELECT\n aut_id\n FROM\n \" . APP_TABLE_PREFIX . \"author\n WHERE\n aut_title=\".$db->quote($aut_title);\n try {\n $res = $db->fetchOne($stmt);\n }\n catch(Exception $ex) {\n $log->err($ex);\n return '';\n }\n return $res;\n }",
"function tmdb_get_id($showname){\n\treturn tmdb_get_show($showname)->id;\n}",
"protected function get_instagram_id() {\n return self::get_instagram_id_from_url( $this->get_embed_url() );\n }",
"function grav_get_vimeo_id($url)\n{\n\tpreg_match('/([0-9]+)/', $url, $matches);\n\n\tif(!empty($matches[1]) && is_numeric($matches[1]))\n\t{\n\t\treturn $matches[1];\n\t}\n\telse if(!$pos && strpos($url, 'http') === false)\n\t{\n\t\treturn $url;\n\t}\n\n\treturn 0;\n}",
"function extract_youtube_id($content) {\n if( preg_match('/\\[youtube.+id=\"(.*?)\".*\\]/i',$content,$regs) ) {\n return $regs[1];\n }\n else {\n return \"NO_VIDEO\";\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the CSS URL | public static function css_url() {
if ( self::$css_url ) {
return self::$css_url;
}
return self::$css_url = self::assets_url().'css/';
} | [
"public final function getCssUrl()\n {\n return $this->_getUrl('css');\n }",
"static public function css_url()\n\t{\n\t\treturn self::url('css/' . DIRINDEX_CSS);\n\t}",
"public function get_style_file_url() {\n\t\t$path = $this->get_style_file_path();\n \t\treturn is_readable($path) && filesize($path) ? $this->get_url(self::CSS_FILE_PATH) : null;\n\t}",
"function getCssUrl($request) {\n\t\treturn $request->getBaseUrl() . '/' . $this->getPluginPath() . '/css';\n\t}",
"function dirindex_css_url()\n{\n\tglobal $dirindex_fugue_mobi;\n\n\techo $dirindex_fugue_mobi->css_url();\n}",
"public function get_url() {\n\n\t\t$upload_dir = wp_upload_dir();\n\t\treturn esc_url_raw( $upload_dir['baseurl'] . '/kirki-css/styles.css' );\n\n\t}",
"function ADMIN_CSS_URL()\n\t{\n\t\treturn url('admin/css').\"/\";\n\t}",
"public function getStyleSheetURL();",
"public function getStylesheetUrl()\n {\n return self::STYLESHEET_URL;\n }",
"protected function get_social_logos_css_url() {\n\t\t\t$url = ub_url( 'external/icon-font/social-logos.css' );\n\t\t\treturn $url;\n\t\t}",
"public function get_url()\n {\n // This will be appended with the modification timestamp, so the styles are forced to recache if the template or theme is edited\n $template_modified = strtotime($this->template->date_modified);\n $theme_modified = strtotime($this->date_modified);\n $last_modified = $theme_modified > $template_modified ? $theme_modified : $template_modified;\n\n $theme = !empty($_GET['usetheme']) ? $_GET['usetheme'] : $this->stub;\n\n return '/frontend/assets/theme_css/'.$theme.'?ts='.$last_modified;\n }",
"public static function cssUrl($url) {\n\t\treturn Yii::app()->baseUrl.'/css/'.$url;\n\t}",
"public function getCssPath()\n {\n return $this->_path . self::PATH_CSS;\n }",
"public function getCssDirectoryURL()\n\t{\n\t\treturn $this->cssDirectoryURL;\n\t}",
"protected function getCSSPath(){\n return $this->cssPath;\n }",
"public static function cssUrl($url) {\n\t\treturn Yii::app ()->baseUrl . '/css/' . $url;\n\t}",
"private function getCssRef()\n {\n $cssRefScript = \"\";\n if (isset($this->pxConfig['css_ref'])) {\n $cssRefScript = $this->pxConfig['css_ref'];\n }\n\n return $cssRefScript;\n }",
"function get_the_css_urls() {\n\n md_get_the_css_urls();\n \n }",
"public function stylesheet_url() {\n\t\treturn site_url('admin/addons/blog/css');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get log pattern by type (user|user_log) | protected function getEntryPattern($type)
{
switch ($type) {
case self::TYPE_USER:
$pattern = '/(?P<ip>' . $this->ipPatterns . ')'
. '\|(?P<browser>' . $this->textPattern . ')'
. '\|(?P<system>' . $this->textPattern . ')/';
break;
case self::TYPE_USER_LOG:
$pattern = '/(?P<date>\d{4}-\d{2}-\d{2})'
. '\|(?P<time>\d{2}:\d{2})'
. '\|(?P<ip>'.$this->ipPatterns.')'
. '\|(?P<url_from>'.$this->urlPattern.')'
. '\|(?P<url_to>'.$this->urlPattern.')/';
break;
default:
throw new \Exception('Wrong parser type');
}
return $pattern;
} | [
"abstract public function getLogType();",
"public static function getLogsByType($type)\n {\n return Log::where(\"type\", \"=\", $type)->get();\n }",
"function searchByType($type) {\n $sql = sprintf(\"SELECT time, group_id, item_id, user_id, old_value, new_value FROM plugin_docman_log WHERE type = %s\",\n\t\t\t\t$this->da->quoteSmart($type));\n return $this->retrieve($sql);\n }",
"public function getLogType()\n {\n return $this->log_type;\n }",
"abstract public function getWptLogTypes();",
"function fn_get_log_types()\n{\n $types = array();\n $section = Settings::instance()->getSectionByName('Logging');\n\n $settings = Settings::instance()->getList($section['section_id']);\n\n foreach ($settings['main'] as $setting_id => $setting_data) {\n $types[$setting_data['name']]['type'] = str_replace('log_type_', '', $setting_data['name']);\n $types[$setting_data['name']]['description'] = $setting_data['description'];\n $types[$setting_data['name']]['actions'] = $setting_data['variants'];\n }\n\n return $types;\n}",
"public function getLogTypeAttribute()\n {\n return 'User';\n }",
"public function getLog($log_type) {\n return $this->executor->execute(\n DriverCommand::GET_LOG,\n array('type' => $log_type)\n );\n }",
"function getUserTypeString($type){\n switch ($type) {\n case 0:\n return 'admin';\n case 1:\n return 'instractor';\n case 2:\n return 'qa_member';\n case 3:\n return 'department_manager';\n case 4:\n return 'waiting user';\n default:\n return 'non-registered user';\n }\n }",
"function getAccess($type) {\n\t\t$type_roles = $this->getRoles($type);\n\t\t$everyone = '//' . Omelette::getUserSpace();\n\t\t$user = EGS::getUsername();\n\t\tif(in_array($everyone, $type_roles)) {\n\t\t\t$return = 'everyone';\n\t\t} else if(count($type_roles) == 1 && current($type_roles) == $user) {\n\t\t\t$return = 'private';\n\t\t} else {\n\t\t\t$return = 'multi';\n\t\t}\n\t\treturn $return;\n\t}",
"public function load_log_pattern() {\n \t$fp=fopen($this->log_file,'r');\n \tif($fp) {\n \t\tunset($this->g_log_arr);\n \t\t$temp_log_arr=array();\n \t\t$log_pattern_index=0;\n \n while(($line=fgets($fp)) !== false) {\n \t\t\tunset($temp_log_arr);\n \t\t\t$temp=explode(\"$$\",$line);\n \t\t\tforeach($temp as $t) {\n \t\t\t\tlist($k,$v) = explode(':',$t);\n \t\t\t\t$temp_log_arr[$k]=$v;\n \t\t\t}\n \t\t\t$this->g_log_arr[]=$temp_log_arr;\n\n $this->g_log_arr[$log_pattern_index][\"log_index\"] = (int) $this->g_log_arr[$log_pattern_index][\"log_index\"];\n $this->g_log_arr[$log_pattern_index][\"log_score\"] = (float) $this->g_log_arr[$log_pattern_index][\"log_score\"];\n \t\t $log_pattern_index++;\n }\n \t\tfclose($fp);\n \t}\n \t#print_r(explode(\"##\",$this->g_log_arr[0][\"current\"]));\n \t#print_r($this->g_log_arr);\n }",
"function getLogs($type, $limit) {\r\n\r\n $sql = \"SELECT * FROM logging\";\r\n\r\n if ($type != '*') {\r\n $sql .= \" WHERE type='$type'\";\r\n }\r\n\r\n if ($limit != '*') {\r\n $limit = intval($limit);\r\n $sql .= \" LIMIT $limit\";\r\n }\r\n\r\n return $this->db->runQuery($sql);\r\n }",
"public function test_get_logs_by_type()\n\t{\n\t\t$message = 'Expected entry test_get_logs_by_type';\n\t\t$types = array_keys($this->types);\n\t\t$modules = array_values($this->types);\n\t\t$entries = array();\n\n\t\tfor( $i=0; $i<5; $i++) {\n\t\t\t$entries[] = new LogEntry(array(\n\t\t\t 'user_id' => $this->user->id,\n\t\t\t 'module' => $modules[$i],\n\t\t\t 'type' => $types[$i],\n\t\t\t 'severity' => 'info',\n\t\t\t 'message' => $message . $i\n\t\t\t));\n\t\t}\n\t\t$entries[] = new LogEntry(array(\n\t\t 'user_id' => $this->user->id,\n\t\t 'type' => 'testing',\n\t\t 'module' => 'unit_tests',\n\t\t 'severity' => 'crit',\n\t\t 'message' => $message . ++$i\n\t\t));\n\n\t\tforeach($entries as $entry) {\n\t\t\t$entry->insert();\n\t\t}\n\t\t$entries = EventLog::get(array('type' => 'testing'));\n\t\t$this->assert_true(2 == count($entries));\n\t\t$entries = EventLog::get(array('type' => 'testing2'));\n\t\t$this->assert_true( $entries->onelogentry);\n\n\t\tforeach($entries as $entry) {\n\t\t\t$entry->delete();\n\t\t}\n\t}",
"function gather_log($id=false,$type=\"place\") {\n\n\t$log = array();\n\t\n\t// Get a log for a user\n\tif($id!==false && $type == \"user\") {\n\t\n\t$query = \"\n\t\tSELECT * FROM \n\t\t(\n\t\t\t\tSELECT `id`,`ip`,`datetime`,`fk_user`,\n\t\t\t\t\t `description` AS `log_entry`,\n\t\t\t\t\t `language` AS `log_meta`,\n\t\t\t\t\t 'description' AS `log_type`\n\t\t\t\tFROM `t_points_descriptions` \n\t\t\t\tWHERE `fk_user` = \".mysql_real_escape_string($id).\" \n\n\n\t\t\tUNION ALL\n\n\t\t\t\tSELECT `id`,`ip`,`datetime`,`fk_user`,\n\t\t\t\t\t `rating` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t 'rating' AS `log_type`\n\t\t\t\tFROM `t_ratings` \n\t\t\t\tWHERE `fk_user` = \".mysql_real_escape_string($id).\" \n\t\t\t\t\tAND `datetime` IS NOT NULL\n\n\n\t\t\tUNION ALL\n\n\t\t\t\tSELECT `id`,`ip`,`datetime`,`fk_user`,\n\t\t\t\t\t `waitingtime` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t 'waitingtime' AS `log_type`\n\t\t\t\tFROM `t_waitingtimes` \n\t\t\t\tWHERE `fk_user` = \".mysql_real_escape_string($id).\" \n\t\t\t\t\tAND `datetime` IS NOT NULL\n\n\n\t\t\tUNION ALL\n\t\t\t\t\n\t\t\t\tSELECT `id`,`ip`,`datetime`,`fk_user`,\n\t\t\t\t\t `comment` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t 'comment' AS `log_type`\n\t\t\t\tFROM `t_comments` \n\t\t\t\tWHERE `fk_user` = \".mysql_real_escape_string($id).\" AND `hidden` IS NULL \n\t\t\t\t\tAND `datetime` IS NOT NULL\n\n\n\t\t\tUNION ALL\n\n\t\t\t\tSELECT \n\t\t\t\t\t`id` AS `id`, \n\t\t\t\t\t'' AS `ip`, \n\t\t\t\t\t`datetime`, \n\t\t\t\t\t`user` AS `fk_user`,\n\t\t\t\t\t`locality` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t'place' AS `log_type`\n\t\t\t\tFROM `t_points` \n\t\t\t\tWHERE `user` = \".mysql_real_escape_string($id).\"\n\t\t\t\t\t\t\n\t\t) \n\t\tAS `log`\n\t\tORDER BY `datetime` DESC\";\n\t\t\t\n/*\t\t\t\t\n\t\t\tUNION ALL\n\n\n\t\t\t\tSELECT \n\t\t\t\t\t`id`, \n\t\t\t\t\t'' AS `ip`, \n\t\t\t\t\t`datetime`, \n\t\t\t\t\t`user_id` AS `fk_user`,\n\t\t\t\t\t'' AS `fk_point`, \n\t\t\t\t\t`country` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t'public_transport' AS `log_type`\n\t\t\t\tFROM `t_ptransport` \n\t\t\t\tWHERE `user_id` = \".mysql_real_escape_string($id).\"\n\t\t\t\t\tAND `datetime` IS NOT NULL\n\n\n\t\t\tUNION ALL\n\n\n\t\t\t\tSELECT \n\t\t\t\t\t`id`, \n\t\t\t\t\t'' AS `ip`, \n\t\t\t\t\t`registered` AS `datetime`, \n\t\t\t\t\t`id` AS `fk_user`,\n\t\t\t\t\t'' AS `fk_point`, \n\t\t\t\t\t`country` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t'user' AS `log_type`\n\t\t\t\tFROM `t_users` \n\t\t\t\tWHERE `id` = \".mysql_real_escape_string($id).\"\n\t\t\t\t\tAND `registered` IS NOT NULL\n\n*/\n\n\t\n\t}\n\t// Get a log for a place\n\telseif($id!==false && $type == \"place\") {\n\t\n\t$query = \"\n\t\tSELECT * FROM \n\t\t(\n\t\t\t\tSELECT `id`,`ip`,`datetime`,`fk_user`,\n\t\t\t\t\t `description` AS `log_entry`,\n\t\t\t\t\t `language` AS `log_meta`,\n\t\t\t\t\t 'description' AS `log_type`\n\t\t\t\tFROM `t_points_descriptions` \n\t\t\t\tWHERE `fk_point` = \".mysql_real_escape_string($id).\" \n\n\n\t\t\tUNION ALL\n\n\t\t\t\tSELECT `id`,`ip`,`datetime`,`fk_user`,\n\t\t\t\t\t `rating` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t 'rating' AS `log_type`\n\t\t\t\tFROM `t_ratings` \n\t\t\t\tWHERE `fk_point` = \".mysql_real_escape_string($id).\" \n\t\t\t\t\tAND `datetime` IS NOT NULL\n\n\n\t\t\tUNION ALL\n\n\t\t\t\tSELECT `id`,`ip`,`datetime`,`fk_user`,\n\t\t\t\t\t `waitingtime` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t 'waitingtime' AS `log_type`\n\t\t\t\tFROM `t_waitingtimes` \n\t\t\t\tWHERE `fk_point` = \".mysql_real_escape_string($id).\" \n\t\t\t\t\tAND `datetime` IS NOT NULL\n\n\n\t\t\tUNION ALL\n\t\t\t\t\n\t\t\t\tSELECT `id`,`ip`,`datetime`,`fk_user`,\n\t\t\t\t\t `comment` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t 'comment' AS `log_type`\n\t\t\t\tFROM `t_comments` \n\t\t\t\tWHERE `fk_place` = \".mysql_real_escape_string($id).\" AND `hidden` IS NULL \n\t\t\t\t\tAND `datetime` IS NOT NULL\n\n\n\t\t\tUNION ALL\n\n\t\t\t\tSELECT \n\t\t\t\t\t`id` AS `id`, \n\t\t\t\t\t'' AS `ip`, \n\t\t\t\t\t`datetime`, \n\t\t\t\t\t`user` AS `fk_user`,\n\t\t\t\t\t`locality` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t'place' AS `log_type`\n\t\t\t\tFROM `t_points` \n\t\t\t\tWHERE `id` = \".mysql_real_escape_string($id).\"\n\t\t\t\t\n\t\t) \n\t\tAS `log`\n\t\tORDER BY `datetime` DESC\";\n\t\n\t}\n\t// Get everything what's happening on the site\n\telse {\n\t\t$query = \"SELECT * FROM \n\t\t(\n\t\t\n\t\t\t\tSELECT `id`,`ip`,`datetime`,`fk_user`,`fk_point`,\n\t\t\t\t\t `description` AS `log_entry`,\n\t\t\t\t\t `language` AS `log_meta`,\n\t\t\t\t\t 'description' AS `log_type`\n\t\t\t\tFROM `t_points_descriptions` \n\t\t\t\tWHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= datetime \n\t\t\t\t\tAND `datetime` IS NOT NULL\n\n\n\t\t\tUNION ALL\n\n\n\t\t\t\tSELECT `id`,`ip`,`datetime`,`fk_user`,`fk_point`,\n\t\t\t\t\t `rating` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t 'rating' AS `log_type`\n\t\t\t\tFROM `t_ratings` \n\t\t\t\tWHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= datetime \n\t\t\t\t\tAND `datetime` IS NOT NULL\n\n\n\t\t\tUNION ALL\n\n\n\t\t\t\tSELECT `id`,`ip`,`datetime`,`fk_user`,`fk_point`,\n\t\t\t\t\t `waitingtime` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t 'waitingtime' AS `log_type`\n\t\t\t\tFROM `t_waitingtimes` \n\t\t\t\tWHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= datetime \n\t\t\t\t\tAND `datetime` IS NOT NULL\n\n\n\t\t\tUNION ALL\n\n\n\t\t\t\tSELECT `id`,`ip`,`datetime`,`fk_user`,`fk_place` AS `fk_point`,\n\t\t\t\t\t `comment` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t 'comment' AS `log_type`\n\t\t\t\tFROM `t_comments` \n\t\t\t\tWHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= datetime \n\t\t\t\t\tAND `datetime` IS NOT NULL\n\t\t\t\t\tAND `hidden` IS NULL\n\n\n\t\t\tUNION ALL\n\n\n\t\t\t\tSELECT \n\t\t\t\t\t`id`, \n\t\t\t\t\t'' AS `ip`, \n\t\t\t\t\t`datetime`, \n\t\t\t\t\t`user_id` AS `fk_user`,\n\t\t\t\t\t'' AS `fk_point`, \n\t\t\t\t\t`country` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t'public_transport' AS `log_type`\n\t\t\t\tFROM `t_ptransport` \n\t\t\t\tWHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= datetime \n\t\t\t\t\tAND `datetime` IS NOT NULL\n\n\n\t\t\tUNION ALL\n\n\n\t\t\t\tSELECT \n\t\t\t\t\t`id`, \n\t\t\t\t\t'' AS `ip`, \n\t\t\t\t\t`registered` AS `datetime`, \n\t\t\t\t\t`id` AS `fk_user`,\n\t\t\t\t\t'' AS `fk_point`, \n\t\t\t\t\t`country` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t'user' AS `log_type`\n\t\t\t\tFROM `t_users` \n\t\t\t\tWHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= registered \n\t\t\t\t\tAND `registered` IS NOT NULL\n\n\n\t\t\tUNION ALL\n\n\n\t\t\t\tSELECT \n\t\t\t\t\t`id`, \n\t\t\t\t\t`id` AS `fk_point`, \n\t\t\t\t\t'' AS `ip`, \n\t\t\t\t\t`datetime`, \n\t\t\t\t\t`user` AS `fk_user`,\n\t\t\t\t\t`locality` AS `log_entry`,\n\t\t\t\t\t '' AS `log_meta`,\n\t\t\t\t\t'place' AS `log_type`\n\t\t\t\tFROM `t_points` \n\t\t\t\tWHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= datetime \n\t\t\t\t\tAND `datetime` IS NOT NULL\n\t\t\t\t\n\t\t)\n\t\tAS `log`\n\t\tORDER BY `datetime` DESC\";\n\t}\n\t\n\tstart_sql();\n\t$res = mysql_query($query);\n\t\n\tif(!$res) return false;\n\t\n\t#if(mysql_num_rows($res) > 0) {\n\t\twhile($line = mysql_fetch_array($res, MYSQL_ASSOC)) {\n\t\t\t$log[] = $line;\n\t\t}\n\t#}\n\n\tif(!empty($log)) return $log;\n\telse return false;\n}",
"protected function getTypeString($type)\n {\n switch ($type) {\n case Logger::EMERGENCY:\n case Logger::EMERGENCE:\n case Logger::CRITICAL:\n // emergence, critical\n return 'critical';\n case Logger::ALERT:\n case Logger::ERROR:\n // error, alert\n return 'error';\n case Logger::WARNING:\n // warning\n return 'warning';\n case Logger::NOTICE:\n case Logger::INFO:\n // info, notice\n return 'info';\n case Logger::DEBUG:\n case Logger::CUSTOM:\n case Logger::SPECIAL:\n default:\n // debug, log, custom, special\n return 'debug';\n }\n }",
"public function getInfoMessage($type)\n {\n if (!array_key_exists($type, $this->infoLogs)) {\n return $type;\n }\n return $this->infoLogs[$type];\n }",
"public function userLoginLog($tipo)\n {\n switch ($tipo) {\n case 'login_success':\n $this->addLog('Inicio de session correcto');\n break;\n case 'login_fail':\n $this->addLog('Error de inicio de session');\n break;\n }\n\n }",
"function format_log_line($type, $name) {\n\tglobal $uniqueId, $remoteAddr;\n\t\n\treturn date(\"c\") . \",${remoteAddr},${uniqueId},${type},${name}\\n\";\n}",
"function getReportAttributes(string $type) {\n $reports = [\n [\n 'type' => 'ip',\n 'command' => \"awk '{print $1}' ../logs/nginx-access.log* | sort | uniq -c | sort -nr | head -n 25\",\n 'header' => ['', 'IP Address', 'Visits', 'Who is this?']\n ],\n [\n 'type' => 'ua',\n 'command' => 'cat ../logs/nginx-access.log* | awk -F\\\" \\'{ print $6 }\\' | sort | uniq -c | sort -frn | head -n 25',\n 'header' => ['User Agent', 'Visits', 'Type']\n ]\n ];\n $key = array_search($type, array_column($reports, 'type'));\n return $reports[$key];\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that passing in a DateTime object in timezone UTC will be converted to the correct time in the given timezone. | public function testLocalizeCorrectly( DateTime $dateTimeUTC, DateTimeZone $timezone, $expected ){
$this->assertEquals($expected, TimeConversion::localize($dateTimeUTC, $timezone)->format('c'));
} | [
"public function testFromDateTimeZoneUTC() {\n\t\t$date = new \\DateTime('utc');\n\t\t$zone = $date->getTimezone();\n\t\t$timeZone = TimeZone::fromDateTimeZone($zone);\n\t\t$this->assertEquals('UTC', strval($timeZone));\n\t}",
"public function testParseUTC() {\n\t\t$this->assertEquals('UTC', strval(TimeZone::parse('utc')));\n\t\t$this->assertTrue(TimeZone::parse('utc') === TimeZone::parse('UTC'));\n\t}",
"function convert_timezone($dateTime, $inputTz, $outputTz)\n {\n return carbon()->parse($dateTime, $inputTz)->setTimezone($outputTz);\n }",
"public function testGetUTC() : void\n {\n $this->assertEquals( $this->utc->format( self::DATE_FORMAT ), $this->instance->getUTC()->format( self::DATE_FORMAT ));\n }",
"function dateTimeToUTC($dateTime)\n {\n return dateTimeToOtherTimezone($dateTime, 'UTC');\n }",
"public function phpDateTimeZoneConversionsCorrect(){\n $dto = new DateTime($this->queryResult(), new DateTimeZone('America/New_York'));\n $dto->setTimezone(new DateTimeZone('America/Denver'));\n if( $dto->format('Y-m-d H:i:s') !== '2001-01-17 05:00:00' ){\n return false;\n }\n return true;\n }",
"function date_timezone_set (DateTime $object, DateTimeZone $timezone) {}",
"public function testToLocalTimeGivenDateAsString()\n {\n $config = m::mock('\\Illuminate\\Config\\Repository')->makePartial();\n $auth = m::mock('\\Illuminate\\Auth\\AuthManager')->makePartial();\n $memory = m::mock('\\Orchestra\\Memory\\Provider');\n\n $config->shouldReceive('get')->once()->with('app.timezone', 'UTC')->andReturn('UTC');\n $auth->shouldReceive('guest')->once()->andReturn(true);\n\n $stub = with(new Site($auth, $config, $memory))->toLocalTime('2012-01-01 00:00:00');\n\n $this->assertEquals(new \\DateTimeZone('UTC'), $stub->getTimezone());\n }",
"public function inUtcTimezone()\n {\n return parent::setTimezone(timezone_open('UTC'));\n }",
"#[@test]\n public function testMoveToTimezone() {\n $copy= clone $this->fixture;\n $tz= new TimeZone('Australia/Sydney');\n \n $this->assertEquals($this->fixture, DateUtil::moveToTimeZone($copy, $tz));\n }",
"function datetime_in_timezone($datetime_str, $str_includes_time_zone=false, $timezone=false){\n if($str_includes_time_zone){\n if($timezone===false){\n return new DateTime($datetime_str);\n }else{\n $userTimezone = new DateTimeZone(!empty($timezone) ? $timezone : $this->default_time_zone);\n $datetime_in_timezone = new DateTime($datetime_str);\n $datetime_in_timezone->setTimeZone($userTimezone);\n }\n }else{\n $defaultTimezone = new DateTimeZone($this->default_time_zone);\n $userTimezone = new DateTimeZone(!empty($timezone) ? $timezone : $this->default_time_zone);\n $datetime_in_timezone = new DateTime($datetime_str, !empty($timezone) ? $userTimezone : $defaultTimezone);\n return $datetime_in_timezone;\n }\n }",
"public function convertFromUserTimezonetoUTC($datetime,$user) {\n\n //$user_tz = 'America/New_York';\n $user_tz = $user->getPreferences()->getTimezone();\n\n //echo \"input datetime=\".$datetime->format('Y-m-d H:i').\"<br>\";\n $datetimeTz = new \\DateTime($datetime->format('Y-m-d'), new \\DateTimeZone($user_tz) );\n $datetimeUTC = $datetimeTz->setTimeZone(new \\DateTimeZone('UTC'));\n //echo \"output datetime=\".$datetimeUTC->format('Y-m-d H:i').\"<br>\";\n\n return $datetimeUTC;\n }",
"public function testConvertingToSqlTimestampWithTimeZone()\n {\n $timestamp = new DateTime('now');\n $this->assertEquals($timestamp->format($this->provider->getTimestampWithTimeZoneFormat()),\n $this->typeMapperWithNoProvider->toSqlTimestampWithTimeZone($timestamp, $this->provider));\n $this->assertEquals($timestamp->format($this->provider->getTimestampWithTimeZoneFormat()),\n $this->typeMapperWithProvider->toSqlTimestampWithTimeZone($timestamp));\n }",
"function convertDateTimeToUTC($pDate) {\n if (gettype($pDate) == \"string\") {\n $dt = new DateTime($pDate); \n } else {\n $dt = clone $pDate;\n }\n $dt->setTimezone(new DateTimeZone('UTC')); \n \n return $dt;\n}",
"public function testPtDayStartToUtcTime() : void\n {\n // Outside DST\n $date = ptDayStartToUtcTime('2019-01-10');\n\n // Within DST\n $daylightDate = ptDayStartToUtcTime('2019-04-02');\n\n $expected = Date::parse('2019-01-10 8:00:00');\n $expectedDaylight = Date::parse('2019-04-02 07:00:00');\n\n $this->assertEquals($expected, $date);\n $this->assertEquals($expectedDaylight, $daylightDate);\n }",
"public function testFormatToUTC()\n {\n $date = new \\Ilch\\Date();\n $date->setTimestamp(1379521501);\n\n $this->assertEquals('2013-09-18 16:25:01', $date->format('Y-m-d H:i:s'), 'The time was not returned in UTC.');\n }",
"public function testFromDateTimeZoneValid(\\DateTimeZone $zone) {\n\t\tOffsetTimeZone::fromDateTimeZone($zone);\n\t}",
"public function nowInTimeZone(\\DateTimeZone $timezone);",
"public function testMarshalWithTimezone(): void\n {\n date_default_timezone_set('Europe/Vienna');\n $value = DateTime::now();\n $expected = DateTime::now();\n $result = $this->type->marshal($value);\n $this->assertEquals($expected, $result);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Command to download the vegas plugin. | function drush_vegas_plugin() {
$args = func_get_args();
if (!empty($args[0])) {
$path = $args[0];
}
else {
$path = 'libraries';
}
// Create the path if it does not exist.
if (!is_dir($path)) {
drush_op('mkdir', $path);
drush_log(dt('Directory @path was created', array('@path' => $path)), 'notice');
}
// Set the directory to the download location.
$olddir = getcwd();
chdir($path);
// Download the zip archive.
if ($filepath = drush_download_file(VEGAS_DOWNLOAD_URI)) {
$filename = basename($filepath);
$dirname = VEGAS_DOWNLOAD_PREFIX . basename($filepath, '.zip');
// Remove any existing vegas plugin directory.
if (is_dir($dirname) || is_dir('vegas')) {
drush_delete_dir($dirname, TRUE);
drush_delete_dir('vegas', TRUE);
drush_log(dt('A existing vegas plugin was deleted from @path', array('@path' => $path)), 'notice');
}
// Decompress the zip archive.
drush_tarball_extract($filename);
// Change the directory name to "vegas" if needed.
if ($dirname != 'vegas') {
drush_move_dir('vegas-2.4.0', 'vegas', TRUE);
$dirname = 'vegas';
}
}
if (is_dir($dirname)) {
drush_log(dt('vegas plugin has been installed in @path', array('@path' => $path)), 'success');
}
else {
drush_log(dt('Drush was unable to install the vegas plugin to @path', array('@path' => $path)), 'error');
}
// Set working directory back to the previous working directory.
chdir($olddir);
} | [
"function ied_plugin_download()\n{\n if (gps('ied_plugin_download')) {\n $type = gps('type');\n switch ($type) {\n case 'zip':\n case 'txt':\n ied_plugin_save_as_file();\n break;\n case 'php':\n ied_plugin_save_as_php_file();\n break;\n case 'textpack':\n ied_plugin_save_as_textpack();\n break;\n }\n }\n}",
"function download_plugin_version() {\n\n\t\t$filename = $this->get_zip_file_name();\n\n\t\t$url = 'https://downloads.wordpress.org/plugin/';\n\t\t$url .= $filename;\n\t\t//$target = 'C:/apache/htdocs/downloads/plugins/';\n $target = $this->get_target_dir( 'plugins');\n $target .= '/';\n\t\t$target .= $filename;\n\t\t$error = $this->download_url_to_target( $url, $target );\n\t\treturn $error;\n\t}",
"function plugin_download_link() {\n\t\t$this->response['download_link'] = site_url( '/wp-content/shopp-uploads/adsanity.zip' );\n\t}",
"public function downloadBukgetPlugin ($pluginname) {\r\n\t$this->ensureLoggedIn();\r\n\r\n\tif(!$pluginname) {\r\n\t\tthrow new Exception('Invalid arguments');\r\n\t}\r\n\r\n\treturn $this->request(array('req' => 'downloadbukgetplugin' , 'pluginname' => $pluginname));\r\n\t}",
"function download_assets() {\n\t\tif ( $this->is_plugin() ) {\n\t\t\t$this->echo( \"Run:\", \"assets {$this->component}\" );\n\t\t} else {\n\t\t\t$this->echo( \"Run:\", \"screenshot {$this->component}\" );\n\t\t}\n\n\t}",
"function VM_generateVBOXaddonDownloadCMD($version)\n{\nreturn(\"\n#Get the name of the ISO file\nisoFile=`wget http://download.virtualbox.org/virtualbox/$version/ -O - | grep iso | cut -d'\\\"' -f2 | sort -n | tail -1`\n\necho -n \\\"Downloading VirtualBox addition ISO (\\$isoFile) ...\\\" | tee -a \".VBOX_addonDownloaderLog.\"\nwget http://download.virtualbox.org/virtualbox/$version/\\$isoFile -O /m23/tmp/VBoxGuestAdditions.iso\n\nif [ \\$? -eq 0 ]\nthen\n\techo \\\" done\\\" | tee -a \".VBOX_addonDownloaderLog.\"\n\t#Mount the ISO\n\tmkdir -p /m23/tmp/vbox-loop\n\tumount /m23/tmp/vbox-loop 2> /dev/null\n\tmount -o loop /m23/tmp/VBoxGuestAdditions.iso /m23/tmp/vbox-loop\n\n\t#Copy the addons\n\tfor add in `ls /m23/tmp/vbox-loop/VBoxLinuxAdditions-*.run`\n\tdo\n\t\tfn=`basename \\$add | sed \\\"s/.run/-$version.run/g\\\"`\n\t\tcp \\$add \".VBOX_addonStoreDir.\"\\$fn\n\n\t\tif [ \\$? -eq 0 ]\n\t\tthen\n\t\t\techo \\\"\\$fn copied to \".VBOX_addonStoreDir.\"\\\" | tee -a \".VBOX_addonDownloaderLog.\"\n\t\telse\n\t\t\techo \\\"Copying of \\$fn to \".VBOX_addonStoreDir.\" failed\\\" | tee -a \".VBOX_addonDownloaderLog.\"\n\t\tfi\n\tdone\n\n\t#Change the owner\n\tchown www-data.www-data \".VBOX_addonStoreDir.\"VBoxLinuxAdditions-*.run\n\n\t#Unmount the ISO\n\tumount /m23/tmp/vbox-loop\n\n\t#Delete the ISO after download\n\trm /m23/tmp/VBoxGuestAdditions.iso\nelse\n\techo \\\" failed\\\" | tee -a \".VBOX_addonDownloaderLog.\"\nfi\n\");\n}",
"function vye_video_download( $paras = '', $content = '' ) {\r\n\r\n\textract( shortcode_atts( array( 'id' => '' ), $paras ) );\r\n\r\n\t// Get the download code\r\n\r\n\t$link = vye_generate_download_code( $id );\r\n\r\n\t// Now return the HTML\r\n\r\n\treturn do_shortcode( $link );\r\n}",
"public function showPluginsDownload()\n\t{\n\t\t?>\n\t\t<h3 class=\"floated\">Download Plugins</h3>\t\n\t\t<div class=\"edit-nav clearfix\" style=\"\">\n\t\t\t<a href=\"load.php?id=extend-download&extend_type=plugins&download&download_id=10&refresh\">Update Plugin Downloader</a>\n\t\t</div>\n\t\t<div class=\"plugin_padding\" style=\"padding:10px 0px;\">\n\t\t\t<table class=\"highlight\">\n\t\t<?php \t\t\n\t\t$extendData = getXML(GSDATAOTHERPATH.'extend-download.xml');\n\t\tglobal $plugin_info;\n\t\tforeach ($extendData->plugins->plugin as $extendItem)\n\t\t{\t\n\t\t\t$plugin_installed = 'No';\n\t\t\t$plugin_version = '';\n\t\t\t$download_confirmation = '<a href=\"load.php?id=extend-download&extend_type=plugins&download&download_id='.$extendItem->id.'\">Download</a>';\n\t\t\tif($this->pluginInstalledCheck($extendItem->filename_id) == true)\n\t\t\t{\n\t\t\t\t$needsupdate = false;\n\t\t\t\t$fi = $extendItem->filename_id;\n\t\t\t\t$pathName = pathinfo_filename($fi);\n\t\t\t\t$plugin_installed = 'Yes';\n\t\t\t\t$plugin_version = '<span class=\"extend_spec_label\">Current Installed Plugin Version: </span>'.$plugin_info[$pathName]['version'];\n\t\t\t\t$download_confirmation = '<a href=\"#\" onclick=\"decision(\\'Are You Sure You Want To Update '.$extendItem->name.'?\\',\\'load.php?id=extend-download&extend_type=plugins&download&download_id='.$extendItem->id.'\\')\">Update</a>';\n\t\t\t}\n\t\t\t?>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<h3 style=\"margin-bottom:10px;\"><?php echo $extendItem->name; ?> <?php echo $download_confirmation; ?></h3>\n\t\t\t\t\t<div class=\"extend_specs_left\">\n\t\t\t\t\t\t<span class=\"extend_spec_label\">Version: </span><?php echo $extendItem->version; ?><br/>\n\t\t\t\t\t\t<span class=\"extend_spec_label\">Updated Date: </span><?php echo $extendItem->updated_date; ?><br/>\n\t\t\t\t\t\t<span class=\"extend_spec_label\"><a href=\"<?php echo $extendItem->support_url; ?>\" target=\"_blank\">Support URL</span><br/>\n\t\t\t\t\t\t<span class=\"extend_spec_label\"><a href=\"<?php echo $extendItem->author_url; ?>\" target=\"_blank\">Author URL</a></span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"extend_specs_right\">\n\t\t\t\t\t\t<span class=\"extend_spec_label\">Tested Earliest: </span><?php echo $extendItem->tested_earliest; ?><br/>\n\t\t\t\t\t\t<span class=\"extend_spec_label\">Tested Latest: </span><?php echo $extendItem->tested_latest; ?><br/>\n\t\t\t\t\t\t<span class=\"extend_spec_label\">Is this plugin installed?: </span> <?php echo $plugin_installed; ?><br/>\n\t\t\t\t\t\t<?php echo $plugin_version; ?>\n\t\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t\t\t<div style=\"width:620px;\">\n\t\t\t\t\t\t<?php echo Markdown(stripslashes(html_entity_decode($extendItem->description))); ?>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t\t<?php } ?>\n\t\t\t</table>\n\t\t</div>\n\t\t<?php\n\t}",
"function core() {\n\t\t$core = json_decode( file_get_contents( \"php://stdin\" ) );\n\n\t\t$cmd = Utils\\esc_cmd( \"core download --version=%s --path=%s --force\", $core->version, $core->path );\n\n\t\tWP_CLI::runcommand( $cmd );\n\t}",
"public function downloadInstall(){\n\t\t\n\t\t// Set the state and tell plugins.\n\t\t$this->setState('DOWNLOADING_PLUGIN');\n\t\t$this->notifyObservers();\n\t\t\n\t\t//Get plugin name\n\t\t$plugin = $this->getActiveRequest();\n\t\t\n\t\t//Should never occur.\n\t\tif(empty($plugin)){\n\t\t\texit(\"Plugin Undefined.\");\t\n\t\t}\n\t\t\n\t\t//Get remote files collector\n\t\tinclude_once(\"core/lib/RemoteFiles.php\");\n\t\t\n\t\t//Create new remote file connector.\n\t\t$rf = new RemoteFiles();\n\t\t\n\t\t//Save this zip\n\t\t$rf->downloadRemoteFile(\"http://cdn.modules.lotuscms.org/lcms-3-series/zips/\".$plugin.\".zip\", \"data\", $plugin.\".zip\");\n\t\t\n\t\tinclude_once('core/lib/pclzip.lib.php');\n\t\t\t\n\t\t//Setup Archive\n\t\t$archive = new PclZip(\"data/\".$plugin.\".zip\");\n\t\t\n\t\t//Destroy existing plugin files if they exist.\n\t\t$this->destroyDir(\"modules/\".$plugin, true);\n\t\t\t\n\t\t//Extract Archive\n\t\t$list = $archive->extract(PCLZIP_OPT_PATH, \"modules\");\n\t\t\t\n\t\tif ($archive->extract() == 0) {\n\t\t\t\n\t\t\t// Set the state and tell plugins.\n\t\t\t$this->setState('DOWNLOADING_PLUGIN_FAILED');\n\t\t\t$this->notifyObservers();\n\t\t\t\n\t\t\tunlink(\"data/\".$plugin.\".zip\");\n\t\t\t\n\t\t\t//Display Error Message\n\t\t\texit(\"<p><strong>Error</strong> : \".$archive->errorInfo(true).\"</p><p>It may help to chmod (change write permissions) the 'modules' cms directory to 777.</p>\");\n\t\t}else{\n\t\t\t// Set the state and tell plugins.\n\t\t\t$this->setState('DOWNLOADING_PLUGIN_SUCCESS');\n\t\t\t$this->notifyObservers();\n\t\t\t\n\t\t\t//If the original plugin folder is also there remove it\n\t\t\tif(is_dir($plugin)){\n\t\t\t\t\n\t\t\t\t//Destroys the secondary folder before copy.\n\t\t\t\t$this->destroyDir($plugin, true);\t\n\t\t\t\t\n\t\t\t\t//Destroys the secondary folder before copy.\n\t\t\t\t$this->destroyDir(\"__MACOSX\", true);\n\t\t\t}\n\t\t\t\n\t\t\t//Delete the temporary plugin zip file.\n\t\t\tunlink(\"data/\".$plugin.\".zip\");\n\t\t\t\n\t\t\treturn $plugin;\n\t\t}\n\t}",
"function VM_VBOXaddonDownloadDialog()\n{\n\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n\tHTML_showTableHeader(true);\n\n\t//Get the contents of the logfile\n\tif (file_exists(VBOX_addonDownloaderLog))\n\t\t$log = SERVER_getFileContents(VBOX_addonDownloaderLog);\n\telse\n\t\t$log = \"\";\n\n\tHTML_submit(\"BUT_refresh\",$I18N_refresh);\n\t\n\t$downloadedVBoxAddons = VM_downloadedVBoxAddons();\n\t$newDefaultVersion = HTML_selection(\"SEL_defaultVersion\", $downloadedVBoxAddons, SELTYPE_selection, true, VM_getVBoxAddonDefaultVersion());\n\n\tif (HTML_submit(\"BUT_setVBoxAddonDefaultVersion\",$I18N_setAsDefaultVersion))\n\t\tVM_setVBoxAddonAsDefault($newDefaultVersion);\n\n\techo(\"\n\t<tr>\n\t\t<td>\n\t\t\t<span class=\\\"title\\\">$I18N_downloadableVBoxAddons</span><br>\");\n\n\t\t\tforeach(VM_listDownloadableVBoxAddons() as $version)\n\t\t\t\t$VBVersionArray[$version] = $version . (VM_wasVBoxAddonDownloaded($version) ? \" ($I18N_alreadyDownloaded)\" : \"\");\n\n\t\t\t$checkedVersions = HTML_multiCheckBoxShow($VBVersionArray);\n\n\t\t\tif (HTML_submit(\"BUT_download\",$I18N_download))\n\t\t\t{\n\t\t\t\tVM_downloadVBOXaddons($checkedVersions);\n\t\t\t\tMSG_showInfo($I18N_downloadStarted);\n\t\t\t}\n\n\t\t\techo(\"<br><center>\".BUT_download.\"</center>\n\t\t</td>\n\t\t<td width=\\\"16\\\"></td>\n\t\t<td valign=\\\"top\\\">\n\t\t\t<span class=\\\"title\\\">$I18N_downloadStatus</span><br><br>\n\t\t\t<textarea name=\\\"TA_log\\\" cols=\\\"80\\\" rows=\\\"15\\\" readonly>$log</textarea><br>\n\t\t\t\".BUT_refresh.\"<br><br>\n\t\t\t<span class=\\\"title\\\">$I18N_chooseDefaultVersion</span><br><br>\n\t\t\t\".SEL_defaultVersion.\" \".BUT_setVBoxAddonDefaultVersion.\"<br><br>\n\t\t\t» <a href=\\\"index.php?page=packageBuilder\\\">$I18N_deleteVBoxAddons</a>\n\t\t</td>\n\t</tr>\");\n\n\tHTML_showTableEnd(true);\n}",
"public function download() {\t\t}",
"function download_from_vimeo($out_file, $url) {\n $cmd=\"/usr/bin/curl -L -o $out_file -A 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36' '$url'\";\n p('Executing command ' . $cmd);\n passthru($cmd);\n if (file_exists($out_file)) return true;\n else return false;\n}",
"private function dropbox_download() {\n switch($this -> dropbox_search()) {\n case 1:\n $this -> dropbox_download_exec();\n break;\n case 0:\n $this -> stdRet(\"failure\", \"File does not exist.\", \"\");\n break;\n case -1:\n $this -> stdRet(\"failure\", \"Searching file fails.\", \"\");\n break;\n }\n }",
"function file_download() {\n if (!$this->active_file) {\n $this->httpError(HTTP_BAD_REQUEST);\n } // if\n \n if(!$this->active_repository->canView($this->logged_user)) {\n $this->httpError(HTTP_ERR_FORBIDDEN);\n } // if\n \n $file_source = implode(\"\\n\", $this->repository_engine->cat($this->active_revision, $this->active_file, $this->request->get('peg')));\n download_contents($file_source, 'application/octet-stream', $this->active_file_basename, true);\n }",
"function drush_edit_aloha_download() {\n $target_dir = 'alohaeditor';\n if (!drush_shell_exec('type unzip')) {\n return drush_set_error(dt('Missing dependency: unzip. Install it before using this command.'));\n }\n\n $args = func_get_args();\n if (!empty($args[0])) {\n $path = $args[0];\n }\n else {\n $path = 'sites/all/libraries';\n }\n\n // Create the path if it does not exist.\n if (!is_dir($path)) {\n drush_op('mkdir', $path);\n drush_log(dt('Directory @path was created.', array('@path' => $path)), 'notice');\n }\n\n // Set the directory to the download location.\n $olddir = getcwd();\n chdir($path);\n\n $filename = basename(EDIT_ALOHA_DOWNLOAD_URI);\n $dirname = basename(EDIT_ALOHA_DOWNLOAD_URI, '.zip');\n\n // Remove any existing aloha plugin directory\n if (is_dir($dirname)) {\n drush_log(dt('An existing Aloha Editor was overwritten at @path.', array('@path' => $path)), 'notice');\n }\n // Remove any existing aloha plugin zip archive\n if (is_file($filename)) {\n drush_op('unlink', $filename);\n }\n\n // Download the zip archive\n if (!drush_shell_exec('wget ' . EDIT_ALOHA_DOWNLOAD_URI)) {\n drush_shell_exec('curl -O ' . EDIT_ALOHA_DOWNLOAD_URI);\n }\n\n if (is_file($filename)) {\n // Decompress the zip archive\n drush_shell_exec('unzip -qq -o ' . $filename . ' -d ' . $target_dir);\n\n // Remove the zip archive\n drush_op('unlink', $filename);\n }\n\n // Set working directory back to the previous working directory.\n chdir($olddir);\n if (is_dir($path . '/' . $target_directory)) {\n drush_log(dt('Aloha Editor has been downloaded to @path.', array('@path' => $path)), 'success');\n }\n else {\n drush_log(dt('Drush was unable to download Aloha Editor to @path.', array('@path' => $path)), 'error');\n }\n}",
"function download() {\necho $this->getvcard();\nreturn true;\n}",
"function getUrlToDownloadFile() {\r\n\t\treturn \"http://www.elitetorrent.net/get-torrent/\";\r\n\t}",
"function matt_download_plugin($plugin) {\n\n $request = new StdClass();\n \n $request->slug = stripslashes($plugin);\n $post_data = array(\n 'action' => 'plugin_information', \n 'request' => serialize($request)\n );\n $options = array(\n CURLOPT_URL => 'http://api.wordpress.org/plugins/info/1.0/',\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => $post_data,\n CURLOPT_RETURNTRANSFER => true\n );\n $handle = curl_init();\n curl_setopt_array($handle, $options);\n $response = curl_exec($handle);\n curl_close($handle);\n $plugin_info = unserialize($response);\n echo \"Downloading and Extracting $plugin_info->name<br />\"; \n $file = basename($plugin_info->download_link);\n $fp = fopen($file,'w');\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_USERAGENT, 'WPKGR');\n curl_setopt($ch, CURLOPT_URL, $plugin_info->download_link);\n curl_setopt($ch, CURLOPT_FAILONERROR, TRUE);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);\n curl_setopt($ch, CURLOPT_BINARYTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_TIMEOUT, 120);\n curl_setopt($ch, CURLOPT_FILE, $fp);\n $b = curl_exec($ch);\n \n if (!$b) {\n $message = 'Download error: '. curl_error($ch) .', please try again';\n curl_close($ch);\n throw new Exception($message);\n }\n \n fclose($fp);\n \n if (!file_exists($file)) throw new Exception('Zip file not downloaded');\n \n if (class_exists('ZipArchive')) {\n $zip = new ZipArchive;\n \n if($zip->open($file) !== TRUE) throw new Exception('Unable to open Zip file');\n \n $zip->extractTo(ABSPATH . 'wp-content/plugins/');\n \n $zip->close();\n }\n else {\n // try unix shell command\n @shell_exec('unzip -d ../wp-content/plugins/ '. $file);\n }\n unlink($file);\n echo \"<strong>Done!</strong><br />\";\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the mapping between the selected filter type and the criteria comparison. | abstract protected function getCriteriaMap(); | [
"private function getFilterFieldsMap()\n {\n return [\n 'fields' => [\n 'email' => 'main_table.email',\n 'status' => 'company_customer.status',\n 'customer_type' => $this->prepareCustomerTypeColumnExpression()\n ]\n ];\n }",
"protected function _getSubfilterMap()\n {\n return ['order' => 'sales_order.status', 'date' => 'sales_order.created_at'];\n }",
"protected function _getSubfilterMap()\n {\n switch ($this->getValue()) {\n case self::WISHLIST:\n $dateField = 'item.added_at';\n break;\n\n default:\n $dateField = 'item.created_at';\n break;\n }\n\n return ['product' => 'item.product_id', 'date' => $dateField];\n }",
"public function getFilterTypes();",
"protected function _getSubfilterMap()\n {\n return array(\n 'product' => 'item.product_id'\n );\n }",
"public static function getDateFilterTypes()\n\t{\n\t\t$dateFilters = Condition::DATE_OPERATORS;\n\t\tforeach (array_keys($dateFilters) as $filterType) {\n\t\t\t$dateValues = \\DateTimeRange::getDateRangeByType($filterType);\n\t\t\t$dateFilters[$filterType]['startdate'] = $dateValues[0];\n\t\t\t$dateFilters[$filterType]['enddate'] = $dateValues[1];\n\t\t}\n\t\treturn $dateFilters;\n\t}",
"public static function retrieveFilterOperators() {\n\t\treturn array(\n\t\t\t\tself::FILTER_OPERATOR_IS => array(\n\t\t\t\t\t\t'name' => 'Is',\n\t\t\t\t\t\t'type' => '1'\n\t\t\t\t),\n\t\t\t\tself::FILTER_OPERATOR_IS_NOT => array(\n\t\t\t\t\t\t'name' => 'Is Not',\n\t\t\t\t\t\t'type' => '1'\n\t\t\t\t),\n\t\t\t\tself::FILTER_OPERATOR_IN => array(\n\t\t\t\t\t\t'name' => 'In',\n\t\t\t\t\t\t'type' => 'm'\n\t\t\t\t),\n\t\t\t\tself::FILTER_OPERATOR_NOT_IN => array(\n\t\t\t\t\t\t'name' => 'Not In',\n\t\t\t\t\t\t'type' => 'm'\n\t\t\t\t),\n\t\t\t\tself::FILTER_OPERATOR_STARTS_WITH => array(\n\t\t\t\t\t\t'name' => 'Starts With',\n\t\t\t\t\t\t'type' => '1'\n\t\t\t\t),\n\t\t\t\tself::FILTER_OPERATOR_ENDS_WITH => array(\n\t\t\t\t\t\t'name' => 'Ends With',\n\t\t\t\t\t\t'type' => '1'\n\t\t\t\t),\n\t\t\t\tself::FILTER_OPERATOR_CONTAINS => array(\n\t\t\t\t\t\t'name' => 'Contains',\n\t\t\t\t\t\t'type' => '1'\n\t\t\t\t),\n\t\t\t\tself::FILTER_OPERATOR_GREATER_THAN => array(\n\t\t\t\t\t\t'name' => '>',\n\t\t\t\t\t\t'type' => '1'\n\t\t\t\t),\n\t\t\t\tself::FILTER_OPERATOR_GREATER_THAN_OR_EQUAL => array(\n\t\t\t\t\t\t'name' => '>=',\n\t\t\t\t\t\t'type' => '1'\n\t\t\t\t),\n\t\t\t\tself::FILTER_OPERATOR_LESS_THAN => array(\n\t\t\t\t\t\t'name' => '<',\n\t\t\t\t\t\t'type' => '1'\n\t\t\t\t),\n\t\t\t\tself::FILTER_OPERATOR_LESS_THAN_OR_EQUAL => array(\n\t\t\t\t\t\t'name' => '<=',\n\t\t\t\t\t\t'type' => '1'\n\t\t\t\t),\n\t\t\t\tself::FILTER_OPERATOR_BETWEEN => array(\n\t\t\t\t\t\t'name' => 'Between',\n\t\t\t\t\t\t'type' => '2'\n\t\t\t\t),\n\t\t\t\tself::FILTER_OPERATOR_EXISTS => array(\n\t\t\t\t\t\t'name' => 'Exists',\n\t\t\t\t\t\t'type' => '0'\n\t\t\t\t),\n\t\t\t\tself::FILTER_OPERATOR_NOT_EXISTS => array(\n\t\t\t\t\t\t'name' => 'Does Not Exist',\n\t\t\t\t\t\t'type' => '0'\n\t\t\t\t)\n\t\t);\n\t}",
"public function getFilterType();",
"public static function getGenericFiltersInformation()\n\t{\n\t\t$genericFilters = array(\n\n\t\t\t'Pattern' => array(\n\t\t\t\t\t\t\t\t'filter_column' \t\t\t=> array('string'),\n\t\t\t\t\t\t\t\t'filter_pattern' \t\t\t=> array('string'),\n\t\t\t\t\t\t),\n\t\t\t'PatternRecursive' => array(\n\t\t\t\t\t\t\t\t'filter_column_recursive' \t=> array('string'),\n\t\t\t\t\t\t\t\t'filter_pattern_recursive' \t=> array('string'),\n\t\t\t\t\t\t),\n\t\t\t'ExcludeLowPopulation'\t=> array(\n\t\t\t\t\t\t\t\t'filter_excludelowpop' \t\t=> array('string'),\n\t\t\t\t\t\t\t\t'filter_excludelowpop_value'=> array('float'),\n\t\t\t\t\t\t),\n\t\t\t'Sort' => array(\n\t\t\t\t\t\t\t\t'filter_sort_column' \t\t=> array('string', Piwik_Archive::INDEX_NB_VISITS),\n\t\t\t\t\t\t\t\t'filter_sort_order' \t\t=> array('string', Zend_Registry::get('config')->General->dataTable_default_sort_order),\n\t\t\t\t\t\t),\n\t\t\t'Limit' => array(\n\t\t\t\t\t\t\t\t'filter_offset' \t\t\t=> array('integer', '0'),\n\t\t\t\t\t\t\t\t'filter_limit' \t\t\t\t=> array('integer', Zend_Registry::get('config')->General->dataTable_default_limit),\n\t\t\t\t\t\t),\n\t\t\t'ExactMatch' => array(\n\t\t\t\t\t\t\t\t'filter_exact_column'\t\t=> array('string'),\n\t\t\t\t\t\t\t\t'filter_exact_pattern'\t\t=> array('array'),\n\t\t\t\t\t\t),\n\t\t);\n\n\t\treturn $genericFilters;\n\t}",
"private function getFiltersFromConditions()\n\t{\n\t\t$filters = array();\n\t\t$conditions = $this->getConditions();\n foreach ($conditions as $cond)\n {\n \tif ($cond['blogic'] == 'and' && $cond['operator'] == 'id_equal')\n \t{\n \t\t$filters[$cond['field']] = $cond['condValue'];\n \t}\n }\n return $filters;\n\t}",
"public static function getGenericFiltersInformation()\n {\n return array(\n array('Pattern',\n array(\n 'filter_column' => array('string', 'label'),\n 'filter_pattern' => array('string')\n )),\n array('PatternRecursive',\n array(\n 'filter_column_recursive' => array('string', 'label'),\n 'filter_pattern_recursive' => array('string'),\n )),\n array('ExcludeLowPopulation',\n array(\n 'filter_excludelowpop' => array('string'),\n 'filter_excludelowpop_value' => array('float', '0'),\n )),\n array('Sort',\n array(\n 'filter_sort_column' => array('string'),\n 'filter_sort_order' => array('string', 'desc'),\n $naturalSort = true,\n $recursiveSort = true,\n $doSortBySecondaryColumn = true\n )),\n array('Truncate',\n array(\n 'filter_truncate' => array('integer'),\n )),\n array('Limit',\n array(\n 'filter_offset' => array('integer', '0'),\n 'filter_limit' => array('integer'),\n 'keep_summary_row' => array('integer', '0'),\n ))\n );\n }",
"protected function getFieldMap()\n {\n return array(\n QueryBuilder::FILTER => array(\n QueryBuilder::PROP_GROUP => $this->getFilterGroups(),\n QueryBuilder::PROP_CHECK_EMPTY => true,\n ),\n );\n }",
"public function defineCriteriaAttributes()\n {\n return array(\n 'metaType' => array(AttributeType::Enum, 'values' => \"default,template\", 'default' => '*'),\n );\n }",
"public function getFilterOptions()\n {\n return $this->getOptions()\n ->joinWith(['lang','taxGroup'])\n ->where(['is_filter' => true]);\n }",
"public static function getFiltersOptions()\n\t{\n\t\treturn array(0 => array('label' => __('Grayscale'), 'value' => 'grayscale'), 1 => array('label' => __('Sepia'), 'value' => 'sepia'), 2 => array('label' => __('Sepia 2'), 'value' => 'sepia2'));\n\n\t}",
"public function getConfigOfFilters();",
"public function getCriteria()\n {\n return array_diff_key($this->map, array('__key' => true));\n }",
"protected function _getFilterByType()\n {\n $type = $this->getFilterType() ? strtolower($this->getFilterType()) : strtolower($this->getType());\n $filterClass = isset($this->_filterTypes[$type]) ? $this->_filterTypes[$type] : $this->_filterTypes['default'];\n\n return $filterClass;\n }",
"public static function getAdvancedFilterOpsByFieldType()\n\t{\n\t\treturn [\n\t\t\t'string' => ['is', 'contains', 'does not contain', 'starts with', 'ends with', 'has changed', 'is empty', 'is not empty'],\n\t\t\t'text' => ['is', 'contains', 'does not contain', 'starts with', 'ends with', 'has changed', 'is empty', 'is not empty'],\n\t\t\t'url' => ['is', 'contains', 'does not contain', 'starts with', 'ends with', 'has changed', 'is empty', 'is not empty'],\n\t\t\t'email' => ['is', 'contains', 'does not contain', 'starts with', 'ends with', 'has changed', 'is empty', 'is not empty'],\n\t\t\t'phone' => ['is', 'contains', 'does not contain', 'starts with', 'ends with', 'has changed', 'is empty', 'is not empty'],\n\t\t\t'integer' => ['equal to', 'less than', 'greater than', 'does not equal', 'less than or equal to', 'greater than or equal to', 'has changed'],\n\t\t\t'double' => ['equal to', 'less than', 'greater than', 'does not equal', 'less than or equal to', 'greater than or equal to', 'has changed'],\n\t\t\t'advPercentage' => ['equal to', 'less than', 'greater than', 'does not equal', 'less than or equal to', 'greater than or equal to', 'has changed'],\n\t\t\t'currency' => ['equal to', 'less than', 'greater than', 'does not equal', 'less than or equal to', 'greater than or equal to', 'has changed', 'is not empty'],\n\t\t\t'picklist' => ['is', 'is not', 'has changed', 'has changed to', 'is empty', 'is not empty', 'is record open', 'is record closed'],\n\t\t\t'multipicklist' => ['is', 'is not', 'has changed', 'has changed to', 'is empty', 'is not empty'],\n\t\t\t'datetime' => ['is', 'is not', 'has changed', 'less than hours before', 'less than hours later', 'more than hours before', 'more than hours later', 'is not empty', 'smallerthannow', 'greaterthannow'],\n\t\t\t'time' => ['is', 'is not', 'has changed', 'is not empty'],\n\t\t\t'date' => ['is', 'is not', 'has changed', 'between', 'before', 'after', 'is today', 'less than days ago', 'more than days ago', 'in less than', 'in more than',\n\t\t\t\t'days ago', 'days later', 'is not empty', ],\n\t\t\t'boolean' => ['is', 'is not', 'has changed', 'has changed to'],\n\t\t\t'reference' => ['is', 'contains', 'does not contain', 'starts with', 'ends with', 'has changed', 'is empty', 'is not empty'],\n\t\t\t'owner' => ['has changed', 'is', 'is not', 'is Watching Record', 'is Not Watching Record'],\n\t\t\t'sharedOwner' => ['has changed', 'is', 'is not', 'is not empty', 'is empty'],\n\t\t\t'userCreator' => ['is', 'is not', 'is not empty', 'is empty'],\n\t\t\t'recurrence' => ['is', 'is not', 'has changed'],\n\t\t\t'comment' => ['is added'],\n\t\t\t'image' => ['is', 'is not', 'contains', 'does not contain', 'starts with', 'ends with', 'is empty', 'is not empty'],\n\t\t\t'percentage' => ['equal to', 'less than', 'greater than', 'does not equal', 'less than or equal to', 'greater than or equal to', 'has changed', 'is not empty'],\n\t\t\t'multiReferenceValue' => ['contains', 'does not contain', 'has changed', 'is empty', 'is not empty'],\n\t\t\t'tree' => ['is', 'is not', 'has changed', 'has changed to', 'is empty', 'is not empty'],\n\t\t\t'categoryMultipicklist' => ['contains', 'contains hierarchy', 'does not contain', 'does not contain hierarchy', 'is', 'is not', 'has changed', 'has changed to', 'is empty', 'is not empty'],\n\t\t\t'rangeTime' => ['is empty', 'is not empty'],\n\t\t\t'documentsFileUpload' => ['is', 'contains', 'does not contain', 'starts with', 'ends with', 'is empty', 'is not empty', 'has changed'],\n\t\t\t'multiImage' => ['is', 'is not', 'contains', 'does not contain', 'is empty', 'is not empty'],\n\t\t\t'twitter' => ['is', 'contains', 'does not contain', 'starts with', 'ends with', 'has changed', 'is empty', 'is not empty'],\n\t\t\t'multiEmail' => ['contains', 'does not contain', 'starts with', 'ends with', 'is empty', 'is not empty'],\n\t\t\t'serverAccess' => ['is', 'is not', 'has changed'],\n\t\t\t'multiDomain' => ['is', 'contains', 'does not contain', 'starts with', 'ends with', 'has changed', 'is empty', 'is not empty'],\n\t\t\t'currencyInventory' => ['equal to', 'less than', 'greater than', 'does not equal', 'less than or equal to', 'greater than or equal to', 'has changed'],\n\t\t\t'country' => ['is', 'is not', 'is empty', 'is not empty']\n\t\t];\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Switch the old entry IDs imported to new entry IDs for a Dynamic field | private function switch_imported_entry_ids( $ids, &$imported_values ) {
if ( ! is_array( $imported_values ) ) {
return;
}
foreach ( $imported_values as $key => $imported_value ) {
// This entry was just imported, so we have the id
if ( is_numeric( $imported_value ) && isset( $ids[ $imported_value ] ) ) {
$imported_values[ $key ] = $ids[ $imported_value ];
continue;
}
// Look for the entry ID based on the imported value
// TODO: this may not be needed for XML imports. It appears to always be the entry ID that's exported
$where = array( 'field_id' => $this->field->field_options['form_select'], 'meta_value' => $imported_value );
$new_id = FrmDb::get_var( 'frm_item_metas', $where, 'item_id' );
if ( $new_id && is_numeric( $new_id ) ) {
$imported_values[ $key ] = $new_id;
}
}
} | [
"private function change_type_make_new_field_id(){\n if(!$query=$this->uCore->query('uCat',\"SELECT\n `field_id`\n FROM\n `u235_fields`\n WHERE\n `site_id`='\".site_id.\"'\n ORDER BY\n `field_id` DESC\n LIMIT 1\n \")) $this->uFunc->error(322);\n $id=$query->fetch_object();\n if(mysqli_num_rows($query)>0) $field_id=$id->field_id+1;\n else $field_id=1;\n\n //create new column in fields\n if(!$this->uCore->query(\"uCat\",\"ALTER TABLE\n `u235_items`\n ADD\n `field_\".$field_id.\"`\n \".$this->field_sql_type.\" NULL \")) $this->uFunc->error(423);\n\n return $field_id;\n }",
"private static function convert_field_keys_to_ids( &$atts ) {\n\t\t$atts['fields'] = self::convert_keys_to_ids( $atts['fields'], 'field' );\n\t}",
"protected function redefineInteractionFieldsFromIdentifier(): void\n {\n $underscoredIdentifier = $this->identifier ? str_replace('-', '_', $this->identifier) . '_' : '';\n $this->rowsField = $underscoredIdentifier . $this->rowsField;\n $this->searchField = $underscoredIdentifier . $this->searchField;\n $this->sortByField = $underscoredIdentifier . $this->sortByField;\n $this->sortDirField = $underscoredIdentifier . $this->sortDirField;\n }",
"public function reload_fields() {\n $this->fields = field::existing_instances($this->id);\n }",
"function update_bp_ids( $field ){\r\n\t\tglobal $wpdb;\r\n\t\t$table_name = $wpdb->prefix . \"ura_fields\";\r\n\t\t$update_sql = \"UPDATE $table_name SET bp_ID = %s WHERE meta_key = %s\";\r\n\t\t$update = $wpdb->prepare( $update_sql, $field->bp_id, $field->meta_key );\r\n\t\t$results = $wpdb->query( $update );\r\n\t\treturn $results;\r\n\t}",
"function histo_changeID(&$parse,$insert_table,$old_id,$new_id)\n{\n\t$insert_table = str_replace(\"`\",\"\",$insert_table);\n\t\n\tif (($parse['Command'] == \"insert\") and ($parse['TableNames'][0] != $insert_table))\n\t{\n\t\tif (DB_STYLE == 'Datamapper') $field_search = '`'.substr($insert_table,0,-1).'_id`'; //Datamapper style\n\t\telse if (DB_STYLE == 'Gwikid') $field_search = '`id'.$insert_table.'`';\t\t\t\t\t //Gwikid style\n\n\t\t\n\t\tforeach($parse['ColumnNames'] as $id => $name)\n\t\t\t\tif (($name == $field_search) && ($parse['Values'][0][$id]['Value'] == $old_id)) $parse['Values'][0][$id]['Value'] = $new_id;\n\t}\n\t\n\t\n\tif (($parse['Command'] == \"update\") or ($parse['type'] == \"delete\"))\n\t{\n\t\tif (DB_STYLE == 'Datamapper')\n\t\t{\n\t\t\tif ($parse['TableNames'][0] != $insert_table) $field_search = '`'.substr($insert_table,0,-1).'_id`';\t//Datamapper style\n\t\t\telse $field_search = '`id`';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Datamapper style\n\t\t}\n\t\telse if (DB_STYLE == 'Gwikid') $field_search = '`id'.$insert_table.'`';\t\t\t\t\t\t\t\t\t\t//Gwikid style\n\n\t\t\n\t\t\n\t\t//SEARCH IN SETS\n\t\tif ($parse['Command'] == \"update\")\t\t\t\t\t\n\t\t\tforeach($parse['ColumnNames'] as $id => $name)\n\t\t\t\tif (($name == $field_search) && ($parse['Values'][$id]['Value'] == $old_id)) $parse['Values'][$id]['Value'] = $new_id;\n\t\t\t\n\t\t//SEARCH IN WHERE'S\n\t\tif (is_array($parse['Where'])) iterativeDigger($parse['Where'],0,$field_search,$old_id,$new_id);\n\t}\n}",
"public function advanced_demo_import(){\n\t\tadd_action( 'advanced_import_replace_post_ids', array( $this, 'replace_post_ids' ), 20 );\n\t\tadd_action( 'advanced_import_replace_term_ids', array( $this, 'replace_term_ids' ), 20 );\n\t}",
"function post_process_entry( $DG, $item, $field_id, $field, &$data, $update = FALSE ) {\n\t}",
"function hook_search_api_algolia_ids_alter(&$ids, \\AlgoliaSearch\\Index $algolia_index) {\n foreach ($ids as &$id) {\n // Change IDs if needed.\n }\n}",
"private function fixFields()\n\t{\n\t\tforeach ($this->fields as $field => $type) {\n\t\t\tif (!isset($type[1]['name'])) {\n\n\t\t\t\tif ($field == 'id') {\n\t\t\t\t\t$this->fields[$field][1]['name'] = 'ID';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->fields[$field][1]['name'] = ucwords(str_replace('_', ' ', $field));\n\n\t\t\t\t\tif (substr($this->fields[$field][1]['name'], -3) === ' Id') {\n\t\t\t\t\t\t$this->fields[$field][1]['name'] = substr($this->fields[$field][1]['name'], 0, strlen($this->fields[$field][1]['name']) - 3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"abstract public function setImportedIds($key);",
"function setIdsForNextInsert($entityIds) {\n $entityIds = incrementIds($entityIds);\n $entityIds[CPEDE] += 2;\n $entityIds[CPEIN] += 4;\n $entityIds[CPETX] += 4;\n $entityIds[CPEVC] += 23;\n $entityIds[URL] += 4;\n return $entityIds;\n }",
"function duplicate_entry_data($form_change,$current_entry_id ){\n global $wpdb;\n\n $lead_table = GFFormsModel::get_lead_table_name();\n\t$lead_detail_table = GFFormsModel::get_lead_details_table_name();\n\t$lead_meta_table = GFFormsModel::get_lead_meta_table_name();\n \n //pull existing entries information\n $current_lead = $wpdb->get_results($wpdb->prepare(\"SELECT * FROM $lead_table WHERE id=%d\", $current_entry_id));\n $current_fields = $wpdb->get_results($wpdb->prepare(\"SELECT wp_rg_lead_detail.field_number, wp_rg_lead_detail.value, wp_rg_lead_detail_long.value as long_detail FROM $lead_detail_table left outer join wp_rg_lead_detail_long on wp_rg_lead_detail_long.lead_detail_id = wp_rg_lead_detail.id WHERE lead_id=%d\", $current_entry_id)); \n\n // new lead\n $user_id = $current_user && $current_user->ID ? $current_user->ID : 'NULL';\n $user_agent = GFCommon::truncate_url($_SERVER[\"HTTP_USER_AGENT\"], 250);\n $currency = GFCommon::get_currency();\n $source_url = GFCommon::truncate_url(RGFormsModel::get_current_page_url(), 200);\n $wpdb->query($wpdb->prepare(\"INSERT INTO $lead_table(form_id, ip, source_url, date_created, user_agent, currency, created_by) VALUES(%d, %s, %s, utc_timestamp(), %s, %s, {$user_id})\", $form_change, RGFormsModel::get_ip(), $source_url, $user_agent, $currency));\n $lead_id = $wpdb->insert_id;\n echo 'Entry '.$lead_id.' created in Form '.$form_change;\n \n //add a note to the new entry\n $results=mf_add_note( $lead_id, 'Copied Entry ID:'.$current_entry_id.' into form '.$form_change.'. New Entry ID ='.$lead_id);\n \n foreach($current_fields as $row){\n $fieldValue = ($row->field_number != 303? $row->value: 'Proposed'); \n \n $wpdb->query($wpdb->prepare(\"INSERT INTO $lead_detail_table(lead_id, form_id, field_number, value) VALUES(%d, %s, %s, %s)\", \n $lead_id, $form_change, $row->field_number, $fieldValue)); \n \n //if detail long is set, add row for new record\n \n if($row->long_detail != 'NULL'){ \n $lead_detail_id = $wpdb->insert_id;\n \n $wpdb->query($wpdb->prepare(\"INSERT INTO wp_rg_lead_detail_long(lead_detail_id, value) VALUES(%d, %s)\", \n $lead_detail_id, $row->long_detail));\n }\n } \n }",
"public function UpdateIdinTableForPrint()\n\t{\n\t$this->db->query(\"UPDATE `checked_id` SET `array_of_ids`='' WHERE id='1'\");\n\t\n\t}",
"private function resetDynamicFields(): void {\n $this->dynamicFields = new stdClass();\n }",
"protected function attachDynamicFields() {\n # Get Dynamic Entity Fields from Database\n $oMyFieldsDB = CoreEntityModel::$aEntityTables['core-form-fields']->select(['form'=>$this->sSingleForm]);\n if(count($oMyFieldsDB) > 0) {\n foreach($oMyFieldsDB as $oField) {\n $sFieldName = $oField->fieldkey;\n if(!property_exists($this,$sFieldName)) {\n # Assign Value from Object to Data based on type\n switch($oField->type) {\n case 'text':\n case 'textarea':\n case 'code':\n case 'email':\n case 'url':\n case 'featuredimage':\n case 'tel':\n case 'upload':\n $this->$sFieldName = '';\n break;\n case 'select':\n case 'currency':\n case 'hidden':\n case 'number':\n case 'boolselect':\n $this->$sFieldName = 0;\n break;\n case 'date':\n case 'datetime':\n $this->$sFieldName = '0000-00-00 00:00:00';\n break;\n default:\n break;\n }\n }\n }\n }\n }",
"function epl_all_import_post_saved_property_unique_id($id) {\n\n\t$the_post = get_post($id);\n\n\tif( ! in_array( $the_post->post_type, epl_get_core_post_types(), true ) ) {\n\t\treturn;\n\t}\n\n\t$u_id = get_post_meta($id, 'property_unique_id', true);\n\n\tif( ! empty( $u_id ) && ! epl_ends_with( $the_post->post_name, $u_id ) ) {\n\n\t\t$my_post = array(\n\t\t\t'ID' \t=> $id,\n\t\t\t'post_title' \t=> $u_id . ' - ' . $the_post->post_title,\n\t\t\t'post_name' \t=> sanitize_key( $u_id ) . '-' . $the_post->post_name\n\t\t);\n\n\t\twp_update_post( $my_post );\n\t}\n\n}",
"function spgfwpdb_gform_after_update_entry( $form, $entry_id, $original_entry )\n\t\t{\n\t\t\t\n\n\t\t\t$entry = GFAPI::get_entry( $entry_id );\n\n\n\t\t\t/**\n\t\t\t * loop thru and process the feeds\n\t\t\t */\n\n\t\t\t$feeds = GFAPI::get_feeds( NULL, $entry[ 'form_id' ], $this->_slug );\n\t\t\tforeach( (array)$feeds AS $feed )\n\t\t\t\tself::process_feed_update( $feed, $entry, $form );\n\t\t\t\n\t\t\t\t\n\t\t}",
"private function parse_ids() {\n\t\t// Trim empty spaces in ids\n\t\t$ids = trim($_POST['ids']);\n\t\t$id_pattern = array(\n\t\t\t'/ *[\\r\\n]+/',\t\t// Checks for one or more line breaks\n\t\t\t'/(\\w)\\s+(\\w)/',\t// Checks for words separated by one or more spaces\n\t\t\t'/,\\s*/',\t\t\t// Checks for words separated by comma, but with variable spaces\n\t\t\t'/,\\s*,/'\t\t\t// Checks for empty strings (i.e. no words between two commas)\n\t\t\t);\n\t\t$id_replace = array(\n\t\t\t',',\n\t\t\t'$1, $2',\n\t\t\t',',\n\t\t\t',',\n\t\t\t''\n\t\t\t);\n\n\t\t// Remove isoforms for dataset using gene IDs\n\t\tif($_POST['idtype'] == 'geneid') {\n\t\t\t$id_pattern[] = '/\\.\\d+/';\n\t\t\t$id_replace[] = '';\n\t\t}\n\n\t\t// Replace IDs by regex\n\t\t$ids = preg_replace($id_pattern, $id_replace, $ids);\n\n\t\t// Write to internal data\n\t\t$this->_expat['ids'] = array_values(array_unique(array_filter(explode(\",\", $ids))));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reports the progress of a batch. When $total === $progress, the state of the task tracked by this state is regarded to be complete. Should handle the following cases gracefully: $total is 0. $progress is larger than $total. $progress approximates $total so that $finished rounds to 1.0. | public function progress($total, $progress); | [
"private function reportProgressForBatch()\n {\n $synced = $this->numberOfOrders - count($this->ordersToSync);\n $progressStep = $synced * (100 - self::INITIAL_PROGRESS_PERCENT) / $this->numberOfOrders;\n $this->currentProgress = self::INITIAL_PROGRESS_PERCENT + $progressStep;\n $this->reportProgress($this->currentProgress);\n }",
"protected function updateProgress($progress)\n {\n if ($this->bookId)\n {\n $now = microtime(true);\n \n if ($now - $this->lastUpdateTime >= $this->updateInterval)\n {\n $data = array();\n $data['processor_progress'] = $progress;\n $this->updateBook($data);\n $this->lastUpdateTime = $now;\n }\n }\n }",
"public function setProgress($var)\n {\n GPBUtil::checkMessage($var, \\Clarifai\\Api\\Progress::class);\n $this->progress = $var;\n\n return $this;\n }",
"public function setProgress($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Bigquery\\Storage\\V1beta1\\Progress::class);\n $this->progress = $var;\n\n return $this;\n }",
"protected function _calculatePercentForProgressBar()\n {\n $this->_currentPercentDoneWork = min(100, ceil(($this->_currentIteration / $this->_countIteration) * 100));\n }",
"private static function debugProgressBar($total) {\n if (self::$DEBUG_INFO) {\n static $current = 0;\n\n if (self::$PRETTY_PROGRESS) {\n if ($current === 0) {\n self::$PROGRESS_BAR = new Console_ProgressBar(\n self::$PROGRESS_BAR_FORMAT, '=>', '-', self::HORIZ_SEP_LEN, $total, self::$PROGRESS_BAR_OPTIONS);\n }\n ++$current;\n if (self::$PROGRESS_BAR)\n self::$PROGRESS_BAR->update($current);\n } else {\n $char = \"\\r\";\n switch (++$current % 4) {\n case 0: $char .= '-';\n break;\n case 1: $char .= '\\\\';\n break;\n case 2: $char .= '|';\n break;\n case 3: $char .= '/';\n break;\n }\n printf('%s %3.2f%%', $char, ($current / $total * 100));\n }\n if ($current >= $total) {\n $current = 0;\n echo PHP_EOL;\n }\n }\n }",
"public function processBatchStatus()\n {\n \n if(is_null($this->_controller->__step)) {\n $this->status = 'complete';\n return;\n }\n $totalcount = clone($this->_selected);\n $totalcount = $totalcount->count();\n $currentcount = $this->_controller->__start+$this->_controller->__step;\n if($currentcount<$totalcount) {\n $this->status = 'partial';\n $this->start = $this->_controller->__start;\n $this->next = $currentcount;\n $this->total = $totalcount;\n } else {\n $this->status='complete';\n }\n }",
"public function createProgressBar(int $progress, int $unfinished): string;",
"public function writeProgress(string $progress): void\n {\n parent::writeProgress($progress);\n\n $this->testStatus = $this->getStatusText($progress);\n }",
"public function update($progress) {\n $updater = $this->updater;\n $updater($progress);\n }",
"public function testProgressLogger($progress): void\n {\n $process = $this->phpbench(\n 'run --progress=' . $progress . ' benchmarks/set1/BenchmarkBench.php'\n );\n $this->assertExitCode(0, $process);\n }",
"protected function _progressBar()\n {\n if ($this->_current > $this->_total) {\n return;\n }\n\n $percent = $this->_current / $this->_total;\n $nb = $percent * $this->_size;\n\n $b = str_repeat($this->_chars['bar'], floor($nb));\n $i = '';\n\n if ($nb < $this->_size) {\n $i = str_pad($this->_chars['indicator'], $this->_size - strlen($b));\n }\n\n $p = floor($percent * 100);\n\n $string = Text::insert($this->_format, compact('p', 'b', 'i'));\n\n $this->write(\"\\r\" . $string, $this->_color);\n }",
"function renderProgress($tot_complete, $tot_failed, $total, $show_title = false) {\n\t\n\tif($total == 0) return '';\n\t$perc_complete \t= round(($tot_complete / $total) * 100, 2);\n\t$perc_failed \t= round(($tot_failed / $total) * 100, 2);\n\t\n\t$title = str_replace('[total]', $total, Lang::t('_PROGRESS_TITLE', 'course'));\n\t$title = str_replace('[complete]', $tot_complete, $title);\n\t$title = str_replace('[failed]', $tot_failed, $title);\n\t\n\t$html = '';\n\tif($show_title === true) $html .= '<span class=\"progress_title\">'.$title.'</span><br />';\n\tif($perc_complete >= 100) {\n\t\t\n\t\t$html .= \"\\n\".'<div class=\"box_progress_complete\" title=\"'.$title.'\">'\n\t\t\t.'<div class=\"nofloat\">'\n\t\t\t.'</div></div>'.\"\\n\";\n\t} elseif($perc_failed + $perc_complete >= 100) {\n\t\t\n\t\t$html .= \"\\n\".'<div class=\"box_progress_failed\" title=\"'.$title.'\">';\n\t\tif($perc_complete != 0) $html .= '<div class=\"bar_complete\" style=\"width: '.$perc_complete.'%;\"></div>';\n\t\t$html .= '<div class=\"nofloat\">'\n\t\t\t.'</div></div>'.\"\\n\";\n\t} else {\n\t\t\n\t\t$html .= \"\\n\".'<div class=\"box_progress_bar\" title=\"'.$title.'\">';\n\t\tif($perc_complete != 0) $html .= '<div class=\"bar_complete\" style=\"width: '.$perc_complete.'%;\"></div>';\n\t\tif($perc_failed != 0) $html .= '<div class=\"bar_failed\" style=\"width: '.$perc_failed.'%;\"></div>';\n\t\t$html .= '<div class=\"nofloat\">'\n\t\t\t.'</div></div>'.\"\\n\";\n\t}\n\t\n\treturn $html;\n}",
"protected function progressLang($langId, $progress, $total)\n\t{\n\t\treturn strtr(qa_lang($langId), array(\n\t\t\t'^1' => qa_format_number((int)$progress),\n\t\t\t'^2' => qa_format_number((int)$total),\n\t\t));\n\t}",
"public function PercentageDone()\n {\n return round($this->currentStepNumber() / $this->numberOfSteps(), 2) * 100;\n }",
"public function progressFinish();",
"public function updateProgress($id, $progress)\n\t{\n\t\t$sql = array('progress' => $progress, 'last_modified' => new \\Zend\\Db\\Sql\\Expression('NOW()'));\n\t\t\n\t\tif($progress == 100)\n\t\t{\n\t\t\t$sql['status'] = '5';\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$sql['status'] = 3;\n\t\t}\n\t\t\n\t\treturn $this->update('tasks', $sql, array('id' => $id));\t\t\n\t}",
"public function setProgress() {\n $this->status = QueueManager::STATUS_PROGRESS;\n }",
"public function setProgress($var)\n {\n GPBUtil::checkMessage($var, \\Clarifai\\Api\\InputsExtractionJobProgress::class);\n $this->progress = $var;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation dataSourceMongosChangeStreamPost Create a change stream. | public function dataSourceMongosChangeStreamPost($options = null)
{
list($response) = $this->dataSourceMongosChangeStreamPostWithHttpInfo($options);
return $response;
} | [
"public function portalsChangeStreamPost($options = null)\n {\n list($response) = $this->portalsChangeStreamPostWithHttpInfo($options);\n return $response;\n }",
"public function dataSourcePostgreSqlsChangeStreamPost($options = null)\n {\n list($response) = $this->dataSourcePostgreSqlsChangeStreamPostWithHttpInfo($options);\n return $response;\n }",
"public function commentCreateChangeStreamPostCommentsChangeStream($options = null)\n {\n list($response, $statusCode, $httpHeader) = $this->commentCreateChangeStreamPostCommentsChangeStreamWithHttpInfo ($options);\n return $response; \n }",
"public function postCreateChangeStreamPostPostsChangeStream($options = null)\n {\n list($response) = $this->postCreateChangeStreamPostPostsChangeStreamWithHttpInfo($options);\n return $response;\n }",
"public function tagsChangeStreamPost($options = null)\n {\n list($response) = $this->tagsChangeStreamPostWithHttpInfo($options);\n return $response;\n }",
"public function groupCreateChangeStreamPostGroupsChangeStream($options = null)\n {\n list($response, $statusCode, $httpHeader) = $this->groupCreateChangeStreamPostGroupsChangeStreamWithHttpInfo ($options);\n return $response; \n }",
"public function videoCollectionCreateChangeStreamPostVideoCollectionsChangeStream($options = null)\n {\n list($response, $statusCode, $httpHeader) = $this->videoCollectionCreateChangeStreamPostVideoCollectionsChangeStreamWithHttpInfo ($options);\n return $response; \n }",
"public function userCreateChangeStreamPostUsersChangeStream($options = null)\n {\n list($response) = $this->userCreateChangeStreamPostUsersChangeStreamWithHttpInfo($options);\n return $response;\n }",
"public function postCreateChangeStreamPostPostsChangeStreamWithHttpInfo($options = null)\n {\n // parse inputs\n $resourcePath = \"/Posts/change-stream\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // form params\n if ($options !== null) {\n $formParams['options'] = $this->apiClient->getSerializer()->toFormValue($options);\n }\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\SplFileObject',\n '/Posts/change-stream'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\SplFileObject', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\SplFileObject', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function reviewCreateChangeStreamPostReviewsChangeStream($options = null)\n {\n list($response) = $this->reviewCreateChangeStreamPostReviewsChangeStreamWithHttpInfo($options);\n return $response;\n }",
"public function postCreateChangeStreamGetPostsChangeStream($options = null)\n {\n list($response) = $this->postCreateChangeStreamGetPostsChangeStreamWithHttpInfo($options);\n return $response;\n }",
"public function invitationTicketsChangeStreamPost($options = null)\n {\n list($response) = $this->invitationTicketsChangeStreamPostWithHttpInfo($options);\n return $response;\n }",
"public function testPostCreateChangeStreamPostPostsChangeStream()\n {\n\n }",
"public function postCreateChangeStreamGetPostsChangeStreamWithHttpInfo($options = null)\n {\n \n \n // parse inputs\n $resourcePath = \"/Posts/change-stream\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n \n // query params\n \n if ($options !== null) {\n $queryParams['options'] = $this->apiClient->getSerializer()->toQueryValue($options);\n }\n \n \n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'GET',\n $queryParams, $httpBody,\n $headerParams, 'object'\n );\n \n if (!$response) {\n return array(null, $statusCode, $httpHeader);\n }\n\n return array(\\DBCDK\\CommunityServices\\ObjectSerializer::deserialize($response, 'object', $httpHeader), $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 200:\n $data = \\DBCDK\\CommunityServices\\ObjectSerializer::deserialize($e->getResponseBody(), 'object', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n }",
"public function adminMessageCreateChangeStreamPostAdminMessagesChangeStream($options = null)\n {\n list($response) = $this->adminMessageCreateChangeStreamPostAdminMessagesChangeStreamWithHttpInfo($options);\n return $response;\n }",
"public function flagCreateChangeStreamPostFlagsChangeStreamWithHttpInfo($options = null)\n {\n // parse inputs\n $resourcePath = \"/Flags/change-stream\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // form params\n if ($options !== null) {\n $formParams['options'] = $this->apiClient->getSerializer()->toFormValue($options);\n }\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\SplFileObject',\n '/Flags/change-stream'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\SplFileObject', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\SplFileObject', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function groupProfileCreateChangeStreamPostGroupProfilesChangeStream($options = null)\n {\n list($response) = $this->groupProfileCreateChangeStreamPostGroupProfilesChangeStreamWithHttpInfo($options);\n return $response;\n }",
"public function test_postCreateChangeStreamGetPostsChangeStream() {\n\n }",
"public function portalsChangeStreamPostWithHttpInfo($options = null)\n {\n // parse inputs\n $resourcePath = \"/Portals/change-stream\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // form params\n if ($options !== null) {\n $formParams['options'] = $this->apiClient->getSerializer()->toFormValue($options);\n }\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\SplFileObject',\n '/Portals/change-stream'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\SplFileObject', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\SplFileObject', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/================== Get conditionement_article ===================== | public function getConditionement_article($id){
$sql = "SELECT * FROM conditionement_article WHERE conditionement_article.id = ".$id." ";
if($this->db != null)
{
return $this->db->query($sql)->fetch();
}else{
return null;
}
} | [
"public function article(){\n \treturn Mrmart::where('MRMART_AKTIF', '1')\n \t\t->where('MRMART_ARTICLEID', $this->PPRED_ART)\n \t\t\t->where('MRMART_GROUPID', $this->PPRED_GROUP)\n \t\t\t\t->first();\n }",
"public function getArticle()\n {\n return $this->article;\n }",
"public function getArticle() {\n return $this->article;\n }",
"public function get_article() {\n\t\treturn $this->article;\n\t}",
"public function listeConditionement_article(){\n\t\t\t\t\t $sql = \"SELECT * FROM conditionement_article\";\n\t\t\t\t\t if($this->db != null)\n\t\t\t\t\t {\n\t\t\t\t\t return $this->db->query($sql)->fetchAll();\n\t\t\t\t\t }else{\n\t\t\t\t\t return null;\n\t\t\t\t\t }\n\t\t\t\t\t }",
"public function get_article(){\n $bdd = $this->dbConnect();\n $id = (int)$_GET['id'];\n $$articleBack = $bdd->prepare(\"SELECT id, title, extract, content, image, crated_at FROM articles WHERE id = ?\");\n $articleBack ->execute['id'];\n $articleBack = $articleBack->fetch();\n return $articleBack;\n }",
"public function getArticleObject() {\n\t\treturn $this->article;\n\t}",
"function get_category_article() {\n\t\t$sql = \"SELECT article_category.id AS CATEGORY_ID, article_category.name AS CATEGORY_NAME, \n\t\t\t\t\t\tarticle.id AS ARTICLE_ID, article.heading AS HEADING\n\t\t\tFROM article_category\n\t\t\tLEFT JOIN article ON (article_category.id = article.category AND is_publish = '1')\n\t\t\tWHERE article_category.id <> 'category_contents'\n\t\t\tORDER BY article_category.[position]\";\n\t\t$rs = $this->db->query($sql);\n\t\t$article = array();\n\t\tif($rs->num_rows()>0){\n\t\t\tforeach ($rs->result_array() as $v) {\n\t\t\t\t$article[$v['CATEGORY_ID']]['name'] = $v['CATEGORY_NAME'];\n\t\t\t\tif($v['ARTICLE_ID']){\n\t\t\t\t\t$article[$v['CATEGORY_ID']]['item'][] = $v; \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $article;\n\t}",
"public function getArticleContent(){\n\t\t\treturn($this->articleContent);\n\t}",
"function article_status() {\n\treturn article()->status;\n}",
"function get_category_article($param=array()){\n\t\ttry {\n\t\t\t$article = array();\n\t\t\t$sql = 'SELECT '.ARTICLE_CATEGORY.'.id AS CATEGORY_ID, article_id AS ARTICLE_ID, heading AS HEADING, magainze_id AS MAGAINZE_ID\n\t\t\t\tFROM '.ARTICLE_CATEGORY.' \n\t\t\t\tLEFT JOIN ( \n\t\t\t\t\tSELECT '.ARTICLE_LIST.'.id AS article_id, '.ARTICLE_LIST.'.heading, '.ARTICLE_LIST.'.category, '.MAGAINZE_ARTICLE.'.magainze_id\n\t\t\t\t\tFROM '.MAGAINZE_ARTICLE.'\n\t\t\t\t\tINNER JOIN '.ARTICLE_LIST.' ON '.ARTICLE_LIST.'.id = '.MAGAINZE_ARTICLE.'.article_id WHERE 1=1';\n\t\t\tif(isset($param['magainze_id'])){\n\t\t\t\t$sql .= ' AND '. MAGAINZE_ARTICLE . '.magainze_id = '.$this->db->escape($param['magainze_id']);\n\t\t\t}\n\t\t\t$sql .= ') table_article\n\t\t\t\tON table_article.category = '.ARTICLE_CATEGORY.'.id ORDER BY '.ARTICLE_CATEGORY.'.position';\n\t\t\t$rs = $this->db->query($sql);\n\t\t\t//pr($this->db->last_query());\n\t\t\tforeach ($rs->result_array() as $key => $row) {\n\t\t\t\tif ($key>0) {\n\t\t\t\t\t$res['ARTICLE_ID'] = $row['ARTICLE_ID'] ? $row['ARTICLE_ID'] : '';\n\t\t\t\t\t$res['HEADING'] = $res['ARTICLE_ID'] ? $row['HEADING'] : '';\n\t\t\t\t\t$article[$row['CATEGORY_ID']][] = $res;\n\t\t\t\t}\n\t\t\t} \n\t\t\treturn $article;\n\t\t} catch (Exception $e) {\n\t\t\tdie($e);\n\t\t}\n\t}",
"public function getV_article($id){\n\t\t\t\t\t$sql = \"SELECT * FROM v_article WHERE v_article.id = \".$id.\" \";\n\t\t\t\t\t if($this->db != null)\n\t\t\t\t\t {\n\t\t\t\t\t return $this->db->query($sql)->fetch();\n\t\t\t\t\t }else{\n\t\t\t\t\t return null;\n\t\t\t\t\t }\n\t\t\t\t\t }",
"public function getArticle(){\r\n\t\t$sql=\"select * from article where time_at > '\" . date(\"Y-m-d\", time() - 3600 * 24 *21) .\"'order by reply_number desc limit 0,10\";\r\n\t\t$this->article15=$this->query($sql);\r\n\t\t//echo $sql;\r\n\t\t$time = $this->year.\"-\".$this->month.\"-\".$this->day;\r\n\t\t$timeNext = date(\"Y-m-d\", strtotime($time) + 24 * 3600);\r\n\t\t$sql=\"select * from article where city_id=\" . $this->city. \" and time_at between '\" . $time . \"' and '\" . $timeNext . \"' order by read_number desc limit 0,10\";\r\n\t\t$this->article=$this->query($sql);\r\n\t}",
"public function getId_article()\n {\n return $this->id_article;\n }",
"function getStockArticle($id_article){\n\n\t$sql = \"SELECT stock FROM article WHERE id_article = $id_article\";\n\t$article = executeRequete($sql);\n\t$stock = $article->fetch_assoc();\n\treturn $stock['stock'];\n}",
"public function getAllOrOneArticleArticleActif($idArticle) {\n $idArticleQuery = (int) $idArticle;\n $qb = $this->createQueryBuilder('p')\n ->leftJoin('p.articles', 'a')\n ->where('p.actifArticle = ' . TypeEtat::ACTIF) \n ;\n if($idArticle > 0){\n $qb->andWhere('p.id =:idArticle')\n \n ->setParameter('idArticle', $idArticleQuery);\n \n }\n \n return $qb->getQuery()->getResult();\n }",
"function fetchContent ($article) {\r\n\t$content = $article->getPage()->getContent();\r\n\t$text = ContentHandler::getContentText( $content );\r\n\treturn $text;\r\n}",
"public function ArticlesEleve()\n {\n $conn=$this->connexion(\"TDW\",\"127.0.0.1\",\"root\",\"\");\n $req= 'SELECT * from article where CategorieCons=\"Secondaire\" or CategorieCons=\"Moyen\" or CategorieCons=\"Primaire\"';\n $r= $this->requete($conn,$req);\n $this->deconnexion($conn);\n return $r;\n }",
"public function getArticles()\n {\n return $this->articles;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Page to add Chain Entities. | function entity_chains_add_page() {
$controller = entity_ui_controller('entity_chains');
return $controller->addPage();
} | [
"function centity_add_page() {\n $controller = entity_ui_controller('centity');\n return $controller->addPage();\n}",
"function component_entity_add_page() {\n $controller = entity_ui_controller('component_entity');\n return $controller->addPage();\n}",
"public function addPage() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('entity_add_list', array(\n 'type' => $this->entityType,\n 'content' => $content,\n ));\n }",
"function things_add_page() {\n $controller = entity_ui_controller('things');\n return $controller->addPage();\n}",
"function things_ids_add_page() {\n $controller = entity_ui_controller('things_ids');\n return $controller->addPage();\n}",
"function bat_type_add_page() {\n $controller = entity_ui_controller('bat_type');\n return $controller->addPage();\n}",
"function my_entity_admin_add_page() {\n $items = array();\n foreach (my_entity_types() as $my_entity_type_key => $my_entity_type) {\n $items[] = l(entity_label('my_entity_type', $my_entity_type), 'my_entity/add/' . $my_entity_type_key);\n }\n if (!empty($items)) {\n return array(\n 'list' => array(\n '#theme' => 'item_list',\n '#items' => $items,\n '#title' => t('Select type of My Entity to create.')\n )\n );\n }\n else {\n return t('You need to add My Entity types before create My Entity items. !link', array('!link' => l(t('You can add My Entity types here.'), 'admin/structure/my_entity-types/add', array('query' => array('destination' => 'my_entity/add')))));\n }\n}",
"public function addPage()\n {\n }",
"function thumbwhere_program_add_page() {\n $controller = entity_ui_controller('thumbwhere_program');\n return $controller->addPage();\n}",
"public function addPage() {\n $build = [\n '#theme' => 'rdf_add_list',\n '#cache' => [\n 'tags' => $this->entityTypeManager()\n ->getDefinition('rdf_type')\n ->getListCacheTags(),\n ],\n ];\n\n $content = [];\n\n // Only use RDF types the user has access to.\n foreach ($this->entityTypeManager()->getStorage('rdf_type')->loadMultiple() as $type) {\n $access = $this->entityTypeManager()\n ->getAccessControlHandler('rdf_entity')\n ->createAccess($type->id(), NULL, [], TRUE);\n if ($access->isAllowed()) {\n $content[$type->id()] = $type;\n }\n }\n // Bypass the rdf_entity/add listing if only one content type is available.\n if (count($content) == 1) {\n $type = array_shift($content);\n return $this->redirect('rdf_entity.rdf_add', ['rdf_type' => $type->id()]);\n }\n\n $build['#content'] = $content;\n\n return $build;\n }",
"public function doAddPage() {\n $filterTemplate = array(\n \"entity\" => FILTER_SANITIZE_STRING,\n );\n $filteredData = filter_input_array(INPUT_GET, $filterTemplate);\n\n if($filteredData['entity']) {\n $this->view->show($filteredData['entity'].'s/edit'.ucfirst($filteredData['entity']).'.php');\n }\n\n }",
"function fileshare_add_page() {\n $controller = entity_ui_controller('fileshare');\n return $controller->addPage();\n}",
"public function addAction()\n {\n $this->getPageService()->isAllowed('AllPages', 'add');\n\n $form = $this->getPageService()->getForm();\n $form->setAction('/direct/page/add');\n $frontend = new \\Core\\Model\\Frontend\\Simple();\n\n if($this->getRequest()->isPost()) {\n $data = $this->getRequest()->getPost();\n if($form->isValid($data)) {\n try {\n $page = $this->getPageService()->create($data);\n $frontend->data['url'] = $page->getURL();\n $frontend->success();\n } catch (\\Core\\Exception\\ValidationException $e) {\n $frontend->html = (string) $e;\n $frontend->fail();\n }\n } else {\n $frontend->html = $form->render();\n $frontend->fail();\n }\n } else {\n $frontend->html = $form->render();\n }\n\n $html = $this->getRequest()->getParam('html');\n if (isset($html)) {\n $page = $this->getPageService()->getPage($this->getRequest()->getParam('id', false));\n $page->getLayout()->getLocation('main')->addContent($frontend->html);\n $page->getLayout()->assign('page', $page);\n echo $page->getLayout()->render();\n } else {\n echo $frontend;\n }\n }",
"public function _createAddPage()\n {\n // the page\n $page = new \\Core\\Model\\SystemPage($this->_em->getReference('Core\\Model\\Layout', '2colalt'));\n\n // the form block\n $formView = $this->getModule('Core')->getBlockType('Form')->getView('default');\n $block = new \\Blog\\Block\\Form\\Article($formView);\n\n // some text\n $text = new \\Core\\Model\\Content\\Text('Add Article', 'Here you can add an article to the homepage. By default the home page displays the last 10 blog articles.');\n $this->_em->persist($text);\n\n $textView = $this->getModule('Core')->getContentType('Text')->getView('default');\n $leftBlock0 = new \\Core\\Model\\Block\\StaticBlock($text, $textView);\n\n // the route to get to the page\n $route = new \\Core\\Model\\Route('blog/add');\n $this->_em->persist($route->routeTo($page));\n $this->_em->persist($route);\n\n // add the block to the page\n $page->addBlock($block, $this->_em->getReference('Core\\Model\\Layout\\Location', 'main'), 0);\n $page->addBlock($leftBlock0, $this->_em->getReference('Core\\Model\\Layout\\Location', 'left'), 0);\n $this->_em->persist($page);\n }",
"public function add_client_company_page(){\n\t\t$data['form_name']= 'Add Company';\n\t\t$data['title']= 'SmartSend::Add Company';\n\t\t$data['client_type']= 'company';\n\t\t$this->welcome_to_add_client_page($data);\n\t}",
"function addPage(){}",
"function thumbwhere_host_add_page() {\n $controller = entity_ui_controller('thumbwhere_host');\n return $controller->addPage();\n}",
"function theme_entity_chains_add_list($variables) {\n $content = $variables['content'];\n $output = '';\n if ($content) {\n $output = '<dl class=\"entity-chain-type-list\">';\n foreach ($content as $item) {\n $output .= '<dt>' . l($item['title'], $item['href']) . '</dt>';\n $output .= '<dd>' . filter_xss_admin($item['description']) . '</dd>';\n }\n $output .= '</dl>';\n }\n else {\n if (user_access('administer chain types')) {\n $output = '<p>' . t('Chain Entities cannot be added because you have not created any chain types yet. Go to the <a href=\"@create-entity-chain-type\">chain type creation page</a> to add a new chain type.', array('@create-entity-chain-type' => url('admin/structure/chains/add'))) . '</p>';\n }\n else {\n $output = '<p>' . t('No chain types have been created yet for you to use.') . '</p>';\n }\n }\n\n return $output;\n}",
"public function add()\n {\n if (!$this->user->isLoggedIn()) {\n // throw new Exception('User not logged in');\n redirect(get_vocab_config('auth_url')\n . 'login#?redirect=' . portal_url('vocabs/myvocabs'));\n }\n\n // Get content for top-level menu.\n $lensMenu = $this->getLensesFindingAidMenu();\n\n $event = array(\n 'event' => 'pageview',\n 'page' => 'add',\n );\n vocab_log_terms($event);\n // If we want to log _initiation_ of an add,\n // do it here. But completion is done by the JS controller\n // calling back to logCMS().\n /*\n $event = [\n 'event' => 'portal_cms',\n 'cms' => [ 'action' => 'add' ]\n ];\n vocabs_portal_log($event);\n */\n $this->blade\n ->set('scripts', array('vocabs_cms', 'versionCtrl', 'relatedCtrl',\n 'relatedVocabularyCtrl',\n 'subjectDirective', 'relatedEntityIdentifierDirective',\n 'languageSelectionDirective'))\n ->set('vocab', false)\n ->set('page', 'cms')\n ->set('lensMenu', $lensMenu)\n ->render('cms');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inject the given array of comments into the YAML contents | public function injectComments($comments)
{
// First, process inline comments, as line numbers are preserved
foreach ($comments as $no => $comment) {
if (! $comment->isInline()) {
continue;
}
$path = $comment->getContextLine()->getYPath();
$line = $this->getLineByYPath($path);
if ($line) {
$line->append(' #' . $comment->getComment());
$this->replaceRow($line->getNo(), (string) $line);
}
unset($comments[$no]);
}
// Then insert each full-line comments
// Iterate DOWN over the comments list: prepare multi-line comments block handling
foreach (array_reverse($comments, true) as $comment) {
$contextLine = $comment->getContextLine();
if ($contextLine->isComment() && ! $contextLine->isInline()) {
$no = $this->getLineNoByRawContents((string) $contextLine);
} else {
$path = $contextLine->getYPath();
$no = $this->getLineNoByYPath($path);
}
$this->insertRow($no, (string) $comment);
}
return $this;
} | [
"public function setComments(array $comments): void\n {\n $this->comments = $comments;\n }",
"public function setComments($comments);",
"#[@test]\n public function comments() {\n $this->fixture->writeComment('section', 'Hello');\n $this->fixture->writeComment('section', 'World');\n $this->assertSavedFixtureEquals('\n [section]\n\n ; Hello\n\n ; World\n ');\n }",
"private function command_comment(array $tasks_ids, $comment) {\r\n\t\tif (strlen($comment)) {\r\n\t\t\tforeach ($tasks_ids as $id) {\r\n\t\t\t\t$this->commands[] = new CommandAddComment($id, $comment);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function setComments($comments) {$this->comments = $comments;}",
"private function setComments($_comments) {\r\n\t\t$this->_comments = (array) $_comments;\r\n\t}",
"public function addResourcesComment(array $comments, array $resourceIds): void;",
"public static function parseDocBlock($comments){\n\t\t$com = array();\n\n\t\t//remove stars and slashes\n\t\t$tmp = preg_replace('#^(\\s*/\\*\\*|\\s*\\*+/|\\s+\\* ?)#m', '', $comments);\n\n\t\t//fix new lines\n\t\t$tmp = str_replace(\"\\r\\n\", \"\\n\", $tmp);\n\t\t$tmp = explode(\"\\n\", $tmp);\n\n\t\t$desc = '';\t\n\t\t$tags = array();\n\t\t$preprocessed = array();\n\t\tfor ($i = 0, $count = count($tmp); $i < $count; $i++ ) {\n\t\t\t$line = $tmp[$i];\n\t\t\tif (substr($line, 0, 1) !== '@' && $line !== '*' && !isset($preprocessed[$i])) {\n\t\t\t\t$desc .= \"\\n\" . $line;\n\t\t\t}\n\n\t\t\tif (preg_match('/@([a-z0-9_-]+)\\s?(.*)$/i', $tmp[$i], $parsedTag)) {\n\t\t\t\t// capture continued lines. (indented with 3 spaces or 1 tab)\n\t\t\t\t$done = false;\n\t\t\t\t$next = $i + 1;\n\t\t\t\twhile (!$done) {\n\t\t\t\t\tif (isset($tmp[$next]) && preg_match('/^(?: {1,3}|\\t)([^\\t]*)$/i', $tmp[$next], $nextLine)) {\n\t\t\t\t\t\t$parsedTag[2] .= ' ' . trim($nextLine[1]);\n\t\t\t\t\t\t$preprocessed[$next] = true;\n\t\t\t\t\t\t$next++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$done = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isset($tags[$parsedTag[1]]) && !is_array($tags[$parsedTag[1]])) {\n\t\t\t\t\t$tags[$parsedTag[1]] = (array)$tags[$parsedTag[1]];\n\t\t\t\t\t$tags[$parsedTag[1]][] = $parsedTag[2];\n\t\t\t\t} elseif (isset($tags[$parsedTag[1]]) && is_array($tags[$parsedTag[1]])) {\n\t\t\t\t\t$tags[$parsedTag[1]][] = $parsedTag[2];\n\t\t\t\t} else {\n\t\t\t\t\t$tags[$parsedTag[1]] = $parsedTag[2];\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tif (isset($tags['param'])) {\n\t\t\t$params = (array)$tags['param'];\n\t\t\t$tags['param'] = array();\n\t\t\tforeach ($params as $param) {\n\t\t\t\t$paramDoc = preg_split('/\\s+/', trim($param), 3);\n\t\t\t\tswitch (count($paramDoc)) {\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tlist($type, $name) = $paramDoc;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tlist($type, $name, $description) = $paramDoc;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$name = @trim($name, '$');\n\t\t\t\t$tags['param'][$name] = compact('type', 'description');\n\t\t\t}\n\t\t}\n\t\t$com['description'] = trim($desc);\n\t\t$com['tags'] = $tags;\n\t\treturn $com;\n\t}",
"function addComments($artifact, $comments){\n\t\tforeach($comments as $c){\n\t\t\t$time = strtotime($c['date']);\n\t\t\t$uid = user_get_object_by_name($c['submitter'])->getID();\n\t\t\t$importData = array('time' => $time, 'user' => $uid);\n\t\t\t$artifact->addMessage($c['comment'], $importData);\n\t\t}\n\t}",
"private static function add_comment_content_to_akismet( &$datas, $values ) {\n\t\tif ( isset( $datas['frm_duplicated'] ) ) {\n\t\t\tforeach ( $datas['frm_duplicated'] as $index ) {\n\t\t\t\tif ( isset( $values['item_meta'][ $index ] ) ) {\n\t\t\t\t\tunset( $values['item_meta'][ $index ] );\n\t\t\t\t} else {\n\t\t\t\t\tunset( $values[ $index ] );\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset( $datas['frm_duplicated'] );\n\t\t}\n\n\t\tself::skip_adding_values_to_akismet( $values );\n\n\t\t$datas['comment_content'] = FrmEntriesHelper::entry_array_to_string( $values );\n\t}",
"private function splitDocBlock(string $comment): array {}",
"private function insertInYaml(array $injections)\n {\n $yaml_file = Yaml::parse(file_get_contents(self::YAML_FILE));\n $yaml_file = ($yaml_file)? : [];\n foreach ($injections['to_add_first'] as $injection) {\n $yaml_file = array_merge($injection, $yaml_file);\n }\n foreach ($injections['to_add_second'] as $injection) {\n $yaml_file = array_merge( $injection, $yaml_file);\n }\n\n return file_put_contents(self::YAML_FILE, Yaml::dump($yaml_file,3));\n }",
"protected function seedComments()\n {\n $defaultComments = [\n [\n 'message' => ':+1: We totally nailed the fix.',\n 'commentable_type' => 'Gitamin\\Models\\Issue',\n 'commentable_id' => 3,\n 'author_id' => 1,\n 'project_id' => 1,\n ],\n [\n 'message' => \":ship: We've deployed a fix.\",\n 'commentable_type' => 'Gitamin\\Models\\MergeRequest',\n 'commentable_id' => 1,\n 'author_id' => 3,\n 'project_id' => 2,\n ],\n [\n 'message' => \"We've identified the problem. Our engineers are currently looking at it.\",\n 'commentable_type' => 'Gitamin\\Models\\Issue',\n 'commentable_id' => 1,\n 'author_id' => 2,\n 'project_id' => 1,\n ],\n [\n 'message' => 'Something went wrong, with something or another.',\n 'commentable_type' => 'Gitamin\\Models\\Issue',\n 'commentable_id' => 1,\n 'author_id' => 1,\n 'project_id' => 2,\n ],\n [\n 'message' => ':zap: We\\'ve seen high response times from our API. It looks to be fixing itself as time goes on.',\n 'commentable_type' => 'Gitamin\\Models\\MergeRequest',\n 'commentable_id' => 1,\n 'author_id' => 1,\n 'project_id' => 3,\n ],\n ];\n\n foreach ($defaultComments as $comment) {\n Comment::create($comment);\n }\n }",
"public function setComments($comments)\n {\n // Catch empty variable.\n if (empty($comments))\n {\n $this->comments = \"\";\n return;\n }\n\n // Length of comments must not exceed COMMENT_LENGTH.\n if ($this->getLength($comments) > self::COMMENT_LENGTH)\n {\n echo \"ERROR: Length of comments must not exceed \" . self::COMMENT_LENGTH . \"\\n\";\n return;\n }\n\n $this->comments = $comments;\n }",
"static function importComments() {\n\t\t\n\t\techo_now( 'Importing comments...' );\n\t\t\n\t\tif( isset( drupal()->comments ) )\n\t\t\t$comment_table = 'comments';\n\t\telse if( isset( drupal()->comment ) )\n\t\t\t$comment_table = 'comment';\n\t\t\n\t\t$comments = drupal()->$comment_table->getRecords();\n\t\t\n\t\tforeach( $comments as $comment ) {\n\t\t\t\n\t\t\tif( ! array_key_exists( $comment['nid'], self::$node_to_post_map ) )\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\t$comment_author = array_key_exists( $comment['uid'], self::$user_to_user_map ) ? self::$user_to_user_map[ $comment['uid'] ] : 0;\n\t\t\t\n\t\t\t# D7 stores comment body as versioned metadata linked through the field_config_instance table\n\t\t\t# But for this project, we're going to short circuit that and pull the data from the right table by name\n\t\t\tif( ! array_key_exists( 'comment', $comment ) ) {\n\t\t\t\t\n\t\t\t\t$comment['comment'] = drupal()->field_data_comment_body->comment_body_value->getValue(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'entity_id' => $comment['cid'],\n\t\t\t\t\t\t'DESC' => 'revision_id'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$comment['timestamp'] = $comment['changed'];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\twp_insert_comment(\n\t\t\t\tarray(\n\t\t\t\t\t'comment_post_ID' => self::$node_to_post_map[ $comment['nid'] ],\n\t\t\t\t\t'comment_author' => $comment['name'],\n\t\t\t\t\t'comment_author_email' => $comment['mail'],\n\t\t\t\t\t'comment_author_url' => $comment['homepage'],\n\t\t\t\t\t'comment_content' => $comment['comment'],\n\t\t\t\t\t'comment_parent' => intval( $comment['thread'] ),\n\t\t\t\t\t'comment_author_IP' => $comment['hostname'],\n\t\t\t\t\t'comment_date' => date( 'Y-m-d H:i:s', $comment['timestamp'] ),\n\t\t\t\t\t'comment_approved' => (int)$comment['status'],\n\t\t\t\t\t'user_id' => $comment_author\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t}\n\t\t\n\t\tdo_action( 'imported_comments' );\n\t\t\n\t}",
"function hook_ckeditor_comment_type_load(array $entities) {\n $result = db_query('SELECT pid, foo FROM {mytable} WHERE pid IN(:ids)', array(':ids' => array_keys($entities)));\n foreach ($result as $record) {\n $entities[$record->pid]->foo = $record->foo;\n }\n}",
"function testCommentParsing() {\n\t\t$comment = <<<EOD\n\t\t/**\n\t\t * This is the title\n\t\t *\n\t\t * This is my long description\n\t\t *\n\t\t * @param string \\$foo Foo is an input\n\t\t * @param int \\$bar Bar is also an input\n\t\t * @return string\n\t\t */\nEOD;\n\t\t$result = DocblockTools::parseDocBlock($comment);\n\t\t$expected = array(\n\t\t\t'description' => \"This is the title\\n\\nThis is my long description\",\n\t\t\t'tags' => array (\n\t\t\t\t'param' => array(\n\t\t\t\t\t'foo' => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'description' => 'Foo is an input',\n\t\t\t\t\t),\n\t\t\t\t\t'bar' => array(\n\t\t\t\t\t\t'type' => 'int',\n\t\t\t\t\t\t'description' => 'Bar is also an input',\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'return' => 'string',\n\t\t\t),\n\t\t);\n\t\t$this->assertEqual($result, $expected);\n\n\t\t$comment = <<<EOD\n\t\t/**\n\t\t * This is the title\n\t\t *\n\t\t * This is my long description\n\t\t *\n\t\t * @param string \\$foo Foo is an input\n\t\t * @param int \\$bar Bar is also an input\n\t\t * @param int \\$baz Baz is also an input\n\t\t * @return string\n\t\t */\nEOD;\n\t\t$result = DocblockTools::parseDocBlock($comment);\n\t\t$expected = array(\n\t\t\t'description' => \"This is the title\\n\\nThis is my long description\", \n\t\t\t'tags' => array (\n\t\t\t\t'param' => array(\n\t\t\t\t\t'foo' => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'description' => 'Foo is an input'\n\t\t\t\t\t),\n\t\t\t\t\t'bar' => array(\n\t\t\t\t\t\t'type' => 'int',\n\t\t\t\t\t\t'description' => 'Bar is also an input',\n\t\t\t\t\t),\n\t\t\t\t\t'baz' => array(\n\t\t\t\t\t\t'type' => 'int',\n\t\t\t\t\t\t'description' => 'Baz is also an input'\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'return' => 'string',\n\t\t\t),\n\t\t);\n\t\t$this->assertEqual($result, $expected);\n\t\t\n\t\t$comment = <<<EOD\n\t\t/**\n\t\t * This is the title\n\t\t *\n\t\t * This is my long description\n\t\t *\n\t\t * @param string \\$foo Foo is an input\n\t\t * @param int \\$bar Bar is also an input\n\t\t * @param int \\$baz Baz is also an input\n\t\t * @return string This is a longer doc string for the\n\t\t * return string.\n\t\t */\nEOD;\n\t\t$result = DocblockTools::parseDocBlock($comment);\n\t\t$this->assertEqual($result['tags']['return'], 'string This is a longer doc string for the return string.', 'parsing spaces failed %s');\n\t\t\n\t\t$comment = <<<EOD\n\t\t/**\n\t\t * This is the title\n\t\t *\n\t\t * This is my long description\n\t\t *\n\t\t * @return string This is a longer doc string for the\n\t\t *\treturn string.\n\t\t */\nEOD;\n\t\t$result = DocblockTools::parseDocBlock($comment);\n\t\t$this->assertEqual($result['tags']['return'], 'string This is a longer doc string for the return string.', 'parsing single tab failed %s');\n\t\t\n\t\t\n\t\t$comment = <<<EOD\n\t\t/**\n\t\t * This is the title\n\t\t *\n\t\t * This is my long description\n\t\t *\n\t\t * @return string This is a longer doc string\n\t\t *\tfor the return string\n\t\t *\tmore lines\n\t\t * more lines.\n\t\t */\nEOD;\n\t\t$result = DocblockTools::parseDocBlock($comment);\n\t\t$expected = 'string This is a longer doc string for the return string more lines more lines.';\n\t\t$this->assertEqual($result['tags']['return'], $expected, 'parsing n-line tags failed %s');\n\t\t\n\t\t\n\t\t$comment = <<<EOD\n\t\t/**\n\t\t * This is the title\n\t\t *\n\t\t * This is my long description\n\t\t *\n\t\t * @param string \\$foo Foo is an input\n\t\t * @param int \\$bar Bar is also an input\n\t\t * @param int \\$baz Baz is also an input\n\t\t * @return string This is a longer doc string for the\n\t\t * \t\treturn string.\n\t\t */\nEOD;\n\t\t$result = DocblockTools::parseDocBlock($comment);\n\t\t$this->assertEqual($result['tags']['return'], 'string This is a longer doc string for the', 'multiple tabs should not be allowed %s');\n\t\t\n\t\t$comment = <<<EOD\n\t\t/**\n\t\t * This is the title\n\t\t *\n\t\t * This is my long description\n\t\t *\n\t\t * @deprecated\n\t\t */\nEOD;\n\t\t$result = DocblockTools::parseDocBlock($comment);\n\t\t$this->assertTrue(isset($result['tags']['deprecated']), 'parsing deprecated tags failed %s');\n\t}",
"public function multilinePhp(array $comments, string &$where): string\n {\n\n $comments = Arr::map($comments, function (mixed $key, mixed $value): array {\n return [\n sprintf(' * %s', $value)\n ];\n });\n $fullComment = sprintf(\"/**\\n%s\\n */\\n\", implode(PHP_EOL, $comments));\n\n return $where = $fullComment . $where;\n\n }",
"public function before_comment(&$comment_data = array()) {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets and sets the inset property (datainset="true"). | public function inset()
{
if (func_num_args() === 0) {
return ($this->_inset->value() == 'true') ? true : false;
}
$this->_inset->value(func_get_arg(0) === true ? 'true' : '');
return $this;
} | [
"public function inset($value) { $this->inset_val = $value; }",
"public function setValueInset($item, $inset= 10) {\n $this->valinset[$item]= $inset;\n }",
"public function getInset() {\n if ($this->inset === null) {\n if ($this->thumbnail) {\n $this->inset = new WowCharacterAvatar($this, \"inset\");\n } else {\n $this->inset = new WowDefaultCharacterAvatar($this->race, $this->gender,\"inset\");\n }\n if (!file_exists($this->inset->getLocation()) ) {\n $this->inset = new WowDefaultCharacterAvatar($this->race, $this->gender,\"inset\");\n }\n }\n return $this->inset;\n }",
"public function inset($iniinsetx=0, $iniinsety=0, $iniinsetz=0) {\n\t\tif (!$iniinsetx || !$iniinsety || !$iniinsetz)\n\t\t\treturn $this;\n\t\t$this->pos->translate($iniinsetx, $iniinsety, $iniinsetz);\n\t\t$this->size->w -= $iniinsetx; \n\t\t$this->size->h -= $iniinsety;\n\t\t$this->size->l -= $iniinsetz;\t\t\n\t\treturn $this;\n\t}",
"function EnableMargins($flag){}",
"function SetDefaultMinMargins($flag){}",
"function getBoxShadow() { return $this->readBoxShadow(); }",
"public function getDecorationSetting()\n {\n return $this->decoration_setting;\n }",
"function GetDefaultMinMargins(){}",
"function GetMargins(){}",
"function AnnotationGetStyleOffset(){}",
"public function getHorizOffset() {\r\n return $this->horizOffset;\r\n }",
"public function getOffsetCss()\n {\n return $this->_offsetCss;\n }",
"public function getSetLineup()\n {\n return $this->get(self::_SET_LINEUP);\n }",
"function SetMinMarginTopLeft(wxPoint $pt){}",
"public function getTopMargin() {\n return $this->getChildValue('tmargin');\n }",
"public function marginbase() {\n\t\treturn $this->marginbasedoff;\n\t}",
"private function setRedTopBorder(){\n\t\techo \"decor| TopBorder RED \\n\";\n\t}",
"public function getTopLeftCorner()\n {\n return $this->topLeftCorner;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
removeItem removes one product or category SEO status. | public function removeItem($item)
{
if($item instanceof Mage_Catalog_Model_Category)
{
//The item is a category, the sku will be category-<id>
$sku = 'category-' . $item->getId();
//Prepare the error for later use.
$error = $this->__('Something went wrong while removing the category SEO status.');
//Obtain the score object for later use.
$score = Mage::getModel('reload_seo/score')->loadById($item->getId(), 'category');
$type = 'category';
}
else
{
//The item is a product, the sku will be used as is.
$sku = $item->getSku();
//Prepare the error for later use.
$error = $this->__('Something went wrong while removing the product SEO status.');
//Obtain the score object for later use.
$score = Mage::getModel('reload_seo/score')->loadById($item->getId(), 'product');
$type = 'product';
}
//Create the url for the update.
$url = $this->url . $this->version . 'seo?' . http_build_query(
array(
'key' => Mage::getStoreConfig('reload/reload_seo_group/reload_seo_key'),
'language' => Mage::app()->getLocale()->getLocaleCode(),
'type' => $type,
'framework' => 'magento',
'product[sku]' => $sku,
'website' => Mage::getBaseUrl(),
)
);
//Execute the request.
$result = $this->executeCurlRequest($url, null, false, true);
if($result === null || !array_key_exists('sku', $result))
{
//Something went wrong, throw the prepared error.
throw new Exception($error);
}
try
{
$score->delete();
}
catch(Exception $ex)
{
//Something went wrong, throw the prepared error.
throw new Exception($error);
}
} | [
"public function removeitem($item);",
"public function remove( $item );",
"public function remove($item);",
"function remove()\n {\n $items = $_POST[\"items\"];\n\n // check that none of the categories are in use\n $usage = self::getCategoryStats($items);\n foreach ($usage as $ttc_id => $count) {\n if ($count > 0) {\n return -2;\n }\n }\n\n $items = implode(\", \", Misc::escapeInteger($items));\n $stmt = \"DELETE FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"time_tracking_category\n WHERE\n ttc_id IN ($items)\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return -1;\n }\n\n return 1;\n }",
"function removeFromBasket($item) {\r\n $this->getEmosECPageArray($item, \"c_rmv\");\r\n }",
"public function removeProduct()\n {\n }",
"protected function removeStockItems()\n\t{\n\t\t$manager = \\Aimeos\\MShop\\Factory::createManager( $this->getContext(), 'stock' );\n\n\t\t$search = $manager->createSearch();\n\t\t$search->setConditions( $search->compare( '=~', 'stock.productcode', 'demo-' ) );\n\n\t\t$manager->deleteItems( array_keys( $manager->searchItems( $search ) ) );\n\t}",
"public function removeAction()\n {\n if (!$this->_isActive()\n || !$this->_getHelper()->isRemoveItemAllowed()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $result = array();\n\n $quoteItem = $this->getOnepage()->getQuote()->getItemById(\n $this->getRequest()->getPost('item_id')\n );\n\n if ($quoteItem) {\n try {\n $this->getOnepage()->getQuote()\n ->removeItem($quoteItem->getId());\n \n $this->_recalculateTotals();\n $result['success'] = true;\n /**\n * When cart is ampty - redirect to empty cart page\n */\n if(!$this->getOnepage()->getQuote()->getItemsCount()){\n $result['redirect'] = Mage::helper('checkout/cart')->getCartUrl();\n }\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('There was an error during removing product from order');\n }\n } else {\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('Product was not found');\n }\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }",
"public function removeProduct($product);",
"function testRemoveFromBasket() {\n $testPostData = [\n 'productId' => '1'\n ];\n\n $basketController = new \\NNGames\\Controllers\\BasketController($this->mockProductsTable, null, $testPostData);\n \n $result = $basketController->removeFromBasket();\n $jsonResponse = json_decode($result['variables']['response'], true);\n\n $this->assertEquals('Product removed from basket.', $jsonResponse['status']);\n }",
"public function testCanRemoveItemFromBasket()\n {\n // Given there is a product with an option;\n $product = $this->createProduct();\n $option = $this->createProductOptionFor($product);\n\n // And we add it to the basket;\n $this->addProductToBasket($product, $this);\n\n // When we remove it from the basket;\n $this->press(\"Remove {$product->name}\")->see('removed');\n\n // Then it should not be in the basket.\n $this->actingAs($this->customerUser())\n ->visit(route('sales.customer.basket'))\n ->dontSee($option->label);\n }",
"public function action_remove_filter_item()\n {\n //z aprametru pozadavku si vytahnu ID filterstate zaznamu\n $filterstate_id = arr::get($this->request_params, 'id', NULL);\n\n //nactu z DB\n $filterstate = ORM::factory('filterstate', $filterstate_id);\n\n //pokud byl nalezen tak odstranim\n if ($filterstate->loaded())\n {\n $filterstate->delete();\n }\n //vystup bude prazdny\n $this->template = new View('null');\n }",
"public function remove()\r\n {\r\n if (!is_numeric($this->getRequest()->postParam('product_id'))) {\r\n throw new \\Exception('Invalid product id');\r\n }\r\n $productId = $this->Request->postParam('product_id');\r\n $wishlist = $this->getSession()->get('wishlist');\r\n if (false !== $key = array_search($productId, $wishlist)) {\r\n unset($wishlist[$key]);\r\n $this->getSession()->add('wishlist', $wishlist);\r\n echo json_encode(\r\n array(\r\n 'success' => true,\r\n 'total' => count($wishlist)\r\n )\r\n );\r\n }\r\n exit();\r\n }",
"public function remove_product(){\n\t \t$productId = $_REQUEST['productId'];\n\t \t$attributeValueId = $_REQUEST['attributeValueId'];\n\t \t\n\t \t//remove_product\n\t \tProductExt::deleteSessionCart($productId, $attributeValueId);\n \t\t\t\n\t \t//view\n\t \tSessionMessage::addSessionMessage(SessionMessage::$SUCCESS, 'Remove product is success');\n\t \t$this->setRender('success');\n }",
"public function removeItem($id) {\r\n unset($this->items[$id]);\r\n return $this->saveBasket();\r\n }",
"public function removeExpenceCategory(){\n\t\t$this->user = Auth::getUser();\t\t\n\t\t$user_id = $this->user->id;\t\n\t\tif(isset($_POST['toDelete'])){\n\t\t\t$paymentWayID = $_POST['toDelete'];\n\t\t\tif(Expense::removeCategory($user_id, $paymentWayID)){\n\t\t\techo (\"<p class=\\\"text-success light-input-bg\\\"><b>Usunięto kategorię wydatku</b></p>\");\n\t\t\t} else {\n\t\t\t\techo (\"<p class=\\\"text-success light-input-bg\\\"><b>Wystąpił błąd podczas usuwania kategorii wydatku</b></p>\");\n\t\t\t}\t\n\t\t} else {\n\t\t\techo (\"<p class=\\\"text-info light-input-bg\\\"><b>Wystapił błąd przy przekazywaniu wartości kategorii wydatku</b></p>\");\n\t\t}\n\t }",
"public function removeFromCart($item) {\n\n // Not in cart then do nothing\n\n }",
"public function remove_item() {\n $user_id = $_SESSION['id'];\n $movie_id = $_POST['movie_id'];\n $ret = $this->cart_model->remove_item($user_id, $movie_id);\n header('Location: /new/index.php/cart');\n $this->helper_functions->post_success_of_fail($ret);\n }",
"function nm_mini_cart_remove_product() {\n\t\t$cart_item_key = $_POST['cart_item_key'];\n\t\t\n\t\t$cart = WC()->instance()->cart;\n\t\t$removed = $cart->remove_cart_item( $cart_item_key ); // Note: WP 2.3 >\n\t\t\n\t\tif ( $removed )\t{\n\t\t $json_array['status'] = '1';\n\t\t $json_array['cart_count'] = $cart->get_cart_contents_count();\n\t\t $json_array['cart_subtotal'] = $cart->get_cart_subtotal();\n\t\t} else {\n\t\t\t$json_array['status'] = '0';\n\t\t}\n\t\t\n\t\techo json_encode( $json_array );\n\t\t\t\t\n\t\texit;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function return the wallet address from user id | public function userAddress($id) {
$wallet = $this->andWhere(['id_user'=>$id])->one();
if (null === $wallet){
// $session = Yii::$app->session;
// $string = Yii::$app->security->generateRandomString(32);
// $session->set('token-wizard', $string );
return null; //$this->redirect(['wallet/wizard','token' => $string]);
} else {
return $wallet->wallet_address;
}
} | [
"public static function get_btc_wallet_address($user_id) {\n $user_id = $user_id ?? Auth::id();\n\n $btc_wallet = BtcWallet::where('user_id',$user_id)->first();\n\n if($btc_wallet <> null){\n return $btc_wallet->address;\n } \n return \"\";\n }",
"public static function getLoggedInUserFullAddress()\n {\n \t$userId = Auth::getUser()->ID;\n \t$user = self::select('address1','zip','city','state')->where('ID', $userId)->first();\n \t$address = str_ireplace(\" \",\"+\",$user->address1).',+'.$user->zip.',+'.str_ireplace(\" \",\"+\",$user->city).',+'.str_ireplace(\" \",\"+\",$user->state);\n \treturn $address;\n }",
"function get_user_wallet($user_id=''){\r\n\t\t\r\n\t\t$wallet_id = getField('wallet_id', 'wallet', 'user_id', $user_id);\r\n\t\t\r\n\t\treturn $wallet_id;\r\n\t\t\r\n\t}",
"public function getUseraddress()\n {\n return $this->useraddress;\n }",
"public function getUserAddress()\r\n {\r\n return $this->user_address;\r\n }",
"public function getCoinAddress($userID) {\n $this->debug->append(\"STA \" . __METHOD__, 4);\n return $this->getSingle($userID, 'coin_address', 'id');\n }",
"public static function getWalletWithAddress( $user_id ) {\n\n $enabled_coins = [];\n $btcAddress = Addresses::getAddressByUserID( $user_id, 1 );\n $ethAddress = Addresses::getAddressByUserID( $user_id, 2 );\n $xemAdddress = Addresses::getAddressByUserID( $user_id, 9 );\n\n $wallets = Wallet::leftJoin('addresses', function ( $join ) {\n $join->on('wallet.coin_id', 'addresses.address_coin');\n $join->on('wallet.user_id', 'addresses.address_user_id');\n })\n ->join('coins', 'coins.coin_id', '=', 'wallet.coin_id')\n ->where('wallet.wallet_enabled', 1)\n ->where('wallet.user_id', $user_id)\n ->orderBy('coins.coin_id')\n ->get([\n 'wallet.id AS wallet_id',\n 'wallet.coin_id AS coin_id',\n 'amount',\n 'amount_inorder',\n 'address_address',\n 'coin_coin',\n 'coin_max_withdraw',\n 'coin_erc',\n 'coin_fiat',\n 'coin_market',\n 'coin_address'\n ]);\n\n //Terminating here if no rows exists based on our conditions\n if( !$wallets || !count($wallets) ) return response()->json( $enabled_coins );\n\n //Creating the coin details array\n foreach( $wallets as $wallet ) {\n\n if($wallet->coin_fiat == 0) {\n\n $available_balance = bcsub($wallet->amount, $wallet->amount_inorder, 9);\n } else {\n\n $available_balance = bcsub($wallet->amount, $wallet->amount_inorder, 2);\n }\n\n $wallet_address = [\n 'coin_id' => $wallet->coin_id,\n 'symbol' => $wallet->coin_coin,\n 'amount' => $wallet->amount,\n 'amount_inorder' => $wallet->amount_inorder,\n 'available' => $available_balance,\n 'payment_amount' => null,\n 'payment_address' => null,\n 'show_withdraw' => false,\n 'show_deposit' => false,\n 'show_data' => 1,\n 'total_fee' => 0,\n 'credit_amount' => 0,\n 'class' => '',\n 'daily_limit' => $wallet->coin_max_withdraw,\n 'btn_disabled' => false,\n 'error' => '',\n 'maintenance_mode' => false\n ];\n\n if($wallet->coin_market == 'ETH') {\n $wallet['address'] = $ethAddress->address_address;\n }\n\n switch ( $wallet->coin_market ) {\n\n case 'BTC': $wallet_address['address'] = $btcAddress->address_address; break;\n case 'ETH': $wallet_address['address'] = $ethAddress->address_address; break;\n case 'XEM': $wallet_address['address'] = $xemAdddress->address_address; break;\n default: $wallet_address['address'] = $wallet->address_address; break;\n }\n\n if($wallet->coin_id == 13) {\n\n $wallet_address['show_details'] = false;\n }\n\n if( $wallet->coin_fiat == 0 ) {\n\n $wallet_blockchain = Blockchainservice::getCoinBalance( $wallet->coin_coin, $wallet_address['address'], $wallet->coin_address);\n\n if($wallet_blockchain['status'] == true) {\n\n $wallet_address['amount'] = number_format($wallet_blockchain['data'], 9);\n $wallet_address['available'] = bcsub($wallet_address['amount'], $wallet->amount_inorder, 9);\n\n $updateWallet = Wallet::find($wallet->wallet_id);\n $updateWallet->amount = number_format($wallet_blockchain['data'], 9);\n $updateWallet->save();\n unset($updateWallet);\n } else {\n\n $wallet_address['maintenance_mode'] = true;\n }\n }\n\n $coin_market = $wallet->coin_market != '' ? $wallet->coin_market : 'general_market';\n\n $enabled_coins[$coin_market][$wallet->coin_id] = $wallet_address;\n }\n\n return $enabled_coins;\n }",
"function fetchAddress($db, $username)\n {\n // query to fetch user id\n $ID_query = \"SELECT iduser\n FROM user \n WHERE username = '$username' \";\n\n $result_ID = mysqli_query($db, $ID_query);\n // error checking\n if (!$result_ID || mysqli_num_rows($result_ID) == 0) {\n echo \"Could not successfully run query ($ID_query) from DB.\";\n exit;\n }\n // fetches user id from db\n $value = $result_ID->fetch_object();\n $ID_user = $value->iduser;\n\n // query to fetch user profile info\n $profile_query = \"SELECT client_add1, client_add2, city, state, zipcode\n FROM user_info\n WHERE iduser = '$ID_user' \";\n\n $result_profile = mysqli_query($db, $profile_query);\n // fetches user profile info from db\n $row_fetchProfile = mysqli_fetch_assoc($result_profile);\n\n // builds the user's whole address to be displayed in quote form\n $user_add_for_form = $row_fetchProfile[\"client_add1\"].\"<br>\".$row_fetchProfile[\"client_add2\"].\"<br>\".$row_fetchProfile[\"city\"].\", \".$row_fetchProfile[\"state\"].\", \".$row_fetchProfile[\"zipcode\"];\n \n return $user_add_for_form;\n }",
"public function getBillingAddressId();",
"public function getUserAddress() {\n\t\treturn $this->userAddress;\n\t}",
"private function getUserBillingAddress(rtGuardUser $user)\n {\n return Doctrine::getTable('rtAddress')->getAddressForModelAndIdAndType('rtGuardUser',$user->getId(),'billing');\n }",
"public function getAddress($address_id) {\n return $this->request(\n \"GET\",\n \"/application/user/addresses/{$address_id}\",\n \"UserAddress\"\n );\n }",
"public function getAddressId();",
"private function address()\n {\n return $this->user->profile->profile_address ?? null;\n }",
"public function getAddress($address_id) {\n return $this->request(\n \"GET\",\n \"/users/{$this->user_id}/addresses/{$address_id}\",\n \"UserAddress\"\n )\n ->first();\n }",
"public function getBillingAddress();",
"public function getCustomerAddressId();",
"public function getUserAddress() {\n $token = Input::get('auth_token');\n $user_id = $this->checkForUserAuthentication($token);\n if ($user_id) {\n $data = $this->addressRepository->findWhere(array('user_id' => $user_id))->getData();\n if (count($data) > 0) {\n $user_addresses = $this->addressTransformer->transformCollection($data->toArray());\n return $this->respond(array('data' => $user_addresses));\n }\n return $this->respond(array('data' => []));\n }\n return $this->respondNotAuthorized();\n }",
"public function getFullAddress()\r\n {\r\n $fullAddress = '';\r\n $userAddress = UserAddress::find()->where(['uid' => $this->id])->one();\r\n if ($userAddress) {\r\n $fullAddress = District::fullNameByCode($userAddress->district) . $userAddress->region;\r\n }\r\n return $fullAddress;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cron job method for product prices to reindex | public function reindexProductPrices(Mage_Cron_Model_Schedule $schedule)
{
$indexProcess = Mage::getSingleton('index/indexer')->getProcessByCode('catalog_product_price');
if ($indexProcess) {
$indexProcess->reindexAll();
}
} | [
"public function reindexPrices()\n {\n $process = Mage::getModel('index/indexer')->getProcessByCode('catalog_product_price');\n $process->reindexEverything();\n }",
"protected function reindexPriceIndex()\n {\n /** @var Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n $process = $indexer->getProcessByCode('catalog_product_price');\n $process->reindexEverything();\n }",
"public function processReindex()\n {\n $allStores = Mage::helper('db1_anymarket')->getAllStores();\n foreach ($allStores as $store) {\n $storeID = $store['store_id'];\n $cronEnabled = Mage::getStoreConfig('anymarket_section/anymarket_cron_group/anymarket_reindex_field', $storeID);\n if( $cronEnabled == '1' ) {\n $processes = Mage::getSingleton('index/indexer')->getProcessesCollection();\n foreach ($processes as $process) {\n if( $process->getData(\"mode\") == \"manual\" ) {\n $process->reindexEverything();\n }\n }\n }\n }\n }",
"public function cron_product_update() {\n\t\t\n\t\t\t$currentDate = date('Y-m-d');\n\t\t\tset_time_limit(120);\n\t\t\t$updateProds = fah_webshop_recent_products_date($currentDate);\n\t\t\t\n\t\t\tif (!$updateProds->result) {\n\t\t\t\t\n\t\t\t\t$updateProds->productErr = true;\n\t\t\t\t$updateProds->sendErrorMail();\n\n\n\t\t\t}\n\n\t\t\tif (get_option( 'fah_select_import_run' )) {\n\t\t\t\t\n\t\t\t\t//update_option('fah_select_import_run',date('Y-m-d h:i:s'));\n\t\t\t\tupdate_option('fah_select_import_run',current_time('mysql',false));\n\n\t\t\t} else \n\t\t\t\t//add_option('fah_select_import_run', date('Y-m-d h:i:s'),null,false);\n\t\t\t\tadd_option('fah_select_import_run', current_time('mysql',false),null,false);\n\t\t\t\n\t\t\n\n\n\t}",
"function updateAllPrices()\r\n {\r\n $this->setPriceFromCSV($this->stockIndex())\r\n \r\n }",
"public static function runCron()\n {\n if (\\CB\\Config::getFlag('disableTriggers')\n || \\CB\\Config::getFlag('disableSolrIndexing')\n ) {\n return;\n }\n\n $solrClient = new \\CB\\Solr\\Client();\n $solrClient->updateTree();\n unset($solrClient);\n }",
"public function actionNeweggPriceUpdate()\n {\n ob_start();\n\n $connection = Yii::$app->get(Yii::$app->getBaseDb());\n\n $dbList = Yii::$app->getDbList();\n\n $processedMerchantCount = 0;\n $size = 100;\n\n $result = NeweggCronSchedule::find()->where(['cron_name' => 'price_update'])->one();\n if ($result && $result['cron_data'] != \"\") {\n $cron_array = json_decode($result['cron_data'], true);\n } else {\n $cron_array = $connection->createCommand(\"SELECT * FROM `merchant_db` WHERE `app_name` LIKE '%\" . Data::APP_NAME_NEWEGG_US . \"%'\")->queryAll();\n }\n\n if (is_array($cron_array) && count($cron_array)) {\n foreach ($cron_array as $key => $merchant) {\n try {\n\n if (!in_array($merchant['db_name'], $dbList)) {\n unset($cron_array[$key]);\n continue;\n }\n\n if ($processedMerchantCount == $size)\n break;\n $processedMerchantCount++;\n unset($cron_array[$key]);\n\n Yii::$app->dbConnection = Yii::$app->get($merchant['db_name']);\n Yii::$app->merchant_id = $merchant['merchant_id'];\n Yii::$app->shop_name = $merchant['shop_name'];\n\n $query = \"SELECT `config`.`seller_id`, `config`.`authorization`,`config`.`secret_key`,`shop`.`purchase_status`, `shop`.`token`, `shop`.`email`,`shop`.`app_status`, `shop`.`install_status`, `shop`.`currency` FROM `newegg_configuration` `config` INNER JOIN (SELECT `token`, `app_status`, `install_status`,`purchase_status`,`email`, `merchant_id`, `currency` FROM `newegg_shop_detail` WHERE `merchant_id`='{$merchant['merchant_id']}') `shop` ON `shop`.`merchant_id` = `config`.`merchant_id` WHERE `config`.`merchant_id`='{$merchant['merchant_id']}'\";\n\n $configData = Data::sqlRecords($query, 'one');\n\n if ($configData) {\n $isValidate = Neweggappdetail::validateApiCredentials($configData['seller_id'], $configData['secret_key'], $configData['authorization']);\n\n if (!$configData['install_status'] || $configData['purchase_status'] == \"License Expired\" || $configData['purchase_status'] == \"Trail Expired\" || $configData['app_status'] == \"uninstall\") {\n continue;\n }\n\n $configData['merchant_id'] = $merchant['merchant_id'];\n $configData['shop_url'] = $merchant['shop_name'];\n\n $obj = new NeweggproductController(Yii::$app->controller->id, '');\n $obj->actionPriceupdate($configData, true);\n }\n } catch (Exception $e) {\n Data::createLog(\"order sync exception \" . $e->getMessage() . PHP_EOL . $e->getTraceAsString(), 'NeweggOrderCron/exception.log', 'a', true);\n if (isset($cron_array[$key]))\n unset($cron_array[$key]);\n continue;\n } catch (\\yii\\db\\IntegrityException $e) {\n Data::createLog(\"order sync db-integrity-exception \" . $e->getMessage() . PHP_EOL . $e->getTraceAsString(), 'NeweggOrderCron/exception.log', 'a', true);\n if (isset($cron_array[$key]))\n unset($cron_array[$key]);\n continue;\n } catch (\\yii\\db\\Exception $e) {\n Data::createLog(\"order sync db-exception \" . $e->getMessage() . PHP_EOL . $e->getTraceAsString(), 'NeweggOrderCron/exception.log', 'a', true);\n if (isset($cron_array[$key]))\n unset($cron_array[$key]);\n continue;\n }\n }\n }\n\n if (count($cron_array) == 0)\n $result->cron_data = \"\";\n else\n $result->cron_data = json_encode($cron_array);\n\n $result->save(false);\n $html = ob_get_clean();\n }",
"function cron_solr_index_data() {\r\n\r\n\t$option_indexes_object = new WPSOLR_Option_Indexes();\r\n\t$indexes = [];\r\n\tforeach ( $option_indexes_object->get_indexes() as $index_indice => $index ) {\r\n\t\t$indexes[ $index_indice ] = isset( $index['index_name'] ) ? $index['index_name'] : 'Index with no name';\r\n\t}\r\n\t$current_index = key( $indexes );\r\n\r\n\ttry {\r\n\r\n\t\tset_error_handler( 'wpsolr_my_error_handler' );\r\n\t\tregister_shutdown_function( 'wpsolr_fatal_error_shutdown_handler' );\r\n\r\n\t\t// Indice of Solr index to index\r\n\t\t$solr_index_indice = $current_index;\r\n\r\n\t\t// Batch size\r\n\t\t$batch_size = 200;\r\n\r\n\t\t// nb of document sent until now\r\n\t\t$nb_results = 0;\r\n\r\n\t\t// Debug infos displayed on screen ?\r\n\t\t$is_debug_indexing = false;\r\n\r\n\t\t// Re-index all the data ?\r\n\t\t$is_reindexing_all_posts = false;\r\n\r\n\r\n\t\t// Stop indexing ?\r\n\t\t$is_stopping = false;\r\n\r\n\t\t$solr = WPSOLR_IndexSolariumClient::create( $solr_index_indice );\r\n\r\n\t\t$process_id = 'wpsolr-cron';\r\n\r\n\r\n\t\t$res_final = $solr->index_data( $is_stopping, $process_id, null, $batch_size, null, $is_debug_indexing );\r\n\r\n\t\t// Increment nb of document sent until now\r\n\t\t$res_final['nb_results'] += $nb_results;\r\n\r\n\t\techo wp_json_encode( $res_final );\r\n\r\n\t\t$models = $solr->get_models();\r\n\r\n\t\t$solr->unlock_models($process_id, $models);\r\n\r\n\t} catch ( Exception $e ) {\r\n\r\n\t\techo wp_json_encode(\r\n\t\t\t[\r\n\t\t\t\t'nb_results' => 0,\r\n\t\t\t\t'status' => $e->getCode(),\r\n\t\t\t\t'message' => htmlentities( $e->getMessage() ),\r\n\t\t\t\t'indexing_complete' => false,\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t}\r\n\r\n}",
"function cron_run_import(){\n $this->pushLog(\"Start export from cron:\".date(\"Y-m-d H:i:s\"));\n $this->export_by='CRON';\n if (Mage::getStoreConfig('qixol/promo/enabled')>0){\n $this->run_import_promotionsForProducts(); \n $this->run_import_promotionsForBaskets();\n }\n $this->pushLog(\"Finish export from cron\".date(\"Y-m-d H:i:s\")); \n }",
"protected function reindexStockIndex()\n {\n /** @var Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n $process = $indexer->getProcessByCode('cataloginventory_stock');\n $process->reindexEverything();\n }",
"protected function _reindexUpdatedProducts()\r\n {\r\n $entityIds = $this->_getProcessedProductIds();\r\n if(empty($entityIds)) {\r\n return $this;\r\n }\r\n\t\r\n $event = Mage::getModel('index/event');\r\n $event->setNewData(array(\r\n 'reindex_price_product_ids' => $entityIds, // for product_indexer_price\r\n 'reindex_stock_product_ids' => $entityIds, // for indexer_stock\r\n 'product_ids' => $entityIds, // for category_indexer_product\r\n 'reindex_eav_product_ids' => $entityIds // for product_indexer_eav\r\n ));\r\n $this->setLogForPartialIndexer('partial indexer started to update website date');\r\n Mage::getModel('partialindex/website')->updateWebsiteDate();\r\n $this->setLogForPartialIndexer('partial indexer ended to update website date');\r\n // Index our product entities.\r\n $this->setLogForPartialIndexer('partial indexer started the stock indexer');\r\n Mage::dispatchEvent('partialindex_reindex_products_before_indexer_stock', array('entity_id' => $entityIds));\r\n Mage::getResourceSingleton('cataloginventory/indexer_stock')->catalogProductMassAction($event);\r\n $this->setLogForPartialIndexer('partial indexer ended the stock indexer');\r\n \r\n if((int)Mage::getStoreConfig('progos_partialindex/index/priceindexer')) {\r\n $this->setLogForPartialIndexer('partial indexer started the price indexer');\r\n Mage::dispatchEvent('partialindex_reindex_products_before_product_indexer_price', array('entity_id' => $entityIds));\r\n Mage::getResourceSingleton('catalog/product_indexer_price')->catalogProductMassAction($event);\r\n $this->setLogForPartialIndexer('partial indexer ended the price indexer');\r\n }\r\n $this->setLogForPartialIndexer('partial indexer started the category indexer');\r\n Mage::dispatchEvent('partialindex_reindex_products_before_category_indexer_product', array('entity_id' => $entityIds));\r\n Mage::getResourceSingleton('catalog/category_indexer_product')->catalogProductMassAction($event);\r\n $this->setLogForPartialIndexer('partial indexer ended the category indexer');\r\n \r\n $this->setLogForPartialIndexer('partial indexer started the eav indexer');\r\n Mage::dispatchEvent('partialindex_reindex_products_before_product_indexer_eav', array('entity_id' => $entityIds));\r\n Mage::getResourceSingleton('catalog/product_indexer_eav')->catalogProductMassAction($event);\r\n $this->setLogForPartialIndexer('partial indexer ended the eav indexer');\r\n \r\n $this->setLogForPartialIndexer('partial indexer started the fulltetx indexer');\r\n Mage::dispatchEvent('partialindex_reindex_products_before_fulltext', array('entity_id' => &$entityIds));\r\n Mage::getResourceSingleton('catalogsearch/fulltext')->rebuildIndex(null, $entityIds);\r\n $this->setLogForPartialIndexer('partial indexer ended the fulltetx indexer');\r\n \r\n $this->setLogForPartialIndexer('partial indexer started the url rewrite indexer');\r\n Mage::dispatchEvent('partialindex_reindex_products_before_urlrewrite', array('entity_id' => $entityIds));\r\n /* @var $urlModel Mage_Catalog_Model_Url */\r\n $urlModel = Mage::getSingleton('catalog/url');\r\n\r\n $urlModel->clearStoreInvalidRewrites(); // Maybe some products were moved or removed from website\r\n foreach ($entityIds as $productId) {\r\n $urlModel->refreshProductRewrite($productId);\r\n }\r\n $this->setLogForPartialIndexer('partial indexer ended the url rewrite indexer');\r\n \r\n\r\n if((bool)Mage::getStoreConfig('progos_partialindex/index/enableProductFlatIndexer')) {\r\n $this->setLogForPartialIndexer('partial indexer started the flat indexer');\r\n Mage::dispatchEvent('partialindex_reindex_products_before_flat', array('entity_id' => $entityIds));\r\n Mage::getSingleton('catalog/product_flat_indexer')->saveProduct($entityIds);\r\n $this->setLogForPartialIndexer('partial indexer ended the flat indexer');\r\n }\r\n \r\n $this->clearCache($entityIds);\r\n \r\n Mage::dispatchEvent('partialindex_reindex_products_after', array('entity_id' => $entityIds));\r\n $this->setLogForPartialIndexer('partial indexer ended the update process table');\r\n return $this;\r\n }",
"public function cron()\n\t{\n\t\tif ($this->tank_auth->is_admin())\n\t\t{\n\t\t\t$last_check = get_setting('fs_cron_autoupgrade');\n\n\t\t\t// hourly cron\n\t\t\tif (time() - $last_check > 3600)\n\t\t\t{\n\t\t\t\t// update autoupgrade cron time\n\t\t\t\t$this->db->update('preferences', array('value' => time()), array('name' => 'fs_cron_autoupgrade'));\n\n\t\t\t\t// load model\n\t\t\t\t$this->load->model('upgrade_model');\n\t\t\t\t// check\n\t\t\t\t$versions = $this->upgrade_model->check_latest(TRUE);\n\n\t\t\t\t// if a version is outputted, save the new version number in database\n\t\t\t\tif ($versions[0])\n\t\t\t\t{\n\t\t\t\t\t$this->db->update('preferences', array('value' => $versions[0]->version . '.' . $versions[0]->subversion . '.' . $versions[0]->subsubversion), array('name' => 'fs_cron_autoupgrade_version'));\n\t\t\t\t}\n\n\t\t\t\t// remove one week old logs\n\t\t\t\t$files = glob($this->config->item('log_path') . 'log*.php');\n\t\t\t\tforeach ($files as $file)\n\t\t\t\t{\n\t\t\t\t\tif (filemtime($file) < strtotime('-7 days'))\n\t\t\t\t\t{\n\t\t\t\t\t\tunlink($file);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// reload the settings\n\t\t\t\tload_settings();\n\t\t\t}\n\t\t}\n\t}",
"public function crons_daily(){\n global $wpdb;\n\n $cron_daily = get_option('wooyellowcube_cron_daily');\n $current_day = date('Ymd');\n\n // Execute CRON\n if($current_day != $cron_daily){\n $this->update_stock();\n\n // Update last execution date\n update_option('wooyellowcube_cron_daily', date('Ymd'));\n }\n\n if(isset($_GET['cron_daily'])){\n \t\t$this->update_stock();\n \t}\n\n if(get_option('wooyellowcube_logs') > 1){\n $date_gap = get_option('wooyellowcube_logs') * 60 * 60 * 24;\n $wpdb->query(\"DELETE FROM wooyellowcube_logs WHERE created_at < \".(time() - $date_gap));\n }\n\n }",
"public function reindexAll()\n\t{\n\t\tif (version_compare(Mage::getVersion(), '1.4.1', '<') && strpos(Mage::getVersion(), '-devel') === 'false')\n\t\t{\n\t\t\t$this->_prepareFinalPriceData();\n\t\t\t$this->_oldPrepareBCPConfigurablePriceData();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->useIdxTable(true);\n\t\t\t$this->_prepareFinalPriceData();\n\t\t\t$this->_applyBCPConfigurablePriceData();\n\t\t\t$this->_applyCustomOption();\n\t\t\t$this->_movePriceDataToIndexTable();\n\t\t}\n\t\treturn $this;\n\t}",
"public function shopifyCronJob(){\n $this->load->model('Projects_model');\n $projects = $this->db->select('*')->from('projects')->where_in('connection_type',[1,3])->get()->result_array();\n $this->updateArticleInShopify();\n if(!empty($projects)){\n foreach ($projects as $p_key => $p_value) {\n $projectId = $p_value['id'];\n if($this->Projects_model->getValue('cms', $projectId)!='shopify')\n continue;\n $enabled = $this->Projects_model->getValue('enabled', $projectId);\n // check if the last execution time is satisfy the time checking.\n if($enabled == '1'){\n if($p_value['erp_system'] == 'exactonline') {\n $this->importArticleFromExact($projectId);\n $this->importCustomerFromExact($projectId);\n }\n }\n }\n } \n }",
"public function updateProductPrice(){\n\n $start = microtime(true);\n $importdate = date(\"d-m-Y H:i:s\", strtotime(\"now\"));\n $log = \"Product price update started at: \".$importdate;\n Mage::log($log, null, 'price_sync.log', true);\n\n $iProducts = Mage::getModel('xcentia_coster/product')\n ->getCollection()\n ->addFieldToFilter('cost_status', '1')\n ->setPageSize(500)\n ->setCurPage(1);\n\n if($iProducts->getSize() > 0){\n\n foreach($iProducts as $iProduct) {\n\n $iProductObject = Mage::getModel('xcentia_coster/product')->load( $iProduct->getId() );\n\n if($iProductObject->getSku()) {\n $price = $iProductObject->getCost() * self::MARGIN;\n $productId = Mage::getModel('catalog/product')->getIdBySku( $iProductObject->getSku() );\n if($productId){\n $product = Mage::getModel('catalog/product')->load($productId);\n $product->setPrice($price);\n try {\n $product->save();\n $iProductObject->setCost_status(0)->save();\n $log = \"\\n\".'updating price for SKU ['.$iProductObject->getSku().'] ID ['.$iProductObject->getEntity_id().\"]\\n\";\n Mage::log($log, null, 'price_sync.log', true);\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n }\n }\n }\n\n $time_elapsed_secs = microtime(true) - $start;\n $importdate = date(\"d-m-Y H:i:s\", strtotime(\"now\"));\n $log = \"Product price update finished at: \".$importdate.\" Done in \".round($time_elapsed_secs).\" seconds!\";\n Mage::log($log, null, 'price_sync.log', true);\n }",
"public function cron()\n {\n if ($this->_model->getConfigData('active') && $this->_model->getConfigData('async')) {\n $orderCollection = Mage::getModel('sales/order_payment')\n ->getCollection()\n ->join(array('order'=>'sales/order'), 'main_table.parent_id=order.entity_id', 'state')\n ->addFieldToFilter('method', $this->_model->_code)\n ->addFieldToFilter('state', array('in' => array(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, Mage_Sales_Model_Order::STATE_PROCESSING)))\n ->addFieldToFilter('status', Mage_Index_Model_Process::STATUS_PENDING)\n ;\n\n $this->_model->log(array('run sql------>>>', $orderCollection->getSelect()->__toString()));\n\n foreach ($orderCollection as $orderRow) {\n $order = Mage::getModel('sales/order')->load($orderRow->getParentId());\n\n $this->_model->log(array('found order------>>>', 'IncrementId' => $order->getIncrementId(), 'Status' => $order->getStatus(), 'State' => $order->getState()));\n\n $this->syncOrderStatus($order);\n }\n }\n }",
"public function cronOfferExpire() {\n $expireOffers = ShopOffer::where('expire_date', '<', Carbon::now('Asia/Kolkata'))\n ->where('status', '!=', 4)\n ->get();\n//prd(Carbon::now());\n foreach ($expireOffers as $_offer) {\n $offerData = ShopOffer::findOrFail($_offer->id);\n $offerData->status = 4;\n $offerData->save();\n }\n }",
"public function amazonFeedUpdateCron()\n {\n\n if (!wp_next_scheduled('update_amazonfeeds_hook')) {\n wp_schedule_event(time(), get_option('amwscp_feed_update_interval'), 'update_amazonfeeds_hook');\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets details about the chosen commodity on selected planet | function getMarketplaceDetail($planet_id, $commodity_id, $attribute) {
addToDebugLog("getMarketplaceDetail(): Function Entry - supplied parameters: Commodity ID: " . $commodity_id . ", Commodity attribute: " . $attribute);
// [0] marketplace_id
// [1] planet_id
// [2] commodity_id
// [3] commodity_unit_cost
// [4] commodity_units
$sql = "SELECT " . $attribute . " FROM startrade.marketplace WHERE commodity_id = '" . $commodity_id . "' AND planet_id = '" . $planet_id . "';";
addToDebugLog("getMarketplaceDetail(): Constructed query: " . $sql);
$result = search($sql);
$marketplace_detail = $result[0][0];
addToDebugLog("getMarketplaceDetail(): Commodity " . $commodity_id . "'s " . $attribute . " on planet " . $planet_id . ": " . $marketplace_detail);
return $marketplace_detail;
} | [
"function listar_commodity() {\r\n $result = $this->M_tblcommodities->get_all_Commodities();\r\n foreach ($result as $key => $value) {\r\n echo '<option id=\"optcom_' . $value[\"recn\"] . '\" data-commod=\"' . $value[\"name\"] . '\" value=\"' . $value[\"recn\"] . '\" >' . $value[\"name\"] . '</option>';\r\n }\r\n\r\n }",
"public static function get_rtk_commodities() {\n $commodities = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchAll(\"\nSELECT id, commodity_code, commodity_name, unit_of_issue FROM `rtk_commodities` order by id\");\n //$comm = array($commodities);\n }",
"function fetchCommodity(array &$form, FormStateInterface $form_state) \n {\n $vr_variety_id = $form_state->getValue('vr_variety');\n $commodity_options = array();\n if (!empty($vr_variety_id) && is_numeric($vr_variety_id)) {\n // Fetch Parents of selected variety.\n $storage = \\Drupal::service('entity_type.manager')->getStorage('taxonomy_term');\n $variety_parents = $storage->loadParents($vr_variety_id);\n foreach ($variety_parents as $term_id => $term) {\n $commodity_options[$term_id] = $term->getName();\n }\n foreach ($form['field_vr_fc_commodity']['widget'] as $index => $pc_item) {\n if (is_numeric($index)) {\n $form['field_vr_fc_commodity']['widget'][$index]['field_fc_commodity']['widget']['#default_value'] = array();\n $form['field_vr_fc_commodity']['widget'][$index]['field_fc_commodity']['widget']['#options'] = $commodity_options;\n }\n }\n } else {\n $commodity_options = redbook_pcl_custom_get_terms('commodity');\n foreach ($form['field_vr_fc_commodity']['widget'] as $index => $pc_item) {\n if (is_numeric($index)) {\n $form['field_vr_fc_commodity']['widget'][$index]['field_fc_commodity']['widget']['#options'] = $commodity_options;\n }\n }\n }\n return $form['field_vr_fc_commodity'];\n }",
"public function getPlanetName(){\n\t\treturn $this->planetName;\n\t}",
"public function getPriceInfo();",
"protected function planetSearch()\n\t{\n\t\t$sr = array(); $i = 0;\n\t\t$select = array(\n\t\t\t\"u.userid\", \"u.username\", \"u.usertitle\", \"u.points\", \"u.last as useractivity\", \"u.umode\", \"u.level\", \"u.hp\", \"b.to\",\n\t\t\t\"p.planetid\", \"p.planetname\", \"p.ismoon\",\n\t\t\t\"g.galaxy\", \"g.system\", \"g.position\",\n\t\t\t\"a.aid\", \"a.tag\", \"a.name\",\n\t\t\t\"gm.galaxy as moongala\", \"gm.system as moonsys\", \"gm.position as moonpos\"\n\t\t);\n\t\t$joins = \"LEFT JOIN \".PREFIX.\"user u ON (p.userid = u.userid)\";\n\t\t$joins .= \"LEFT JOIN \".PREFIX.\"galaxy g ON (g.planetid = p.planetid)\";\n\t\t$joins .= \"LEFT JOIN \".PREFIX.\"galaxy gm ON (gm.moonid = p.planetid)\";\n\t\t$joins .= \"LEFT JOIN \".PREFIX.\"user2ally u2a ON (u2a.userid = u.userid)\";\n\t\t$joins .= \"LEFT JOIN \".PREFIX.\"alliance a ON (a.aid = u2a.aid)\";\n\t\t$joins .= \"LEFT JOIN \".PREFIX.\"ban_u b ON (b.userid = u.userid)\";\n\t\t$result = Core::getQuery()->select(\"planet p\", $select, $joins, Core::getDB()->quoteInto(\"p.planetname LIKE ? AND u.username IS NOT NULL\", $this->searchItem->get()), \"p.planetname ASC, u.username ASC\", \"25\", \"u.userid\");\n\t\tforeach($result->fetchAll() as $row)\n\t\t{\n\t\t\t$sr[$i] = $row;\n\t\t\tif($row[\"planetid\"] == $row[\"hp\"])\n\t\t\t{\n\t\t\t\t$p_addition = \" (HP)\";\n\t\t\t}\n\t\t\telse if($row[\"ismoon\"])\n\t\t\t{\n\t\t\t\t$p_addition = \" (\".Core::getLanguage()->getItem(\"MOON\").\")\";\n\t\t\t}\n\t\t\telse { $p_addition = \"\"; }\n\t\t\t$sr[$i][\"planetname\"] = $row[\"planetname\"].$p_addition;\n\t\t\t$i++;\n\t\t}\n\t\t$result->closeCursor();\n\n\t\t$UserList = new Bengine_Game_User_List();\n\t\t$UserList->setByArray($sr);\n\t\tHook::event(\"SearchResultPlanet\", array($UserList));\n\t\tCore::getTPL()->addLoop(\"result\", $UserList->getArray());\n\t\tCore::getTPL()->addLoop(\"searchSuggestions\", $this->getSimilarWords($this->searchItem, \"planet\"));\n\t\t$this->setTemplate(\"search/player\");\n\t\treturn $this;\n\t}",
"public function getStocksInfo()\n {\n $this->add_model(array('Api.Companies'));\n $response = $this->Companies->getStocksInfo($this->request->getData('data'), $this->currentLanguage);\n if ($response) {\n $this->apiResponse['data'] = $response;\n } else {\n $this->apiResponse['error'] = 'Info Not Found';\n }\n\n\n }",
"public function getProductionCompany();",
"public function get_transport_infos($player_id) {\n $this->db->select(\"tm.id,tm.hexmap,tm.route_id,w.player_id,w.whtype,coalesce(x.pname,'Travelling') as pname\")\n ->select(\"coalesce(t.description,'Not on a route') as description\")\n ->from(\"transport_movements tm\")\n ->join(\"warehouses w\", \"tm.id = w.id\")\n ->join(\"places x\", \"x.hexmap = tm.hexmap\",\"left\")\n ->join(\"traderoutes t\",\"abs(tm.route_id) = t.id\",\"left\");\n if ($player_id) {\n $this->db->where(\"w.player_id\",$player_id);\n } else {\n //the admin can see the transport of everybody\n $this->db->select(\"p.fullname\")\n ->join(\"players p\", \"p.id = w.player_id\");\n }\n $data = $this->db->get()->result();\n //now collect the cargo info for every transport\n foreach($data as &$item) {\n $this->db->select(\"wg.id_good, wg.quantity, g.gname\")\n ->from(\"warehouses_goods wg\")\n ->join(\"goods g\", \"wg.id_good = g.id\")\n ->where(\"id_warehouse\", $item->id);\n $query = $this->db->get();\n if(!$item->goods = $query->result()) {\n $item->goods = \"Empty\";\n }\n }\n \n \n return $data;\n }",
"function get_city(){\n\t\t\treturn helper::select(\"*\",\"city\",\"1\");\n\t\t}",
"public function readAllPlanets();",
"public function market()\n {\n return $this->HosterAPI->get('datacenter/dedicated/market');\n }",
"public function cityAction() \n {\n $request = Request::getRequest();\n\n $citys = $this->product->getAllCitys();\n\n return $this->render->display(\"Settings/City/city_tab\", array(\n 'citys' => $citys\n ));\n }",
"public function get_single_designation_info(){ \n\n $designation = $this->corporate_model->get_designation_list_by_company_id('OBJECT', array('id', 'name', 'company_id'), array('id'=> $_GET['id']));\n echo json_encode($designation);\n }",
"private function extractPlanetInfo(): array\n {\n if (null === $this->planetInfo) {\n $className = get_class($this);\n $p = explode('\\\\', $className);\n $arr[] = array_shift($p); // galaxy\n $arr[] = array_shift($p); // planet\n $this->planetInfo = $arr;\n }\n return $this->planetInfo;\n }",
"public function getMarket(): string\n {\n }",
"public function getPlanets() {\n\t\treturn $this->planets;\n\t}",
"public function getCity();",
"public function loadPlanetsData(){\n if( !$this->dry() ){\n $data = self::getF3()->ccpClient()->getUniverseSystemData($this->_id);\n if($data['planets']){\n // planets are optional since ESI v4 (e.g. Abyssal systems)\n foreach((array)$data['planets'] as $planetData){\n /**\n * @var $planet PlanetModel\n */\n $planet = $this->rel('planets');\n $planet->loadById($planetData->planet_id);\n $planet->reset();\n }\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
__deleteProjectFileMessage deleting a project team message | function __deleteProjectFileMessage()
{
//profiling
$this->data['controller_profiling'][] = __function__;
//load the models that we will use
$this->load->model('file_messages_model');
$this->load->model('file_messages_replies_model');
//flow control
$next = true;
//get data
$id = $this->input->post('data_mysql_record_id');
//validate data
if ($next) {
if (!is_numeric($id)) {
$this->jsondata = array(
'result' => 'error',
'message' => $this->data['lang']['lang_request_could_not_be_completed'],
'debug_line' => __line__);
header('HTTP/1.0 400 Bad Request', true, 400);
//log this error
log_message('error', '[FILE: ' . __file__ . '] [FUNCTION: ' . __function__ . '] [LINE: ' . __line__ . "] [MESSAGE: Invalid post data]");
}
}
//delete the message
if ($next) {
if ($this->file_messages_model->deleteMessage($id, 'message-id')) {
//delete replies also
$this->file_messages_replies_model->deleteReply($id, 'message-id');
$this->data['debug'][] = $this->file_messages_replies_model->debug_data;
//success
$this->jsondata = array(
'result' => 'success',
'message' => $this->data['lang']['lang_request_has_been_completed'],
'debug_line' => __line__);
header('HTTP/1.0 200 OK', true, 200);
} else {
//error deleting message
$this->jsondata = array(
'result' => 'error',
'message' => $this->data['lang']['lang_request_could_not_be_completed'],
'debug_line' => __line__);
header('HTTP/1.0 400 Bad Request', true, 400);
//log this error
log_message('error', '[FILE: ' . __file__ . '] [FUNCTION: ' . __function__ . '] [LINE: ' . __line__ . "] [Deleting message failed: Database errror]");
}
//debug
$this->data['debug'][] = $this->file_messages_model->debug_data;
}
//log debug data
$this->__ajaxdebugging();
//load the view for json echo
$this->__flmView('common/json');
} | [
"public function deleteMessage()\n {\n }",
"public function deleteMessage()\n {\n $m = Message::get($this->m_id);\n\n $m->delete();\n\n global $conn;\n\n $sql = \"UPDATE `reports` SET `flags` = flags | (1 << 1) WHERE `r_id` = '\" . $conn->real_escape_string($this->r_id) . \"'\";\n $conn->query($sql);\n }",
"function delete_project($token) {\n send(501, ['error' => 'Not yet implemented']);\n}",
"function deleteFileAfterMessageSent( $message_id = 0, $postData ) {\n\t\t$message_id = (int)$message_id;\n\t\t// initialize the database\n\t\t$db = JFactory::getDBO();\n\t\t// import joomla clases to manage file system\n\t\tjimport('joomla.filesystem.path');\n\t\tjimport('joomla.filesystem.file');\n\t\t// get the path to attachments upload\n\t\t$upload_folder = str_replace('\\\\',DS,$this->_config_values['upload_attachments']);\n\t\t$upload_folder = str_replace('/',DS,$upload_folder);\n\t\t$upload_folder = str_replace('\',DS,$upload_folder);\n\t\t$path_upload = JPATH_ROOT.DS.$upload_folder;\n\t\t// get the files to delete\n\t\t$query = 'SELECT id, name FROM #__aicontactsafe_messagefiles WHERE message_id = '.$message_id.' and r_id = '.$postData['r_id'];\n\t\t$db->setQuery($query);\n\t\t$files = $db->loadObjectList();\n\t\tif (count($files) > 0) {\n\t\t\tforeach($files as $file) {\n\t\t\t\t$delete_file = $path_upload.DS.$file->name;\n\t\t\t\tJFile::delete($delete_file);\n\t\t\t\t$query = 'DELETE FROM #__aicontactsafe_messagefiles WHERE id = '.$file->id;\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$db->query();\n\t\t\t}\n\t\t}\n\t}",
"public function deleteproject()\n\n\t{\n\n\t}",
"public function testDeleteMessage()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"private function _delete(){\n// $lastProject = new LastProjects($this->_user_id);\n// if($lastProject->isA($this->_project_id)) $lastProject->remove();\n// // Delete as pending project if it is in the list\n// $pendingProject = new PendingProjects($this->_project_id, $this->_user_id);\n// $isAPendingProject = $pendingProject->isA();\n// if($isAPendingProject){\n// $pendingProject->cancel();\n// $pendingProject->remove();\n// }\n// // Delete project from the database\n// if(@$stmt = $this->mysqli->prepare('DELETE FROM projects WHERE user_id = ? AND project_id = ?')){\n// $stmt->bind_param('ii', $this->_user_id, $this->_project_id);\n// $stmt->execute();\n// $stmt->store_result();\n// if($stmt->affected_rows == 1){\n// // Delete the project files\n// if(!(new FileManager($this->_project_id))->self_destruct())\n// error_log(\"Couldn't delete project folder or it doesn't exist!\");\n// }else return self::PROJECT_DOES_NOT_EXIST;\n// }\n }",
"public static function eF_deletePersonalMessage($msg_id) {\n if (eF_checkParameter($msg_id, 'id')) {\n $res = eF_getTableData(\"f_personal_messages\", \"users_LOGIN, attachments, f_folders_ID\", \"id=\".$msg_id);\n if ($_SESSION['s_login'] == $res[0]['users_LOGIN'] || $_SESSION['s_type'] == 'administrator') {\n eF_deleteTableData(\"f_personal_messages\", \"id=\".$msg_id);\n if ($res[0]['attachments'] != '') {\n $attached_file = new EfrontFile($res[0]['attachments']);\n $attached_file -> delete();\n }\n return true;\n } else {\n $message = 'You cannot delete this message';\n return $message;\n }\n } else {\n $message = _INVALIDID;\n return $message;\n }\n }",
"public function testDeleteMessage()\n {\n $this->markTestIncomplete(\n 'Test of \"deleteMessage\" method has not been implemented yet.'\n );\n }",
"function drush_btranslator_btr_project_delete() {\n $origin = drush_get_option('origin');\n $project = drush_get_option('project');\n _btranslator_drush_check_params($origin, $project);\n\n $erase = drush_get_option('erase');\n $erase = ($erase == 'false' ? FALSE : TRUE);\n\n $purge = drush_get_option('purge');\n $purge = ($purge == 'false' ? FALSE : TRUE);\n\n btr::project_del($origin, $project, $erase, $purge);\n}",
"public function deleteMessages(): void\n {\n $this->messages()->delete();\n }",
"public function testMessagesDelete()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function delete($project);",
"protected function deleteMessage( $message ) {\n\t\tPendingDatabase::get()\n\t\t\t->deleteMessage( $message );\n\t}",
"public function deleting(ContactMessage $contact)\n {\n //\n }",
"public function delete() {\r\n\t\tImperator::getDatabaseManager()->getChatTable()->deleteMessage($this);\r\n\t}",
"function projectDelete($project_id){\r\n\t\t$method='project.delete';\r\n\t\t$tags=array(\r\n\t\t\t'project_id'=>$project_id\r\n\t\t);\r\n\t\t$response=$this->prepare_xml($method,$tags);\r\n\t\t$obj=$this->xml_obj($response);\r\n\t\treturn $obj;\r\n\t}",
"protected function deleteProtocolFile() {}",
"public function removechatfile($file_id){\n $this->autoRender = false;\n $this->loadModel(\"Workroom\") ;\n $model = new Workroom();\n $model->query(\"DELETE FROM workroom_chat_files WHERE id='{$file_id}' AND user_id ='\".$this->Auth->user(\"id\").\"' \");\n echo \"file _remoed \" ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process a post and update $postsPerMonth and $postsPerWeek. | public function addPost(Post $post) {
$month = $post->getMonth();
if (!isset($this->postsPerMonth[$month])) {
$this->postsPerMonth[$month] = new MonthlyStats($month);
}
$monthlyStats = $this->postsPerMonth[$month];
$monthlyStats->addPost($post);
$week = $post->getWeek();
if (!isset($this->postsPerWeek[$week])) {
$this->postsPerWeek[$week] = 1;
} else {
$this->postsPerWeek[$week]++;
}
} | [
"private function calcAvgPostCountPerUserByMonth(object $post): void\n {\n if (!array_key_exists($post->from_id, $this->statAvgPostCountPerUserByMonth)) {\n $this->statAvgPostCountPerUserByMonth[$post->from_id] = [];\n }\n if (!array_key_exists($post->month, $this->statAvgPostCountPerUserByMonth[$post->from_id])) {\n $this->statAvgPostCountPerUserByMonth[$post->from_id][$post->month] = 0;\n }\n\n $this->statAvgPostCountPerUserByMonth[$post->from_id][$post->month]++;\n }",
"public function addPostToCalculator(Post $post): void\n {\n try {\n\n $postInf = (object)[\n 'id' => $post->id,\n 'from_id' => $post->from_id,\n 'message_length' => mb_strlen($post->message),\n 'month' => (new DateTime($post->created_time))->format('y-m'),\n 'week' => (new DateTime($post->created_time))->format('y-W'),\n ];\n\n } catch (Exception) {\n\n throw new RuntimeException('Error format post fields.');\n }\n\n $this->postsCount++;\n $this->calcSumPostsLengthByMonth($postInf);\n $this->calcLongestPostsByMonth($postInf);\n $this->calcTotalPostCountByWeek($postInf);\n $this->calcAvgPostCountPerUserByMonth($postInf);\n }",
"public function getTotalPostPerWeek(){\n $sql = \"SELECT\n strftime('%W', datetime(post.created, 'unixepoch')) as week,\n count(post.text) as post_count\n FROM\n post \n GROUP BY\n strftime('%W', datetime(post.created, 'unixepoch'))\";\n\n $conn = $this->entityManager->getConnection();\n $stmt = $conn->prepare($sql);\n $stmt->execute();\n\n return\n $stmt->fetchAll();\n }",
"public static function analyze($posts)\n\t{\n\t\t$result = [\n\t\t\t'a' => [\n\t\t\t\t'info' => \"Average character length of posts per month. Data keys: 'year-month' (ISO 8601)\",\n\t\t\t\t'data' => [],\n\t\t\t],\n\t\t\t'b' => [\n\t\t\t\t'info' => \"Longest post by character length per month. Data keys: 'year-month' (ISO 8601)\",\n\t\t\t\t'data' => [],\n\t\t\t],\n\t\t\t'c' => [\n\t\t\t\t'info' => \"Total posts split by week number. Data keys: 'year\\Wweek' (ISO 8601)\",\n\t\t\t\t'data' => [],\n\t\t\t],\n\t\t\t'd' => [\n\t\t\t\t'info' => \"Average number of posts per user per month. Data keys: 'user_id'\",\n\t\t\t\t'data' => [],\n\t\t\t\t'average' => 0.00, //I'm not sure if the task asks for this number only or for individual averages as well, so I'm computing both\n\t\t\t],\n\t\t];\n\t\t\n\t\t$earliest_post = PHP_INT_MAX;\n\t\t$latest_post = 0;\n\t\t\n\t\tforeach ($posts as $post)\n\t\t{\n\t\t\t$uid = $post['from_id'];\n\t\t\t$len = mb_strlen($post['message'], self::ENCODING);\n\t\n\t\t\t$ts = strtotime($post['created_time']);\n\t\t\t$week = date('o\\WW',$ts); //ISO 8601 Year+Week\n\t\t\t$month = date('Y-m',$ts); //ISO 8601 Year+Month\n\t\n\t\t\tif ($ts < $earliest_post)\n\t\t\t\t$earliest_post = $ts;\n\t\t\tif ($ts > $latest_post)\n\t\t\t\t$latest_post = $ts;\n\t\n\t\t\tif (!array_key_exists($month,$result['a']['data']))\n\t\t\t\t$result['a']['data'][$month] = [$len];\n\t\t\telse\n\t\t\t\t$result['a']['data'][$month][] = $len;\n\t\n\t\t\tif (!array_key_exists($month,$result['b']['data']))\n\t\t\t\t$result['b']['data'][$month] = ['id'=>$post['id'],'max_length'=>$len];\n\t\t\telseif ($len > $result['b']['data'][$month]['max_length'])\n\t\t\t\t$result['b']['data'][$month] = ['id'=>$post['id'],'max_length'=>$len];\n\t\n\t\t\tif (!array_key_exists($week,$result['c']['data']))\n\t\t\t\t$result['c']['data'][$week] = 1;\n\t\t\telse\n\t\t\t\t$result['c']['data'][$week]++;\n\t\n\t\t\tif (!array_key_exists($uid,$result['d']['data']))\n\t\t\t\t$result['d']['data'][$uid] = 1;\n\t\t\telse\n\t\t\t\t$result['d']['data'][$uid]++;\n\t\t}\n\t\t\n\t\t//only need averages for any month with at least 1 post\n\t\tforeach ($result['a']['data'] as &$values)\n\t\t\t$values = sprintf(self::AVERAGE_FORMAT,array_sum($values)/count($values));\n\t\t\n\t\t/*\n\t\t\tThis is tricky. Task says \"1000 posts over a six month period\". But what if we get 1000 posts within last month only? \n\t\t\tHard-coding 6 seems to be too optimistic, so instead we record the earliest post and the latest post from the feed.\n\t\t\tThen we calculate an approximate (and decimal) number of months between two timestamps ($months).\n\t\t\tSo then we divide number or posts by $months.\n\t\t\t(during development I got data feed that led to $months being slightly greater than 6.2)\n\t\t\tThis way this metrics depends on data only, not on an external promise.\n\t\t*/\n\t\t\n\t\t$months = ($latest_post - $earliest_post)/2628288;\n\t\tforeach ($result['d']['data'] as &$value)\n\t\t\t$value = sprintf(self::AVERAGE_FORMAT,$value/$months);\n\t\tksort($result['d']['data']); //no real need to do it, but it looks nicer this way\n\t\t$result['d']['average'] = sprintf(self::AVERAGE_FORMAT,array_sum($result['d']['data'])/count($result['d']['data']));\n\t\t\n\t\treturn $result;\n\t}",
"private function update_post_views() {\n\t\t\n\t\t//Init vars\n\t\tglobal $post;\n\t\t$count_meta_key = '_prso_theme_view_count';\n\t\t$count\t\t\t= NULL;\n\t\t\n\t\tif( isset($post->ID) && !is_admin() && !is_front_page() && !is_home() && !is_user_logged_in() ) {\n\t\t\t\n\t\t\t$count = get_post_meta( $post->ID, $count_meta_key, TRUE );\n\t\t\t\n\t\t\tif( empty($count) ) {\n\t\t\t\t\n\t\t\t\t$count = 1;\n\t\t\t\t\n\t\t\t\t//Ensure old meta value is deleted - just incase\n\t\t\t\t//delete_post_meta( $post->ID, $count_meta_key );\n\t\t\t\t\n\t\t\t\t//Add our new zeroed count\n\t\t\t\tupdate_post_meta( $post->ID, $count_meta_key, $count );\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//Sanitize count var\n\t\t\t\t$count = (int) $count;\n\t\t\t\t\n\t\t\t\t//Increase by 1\n\t\t\t\t$count++;\n\t\t\t\t\n\t\t\t\t//Update our meta value for the post\n\t\t\t\tupdate_post_meta( $post->ID, $count_meta_key, $count );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"function process_posts() {\n\t\t$this->posts = apply_filters( 'wp_import_posts', $this->posts );\n\n\t\tforeach ( $this->posts as $post ) {\n\t\t\t$this->counting();\n\t\t\t$post = apply_filters( 'wp_import_post_data_raw', $post );\n\n\t\t\tif ( ! post_type_exists( $post['post_type'] ) ) {\n\t\t\t\t$this->log( 'Failed to import : ' . esc_html($post['post_title']) . ' (Invalid post type ' . esc_html($post['post_type']) . ')', '' );\n\t\t\t\tdo_action( 'wp_import_post_exists', $post );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( isset( $this->processed_posts[$post['post_id']] ) && ! empty( $post['post_id'] ) ){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $post['status'] == 'auto-draft' ){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( 'nav_menu_item' == $post['post_type'] ) {\n\t\t\t\t$this->process_menu_item( $post );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$post_type_object = get_post_type_object( $post['post_type'] );\n\n\t\t\t$post_exists = post_exists( $post['post_title'], '', $post['post_date'] );\n\t\t\tif ( $post_exists && get_post_type( $post_exists ) == $post['post_type'] ) {\n\t\t\t\t$this->log( 'Already exists ' . esc_html( $post['post_type'] ) . ' : ' . esc_attr ( $post['post_title'] ), '' );\n\t\t\t\t$comment_post_ID = $post_id = $post_exists;\n\t\t\t} else {\n\t\t\t\t$post_parent = (int) $post['post_parent'];\n\t\t\t\tif ( $post_parent ) {\n\t\t\t\t\t// if we already know the parent, map it to the new local ID\n\t\t\t\t\tif ( isset( $this->processed_posts[$post_parent] ) ) {\n\t\t\t\t\t\t$post_parent = $this->processed_posts[$post_parent];\n\t\t\t\t\t// otherwise record the parent for later\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->post_orphans[intval($post['post_id'])] = $post_parent;\n\t\t\t\t\t\t$post_parent = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$author = (int) get_current_user_id();\n\n\t\t\t\t$postdata = array(\n\t\t\t\t\t'import_id' => $post['post_id'], 'post_author' => $author, 'post_date' => $post['post_date'],\n\t\t\t\t\t'post_date_gmt' => $post['post_date_gmt'], 'post_content' => $post['post_content'],\n\t\t\t\t\t'post_excerpt' => $post['post_excerpt'], 'post_title' => $post['post_title'],\n\t\t\t\t\t'post_status' => $post['status'], 'post_name' => $post['post_name'],\n\t\t\t\t\t'comment_status' => $post['comment_status'], 'ping_status' => $post['ping_status'],\n\t\t\t\t\t'guid' => $post['guid'], 'post_parent' => $post_parent, 'menu_order' => $post['menu_order'],\n\t\t\t\t\t'post_type' => $post['post_type'], 'post_password' => $post['post_password']\n\t\t\t\t);\n\n\t\t\t\t$original_post_ID = $post['post_id'];\n\t\t\t\t$postdata = apply_filters( 'wp_import_post_data_processed', $postdata, $post );\n\n\t\t\t\tif ( 'attachment' == $postdata['post_type'] ) {\n\t\t\t\t\t$remote_url = ! empty($post['attachment_url']) ? $post['attachment_url'] : $post['guid'];\n\n\t\t\t\t\t// try to use _wp_attached file for upload folder placement to ensure the same location as the export site\n\t\t\t\t\t// e.g. location is 2003/05/image.jpg but the attachment post_date is 2010/09, see media_handle_upload()\n\t\t\t\t\t$postdata['upload_date'] = $post['post_date'];\n\t\t\t\t\tif ( isset( $post['postmeta'] ) ) {\n\t\t\t\t\t\tforeach( $post['postmeta'] as $meta ) {\n\t\t\t\t\t\t\tif ( $meta['key'] == '_wp_attached_file' ) {\n\t\t\t\t\t\t\t\tif ( preg_match( '%^[0-9]{4}/[0-9]{2}%', $meta['value'], $matches ) )\n\t\t\t\t\t\t\t\t\t$postdata['upload_date'] = $matches[0];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$comment_post_ID = $post_id = $this->process_attachment( $postdata, $remote_url );\n\t\t\t\t} else {\n\t\t\t\t\t$comment_post_ID = $post_id = wp_insert_post( $postdata, true );\n\t\t\t\t\tdo_action( 'wp_import_insert_post', $post_id, $original_post_ID, $postdata, $post );\n\t\t\t\t\t$this->log( 'Add ' . esc_html( $post['post_type'] ) . ' : ' . esc_html( $post['post_title'] ), '' );\n\t\t\t\t}\n\n\t\t\t\tif ( is_wp_error( $post_id ) ) {\n\t\t\t\t\t$this->log( 'Failed to import ' . $post_type_object->labels->singular_name . ' : ' . esc_html($post['post_title']), '' );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( $post['is_sticky'] == 1 )\n\t\t\t\t\tstick_post( $post_id );\n\t\t\t}\n\n\t\t\t// map pre-import ID to local ID\n\t\t\t$this->processed_posts[intval($post['post_id'])] = (int) $post_id;\n\n\t\t\tif ( ! isset( $post['terms'] ) )\n\t\t\t\t$post['terms'] = array();\n\n\t\t\t$post['terms'] = apply_filters( 'wp_import_post_terms', $post['terms'], $post_id, $post );\n\n\t\t\t// add categories, tags and other terms\n\t\t\tif ( ! empty( $post['terms'] ) ) {\n\t\t\t\t$terms_to_set = array();\n\t\t\t\tforeach ( $post['terms'] as $term ) {\n\t\t\t\t\t// back compat with WXR 1.0 map 'tag' to 'post_tag'\n\t\t\t\t\t$taxonomy = ( 'tag' == $term['domain'] ) ? 'post_tag' : $term['domain'];\n\t\t\t\t\t$term_exists = term_exists( $term['slug'], $taxonomy );\n\t\t\t\t\t$term_id = is_array( $term_exists ) ? $term_exists['term_id'] : $term_exists;\n\t\t\t\t\tif ( ! $term_id ) {\n\t\t\t\t\t\t$t = wp_insert_term( $term['name'], $taxonomy, array( 'slug' => $term['slug'] ) );\n\t\t\t\t\t\tif ( ! is_wp_error( $t ) ) {\n\t\t\t\t\t\t\t$term_id = $t['term_id'];\n\t\t\t\t\t\t\tdo_action( 'wp_import_insert_term', $t, $term, $post_id, $post );\n\t\t\t\t\t\t\t$this->log( 'Add Terms : ' . esc_html($taxonomy). ' ' . esc_attr ( $term['name'] ), '' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->log( 'Failed to import ' . esc_html($taxonomy) . ' : ' . esc_html($term['name']), '' );\n\t\t\t\t\t\t\tdo_action( 'wp_import_insert_term_failed', $t, $term, $post_id, $post );\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$terms_to_set[$taxonomy][] = intval( $term_id );\n\t\t\t\t}\n\n\t\t\t\tforeach ( $terms_to_set as $tax => $ids ) {\n\t\t\t\t\t$tt_ids = wp_set_post_terms( $post_id, $ids, $tax );\n\t\t\t\t\tdo_action( 'wp_import_set_post_terms', $tt_ids, $ids, $tax, $post_id, $post );\n\t\t\t\t}\n\t\t\t\tunset( $post['terms'], $terms_to_set );\n\t\t\t}\n\n\t\t\tif ( ! isset( $post['comments'] ) )\n\t\t\t\t$post['comments'] = array();\n\n\t\t\t$post['comments'] = apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post );\n\n\t\t\t// add/update comments\n\t\t\tif ( ! empty( $post['comments'] ) ) {\n\t\t\t\t$num_comments = 0;\n\t\t\t\t$inserted_comments = array();\n\t\t\t\tforeach ( $post['comments'] as $comment ) {\n\t\t\t\t\t$comment_id\t= $comment['comment_id'];\n\t\t\t\t\t$newcomments[$comment_id]['comment_post_ID'] = $comment_post_ID;\n\t\t\t\t\t$newcomments[$comment_id]['comment_author'] = $comment['comment_author'];\n\t\t\t\t\t$newcomments[$comment_id]['comment_author_email'] = $comment['comment_author_email'];\n\t\t\t\t\t$newcomments[$comment_id]['comment_author_IP'] = $comment['comment_author_IP'];\n\t\t\t\t\t$newcomments[$comment_id]['comment_author_url'] = $comment['comment_author_url'];\n\t\t\t\t\t$newcomments[$comment_id]['comment_date'] = $comment['comment_date'];\n\t\t\t\t\t$newcomments[$comment_id]['comment_date_gmt'] = $comment['comment_date_gmt'];\n\t\t\t\t\t$newcomments[$comment_id]['comment_content'] = $comment['comment_content'];\n\t\t\t\t\t$newcomments[$comment_id]['comment_approved'] = $comment['comment_approved'];\n\t\t\t\t\t$newcomments[$comment_id]['comment_type'] = $comment['comment_type'];\n\t\t\t\t\t$newcomments[$comment_id]['comment_parent'] \t = $comment['comment_parent'];\n\t\t\t\t\t$newcomments[$comment_id]['commentmeta'] = isset( $comment['commentmeta'] ) ? $comment['commentmeta'] : array();\n\t\t\t\t\tif ( isset( $this->processed_authors[$comment['comment_user_id']] ) )\n\t\t\t\t\t\t$newcomments[$comment_id]['user_id'] = $this->processed_authors[$comment['comment_user_id']];\n\t\t\t\t}\n\t\t\t\tksort( $newcomments );\n\n\t\t\t\tforeach ( $newcomments as $key => $comment ) {\n\t\t\t\t\t// if this is a new post we can skip the comment_exists() check\n\t\t\t\t\tif ( ! $post_exists || ! comment_exists( $comment['comment_author'], $comment['comment_date'] ) ) {\n\t\t\t\t\t\tif ( isset( $inserted_comments[$comment['comment_parent']] ) )\n\t\t\t\t\t\t\t$comment['comment_parent'] = $inserted_comments[$comment['comment_parent']];\n\t\t\t\t\t\t$comment = wp_filter_comment( $comment );\n\t\t\t\t\t\t$inserted_comments[$key] = wp_insert_comment( $comment );\n\t\t\t\t\t\tdo_action( 'wp_import_insert_comment', $inserted_comments[$key], $comment, $comment_post_ID, $post );\n\n\t\t\t\t\t\tforeach( $comment['commentmeta'] as $meta ) {\n\t\t\t\t\t\t\t$value = maybe_unserialize( $meta['value'] );\n\t\t\t\t\t\t\tadd_comment_meta( $inserted_comments[$key], $meta['key'], $value );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$num_comments++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tunset( $newcomments, $inserted_comments, $post['comments'] );\n\t\t\t}\n\n\t\t\tif ( ! isset( $post['postmeta'] ) )\n\t\t\t\t$post['postmeta'] = array();\n\n\t\t\t$post['postmeta'] = apply_filters( 'wp_import_post_meta', $post['postmeta'], $post_id, $post );\n\n\t\t\t// add/update post meta\n\t\t\tif ( ! empty( $post['postmeta'] ) ) {\n\t\t\t\tforeach ( $post['postmeta'] as $meta ) {\n\t\t\t\t\t$key = apply_filters( 'import_post_meta_key', $meta['key'], $post_id, $post );\n\t\t\t\t\t$value = false;\n\n\t\t\t\t\tif ( '_edit_last' == $key ) {\n\t\t\t\t\t\tif ( isset( $this->processed_authors[intval($meta['value'])] ) )\n\t\t\t\t\t\t\t$value = $this->processed_authors[intval($meta['value'])];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$key = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $key ) {\n\t\t\t\t\t\t// export gets meta straight from the DB so could have a serialized string\n\t\t\t\t\t\tif ( ! $value )\n\t\t\t\t\t\t\t$value = maybe_unserialize( $meta['value'] );\n\t\t\t\t\t\tadd_post_meta( $post_id, $key, $value );\n\t\t\t\t\t\tdo_action( 'import_post_meta', $post_id, $key, $value );\n\n\t\t\t\t\t\t// if the post has a featured image, take note of this in case of remap\n\t\t\t\t\t\tif ( '_thumbnail_id' == $key )\n\t\t\t\t\t\t\t$this->featured_images[$post_id] = (int) $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tunset( $this->posts );\n\t}",
"function count_total_post($posts) {\n // Construct weekdata\n $week_data = $this->construct_data($posts, 'week');\n\n // Count total\n foreach ($week_data as $posts) {\n $count = count(array_keys($posts));\n $week = date('WY', strtotime($posts[0]->created_time));\n $total[$week] = $count;\n }\n return $total;\n }",
"function handle_publish_post($post_id) {\r\n\r\n \t// Get Post Score stored in Cache\r\n \t$post_score = WPPostsRateKeys_Central::get_score($post_id);\r\n\r\n \t// Getting Settings\r\n \t$settings = WPPostsRateKeys_Settings::get_options();\r\n \t$minimun_score = $settings['minimum_score_to_publish'];\r\n\r\n \t// Only compare if is some value specified and if Post has Keyword\r\n \tif (trim($minimun_score)!='' && WPPostsRateKeys_WPPosts::get_keyword($post_id)!='') {\r\n \t\tif ($post_score<$minimun_score) {\r\n \t\t\t// Set as Draft\r\n \t\t\twp_update_post(array('ID'=>$post_id,'post_status'=>'draft'));\r\n \t\t}\r\n \t}\r\n }",
"public function updatePosts();",
"function posts( $formatters ) {\n\tglobal $wpdb;\n\t$posts_query = \"SELECT * FROM $wpdb->posts where post_type in ( 'post', 'page' )\";\n\t$posts = new Query( $posts_query );\n\twhile ( $posts->valid() ) {\n\t\t$original_post = (array) $posts->current();\n\t\t$modified_post = (array) $posts->current();\n\n\t\tforeach( $formatters['posts'] as $column => $formatter ) {\n\t\t\t$modified_post = apply_filters( 'wp_hammer_run_formatter_filter_posts_' . $column, $modified_post, $formatter );\n\t\t}\n\n\t\t$modified = array_diff( $modified_post, $original_post ) ;\n\n\t\tif ( count( $modified ) ) {\n\t\t\t\\WP_CLI::line( \"Making change to post {$original_post[ 'ID' ]} to contain \" . json_encode( $modified ) );\n\t\t\t$wpdb->update(\n\t\t\t\t\"$wpdb->posts\",\n\t\t\t\t$modified,\n\t\t\t\tarray( 'ID' => $original_post[ 'ID' ] ),\n\t\t\t\t'%s',\n\t\t\t\t'%d'\n\t\t\t);\n\t\t}\n\t\t$posts->next();\n\t}\n}",
"public function process_posts() {\n foreach ( $this->posts as $post ) {\n $post = apply_filters( 'wp_import_post_data_raw', $post );\n\n if ( ! post_type_exists( $post['post_type'] ) ) {\n // translators: 1: post title, 2: post type\n printf( __( 'Failed to import “%1$s”: Invalid post type %2$s', 'dokan' ), esc_html( $post['post_title'] ), esc_html( $post['post_type'] ) );\n echo '<br />';\n do_action( 'wp_import_post_exists', $post );\n continue;\n }\n\n if ( isset( $this->processed_posts[ $post['post_id'] ] ) && ! empty( $post['post_id'] ) ) {\n continue;\n }\n\n if ( 'auto-draft' === $post['status'] ) {\n continue;\n }\n\n $post_type_object = get_post_type_object( $post['post_type'] );\n\n $post_exists = $this->post_exists( $post['post_title'], '', $post['post_date'] );\n\n if ( $post_exists && get_post_type( $post_exists ) === $post['post_type'] ) {\n // translators: 1: singular label name, 2: post title\n printf( __( '%1$s “%2$s” already exists.', 'dokan' ), $post_type_object->labels->singular_name, esc_html( $post['post_title'] ) );\n echo '<br />';\n $post_id = $post_exists;\n $comment_post_id = $post_id;\n } else {\n $post_parent = (int) $post['post_parent'];\n\n if ( $post_parent ) {\n // if we already know the parent, map it to the new local ID\n if ( isset( $this->processed_posts[ $post_parent ] ) ) {\n $post_parent = $this->processed_posts[ $post_parent ];\n // otherwise record the parent for later\n } else {\n $this->post_orphans[ intval( $post['post_id'] ) ] = $post_parent;\n $post_parent = 0;\n }\n }\n\n $author = (int) get_current_user_id();\n\n if ( 'product_variation' === $post['post_type'] ) {\n $post_status = $post['status'];\n } else {\n $post_status = ( 'publish' === $post['status'] ) ? dokan_get_option( 'product_status', 'dokan_selling' ) : $post['status'];\n }\n\n $postdata = [\n 'import_id' => $post['post_id'],\n 'post_author' => $author,\n 'post_date' => $post['post_date'],\n 'post_date_gmt' => $post['post_date_gmt'],\n 'post_content' => $post['post_content'],\n 'post_excerpt' => $post['post_excerpt'],\n 'post_title' => $post['post_title'],\n 'post_status' => $post_status,\n 'post_name' => $post['post_name'],\n 'comment_status' => $post['comment_status'],\n 'ping_status' => $post['ping_status'],\n 'guid' => $post['guid'],\n 'post_parent' => $post_parent,\n 'menu_order' => $post['menu_order'],\n 'post_type' => $post['post_type'],\n 'post_password' => $post['post_password'],\n ];\n\n $original_post_id = $post['post_id'];\n $postdata = apply_filters( 'wp_import_post_data_processed', $postdata, $post );\n\n if ( 'attachment' === $postdata['post_type'] ) {\n $remote_url = ! empty( $post['attachment_url'] ) ? $post['attachment_url'] : $post['guid'];\n\n // try to use _wp_attached file for upload folder placement to ensure the same location as the export site\n // e.g. location is 2003/05/image.jpg but the attachment post_date is 2010/09, see media_handle_upload()\n $postdata['upload_date'] = $post['post_date'];\n\n if ( isset( $post['postmeta'] ) ) {\n foreach ( $post['postmeta'] as $meta ) {\n if ( '_wp_attached_file' === $meta['key'] ) {\n if ( preg_match( '%^[0-9]{4}/[0-9]{2}%', $meta['value'], $matches ) ) {\n $postdata['upload_date'] = $matches[0];\n }\n break;\n }\n }\n }\n\n $post_id = $this->process_attachment( $postdata, $remote_url );\n $comment_post_id = $post_id;\n } else {\n $post_id = wp_insert_post( $postdata, true );\n $comment_post_id = $post_id;\n do_action( 'wp_import_insert_post', $post_id, $original_post_id, $postdata, $post );\n }\n\n if ( is_wp_error( $post_id ) ) {\n // translators: 1: singular label name, 2: post title\n printf( __( 'Failed to import %1$s “%2$s”', 'dokan' ), $post_type_object->labels->singular_name, esc_html( $post['post_title'] ) );\n\n if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {\n echo ': ' . $post_id->get_error_message();\n }\n echo '<br />';\n continue;\n }\n\n if ( $post['is_sticky'] === 1 ) {\n stick_post( $post_id );\n }\n }\n\n // map pre-import ID to local ID\n $this->processed_posts[ intval( $post['post_id'] ) ] = (int) $post_id;\n\n if ( ! isset( $post['terms'] ) ) {\n $post['terms'] = [];\n }\n\n $post['terms'] = apply_filters( 'wp_import_post_terms', $post['terms'], $post_id, $post );\n\n // add categories, tags and other terms\n if ( ! empty( $post['terms'] ) ) {\n $terms_to_set = [];\n\n foreach ( $post['terms'] as $term ) {\n // back compat with WXR 1.0 map 'tag' to 'post_tag'\n $taxonomy = ( 'tag' === $term['domain'] ) ? 'post_tag' : $term['domain'];\n $term_exists = term_exists( $term['slug'], $taxonomy );\n $term_id = is_array( $term_exists ) ? $term_exists['term_id'] : $term_exists;\n\n if ( ! $term_id ) {\n $t = wp_insert_term( $term['name'], $taxonomy, [ 'slug' => $term['slug'] ] );\n\n if ( ! is_wp_error( $t ) ) {\n $term_id = $t['term_id'];\n do_action( 'wp_import_insert_term', $t, $term, $post_id, $post );\n } else {\n // translators: 1: taxonomy name, 2: term name\n printf( __( 'Failed to import %1$s %2$s', 'dokan' ), esc_html( $taxonomy ), esc_html( $term['name'] ) );\n\n if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {\n echo ': ' . $t->get_error_message();\n }\n echo '<br />';\n do_action( 'wp_import_insert_term_failed', $t, $term, $post_id, $post );\n continue;\n }\n }\n $terms_to_set[ $taxonomy ][] = intval( $term_id );\n }\n\n foreach ( $terms_to_set as $tax => $ids ) {\n $tt_ids = wp_set_post_terms( $post_id, $ids, $tax );\n do_action( 'wp_import_set_post_terms', $tt_ids, $ids, $tax, $post_id, $post );\n }\n unset( $post['terms'], $terms_to_set );\n }\n\n if ( ! isset( $post['comments'] ) ) {\n $post['comments'] = [];\n }\n\n $post['comments'] = apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post );\n\n // add/update comments\n if ( ! empty( $post['comments'] ) ) {\n $num_comments = 0;\n $inserted_comments = [];\n\n foreach ( $post['comments'] as $comment ) {\n $comment_id = $comment['comment_id'];\n $newcomments[ $comment_id ]['comment_post_ID'] = $comment_post_id;\n $newcomments[ $comment_id ]['comment_author'] = $comment['comment_author'];\n $newcomments[ $comment_id ]['comment_author_email'] = $comment['comment_author_email'];\n $newcomments[ $comment_id ]['comment_author_IP'] = $comment['comment_author_IP'];\n $newcomments[ $comment_id ]['comment_author_url'] = $comment['comment_author_url'];\n $newcomments[ $comment_id ]['comment_date'] = $comment['comment_date'];\n $newcomments[ $comment_id ]['comment_date_gmt'] = $comment['comment_date_gmt'];\n $newcomments[ $comment_id ]['comment_content'] = $comment['comment_content'];\n $newcomments[ $comment_id ]['comment_approved'] = $comment['comment_approved'];\n $newcomments[ $comment_id ]['comment_type'] = $comment['comment_type'];\n $newcomments[ $comment_id ]['comment_parent'] = $comment['comment_parent'];\n $newcomments[ $comment_id ]['commentmeta'] = isset( $comment['commentmeta'] ) ? $comment['commentmeta'] : [];\n\n if ( isset( $this->processed_authors[ $comment['comment_user_id'] ] ) ) {\n $newcomments[ $comment_id ]['user_id'] = $this->processed_authors[ $comment['comment_user_id'] ];\n }\n }\n ksort( $newcomments );\n\n foreach ( $newcomments as $key => $comment ) {\n // if this is a new post we can skip the comment_exists() check\n if ( ! $post_exists || ! $this->comment_exists( $comment['comment_author'], $comment['comment_date'] ) ) {\n if ( isset( $inserted_comments[ $comment['comment_parent'] ] ) ) {\n $comment['comment_parent'] = $inserted_comments[ $comment['comment_parent'] ];\n }\n $comment = wp_filter_comment( $comment );\n $inserted_comments[ $key ] = wp_insert_comment( $comment );\n do_action( 'wp_import_insert_comment', $inserted_comments[ $key ], $comment, $comment_post_id, $post );\n\n foreach ( $comment['commentmeta'] as $meta ) {\n $value = maybe_unserialize( $meta['value'] );\n add_comment_meta( $inserted_comments[ $key ], $meta['key'], $value );\n }\n\n $num_comments++;\n }\n }\n unset( $newcomments, $inserted_comments, $post['comments'] );\n }\n\n if ( ! isset( $post['postmeta'] ) ) {\n $post['postmeta'] = [];\n }\n\n $post['postmeta'] = apply_filters( 'wp_import_post_meta', $post['postmeta'], $post_id, $post );\n\n // add/update post meta\n if ( ! empty( $post['postmeta'] ) ) {\n foreach ( $post['postmeta'] as $meta ) {\n $key = apply_filters( 'import_post_meta_key', $meta['key'], $post_id, $post );\n $value = false;\n\n if ( '_edit_last' === $key ) {\n if ( isset( $this->processed_authors[ intval( $meta['value'] ) ] ) ) {\n $value = $this->processed_authors[ intval( $meta['value'] ) ];\n } else {\n $key = false;\n }\n }\n\n if ( $key ) {\n // export gets meta straight from the DB so could have a serialized string\n if ( ! $value ) {\n $value = maybe_unserialize( $meta['value'] );\n }\n\n add_post_meta( $post_id, $key, $value );\n do_action( 'import_post_meta', $post_id, $key, $value );\n\n // if the post has a featured image, take note of this in case of remap\n if ( '_thumbnail_id' === $key ) {\n $this->featured_images[ $post_id ] = (int) $value;\n }\n }\n }\n }\n }\n\n unset( $this->posts );\n }",
"public function process_post( $post ) {\n\t\treturn Post::from_wp_post( $post );\n\t}",
"protected function count_posts() {\n\t\tglobal $wpdb;\n\n\t\t$query = $this->get_count_query();\n\n\t\t$this->total_posts = $wpdb->get_var( $query );\n\t}",
"public function actionPostedInMonth()\n {\n\t\t$month = date('n', $_GET['time']);\n\t\t$year = date('Y', $_GET['time']);\n\t\tif ($_GET['pnc'] == 'n') $month++;\n\t\tif ($_GET['pnc'] == 'p') $month--;\n\n\t\t$criteria = new CDbCriteria(array(\n\t\t\t'condition' => 'status = '.Post::STATUS_PUBLISHED.' AND create_time > :time1 AND create_time < :time2',\n\t\t\t'order' => 'update_time DESC',\n\t\t\t'params' => array(\n\t\t\t\t':time1' => ($firstDay = mktime(0,0,0,$month,1,$year)),\n\t\t\t\t':time2' => mktime(0,0,0,$month+1,1,$year)),\n\t\t));\n\n\t\t$pages = new CPagination(Post::model()-> count($criteria));\n\t\t$pages->pageSize = Yii::app()->params['postsPerPage'];\n\t\t$pages->applyLimit($criteria);\n\n\t\t$posts = Post::model()->with('author')->findAll($criteria);\n\n\t\t$this->render('month',array(\n\t\t\t'posts' => $posts,\n\t\t\t'pages' => $pages,\n\t\t\t'firstDay' => $firstDay,\n\t\t));\n }",
"function spi_build_postcounts()\n{\n\tglobal $wpdb;\n\n\t# Get user list\n\t$users = $wpdb->get_col(\"SELECT ID FROM \".$wpdb->prefix.\"users\");\n\tif($users)\n\t{\n\t\tforeach($users as $user)\n\t\t{\n\t\t\t$postcount = $wpdb->get_var(\"SELECT COUNT(post_id) FROM \".$wpdb->prefix.\"sfposts WHERE user_id=\".$user);\n\t\t\tif(empty($postcount)) $postcount = 0;\n\t\t\tsp_update_member_item($user, 'posts', $postcount);\n\t\t}\n \techo '<p>Members <b>Post Counts</b> Updated</p>';\n\t}\n}",
"private function getAveragePostsPerWeek()\n\t{\n\t\t$lastFive = 7*24*60*60 / (($this->latest5posts->first()->post_timestamp - $this->latest5posts->last()->post_timestamp)/5);\n\t\t$previousFive = 7*24*60*60 / (($this->previous5posts->first()->post_timestamp - $this->previous5posts->last()->post_timestamp)/5);\n\t\tif ($previousFive == 0) { $previousFive = 0.01; } // avoid division by zero\n\t\t$percentageChange = round( (( ($lastFive - $previousFive) / $previousFive ) * 100) );\n\n\t\t$this->results->push([\n\t\t\t'statTitle'\t\t\t=>\t'Posts / Week',\n\t\t\t'statDescription'\t=>\t'The average amount of posts published per week',\n\t\t\t'value'\t\t\t\t=>\tround($lastFive,1),\n\t\t\t'percentageChange'\t=>\t$percentageChange,\n\t\t\t'statIcon'\t\t\t=>\t'fa-bar-chart'\n\t\t]);\n\t}",
"function update_post_stats($post_id) {\n $post_id = (integer) $post_id;\n global $wpdb;\n $row = $wpdb->get_row('SELECT post_id, SUM(value) AS sum, ROUND(AVG(value)) AS avg, COUNT(value) AS num FROM wp_bitcointips WHERE post_id = ' . $post_id . ' GROUP BY post_id');\n if ($row) {\n $sum = (integer) $row->sum;\n $avg = (integer) $row->avg; \n $count = (integer) $row->num; \n } else {\n $sum = 0;\n $avg = 0;\n $count = 0;\n }\n update_post_meta($post_id, 'bitcointips_sum', $sum);\n update_post_meta($post_id, 'bitcointips_avg', $avg);\n update_post_meta($post_id, 'bitcointips_count', $count);\n }",
"protected function compute()\n\t{\n\t\t$this->archiveNumericValuesMax( 'max_actions' );\n\t\t$toSum = array(\n\t\t\t'nb_uniq_visitors',\n\t\t\t'nb_visits',\n\t\t\t'nb_actions',\n\t\t\t'sum_visit_length',\n\t\t\t'bounce_count',\n\t\t\t'nb_visits_converted',\n\t\t);\n\t\t$record = $this->archiveNumericValuesSum($toSum);\n\n\t\t$nbVisits = $record['nb_visits']->value;\n\t\t$nbVisitsConverted = $record['nb_visits_converted']->value;\n\t\t$this->isThereSomeVisits = ( $nbVisits!= 0);\n\t\tif($this->isThereSomeVisits === false)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t$this->setNumberOfVisits($nbVisits);\n\t\t$this->setNumberOfVisitsConverted($nbVisitsConverted);\n\t\tPiwik_PostEvent('ArchiveProcessing_Period.compute', $this);\n\t}",
"public function incrementNumPosts()\n {\n $this->numPosts++;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks viewVars for options array of data set for field provided as FieldDataEntity class. | public function inputHasViewOptions(FieldDataEntity $Field) {
return $this->getInputViewOptions($Field) !== null;
} | [
"protected function buildEntityViewsField() {\n }",
"protected function isOfDataOption($fieldName, $optionName, array $options = array())\n {\n return (!empty($options[$optionName]) && in_array($fieldName, $options[$optionName]));\n }",
"private function extractEntityChoice() {\n $formView = $this->form->createView();\n $choiceViews = $formView->vars['choices'];\n\n foreach ($choiceViews as $choice) {\n $arrayChoice = array();\n $arrayChoice['id'] = $choice->value;\n $arrayChoice['value'] = $choice->label;\n array_push($this->dataEntityChoice, $arrayChoice);\n }\n }",
"private function localEntityFieldDataProvider() {\n return [\n // The field does exist in the local entity.\n TRUE,\n // The field does not exist in the local entity.\n FALSE,\n ];\n }",
"function __checkDataFor_delOptionFromEntity($data)\n {\n $return=array();\n if(!isset($data[\"parent_entity\"]) or !isset($data[\"entity_id\"]) or !isset($data[\"option_id\"])\n or !$this->__isCorrectEntityIDandOptionID($data[\"parent_entity\"],$data[\"entity_id\"],$data[\"option_id\"]))\n {\n $return[]=\"E_INVALID_ENTITY_ID_AND_OPTION_ID_COMBINATION\";\n }\n return $return;\n }",
"public function getDataWithTypeFieldAndFieldIsMultiDimensional() {}",
"function dssocial_preprocess_views_view_fields(&$vars) {\n if (isset($vars['theme_hook_suggestions'])) {\n $function = 'dssocial_preprocess_' . $vars['theme_hook_suggestions'];\n if (function_exists($function)) {\n $function($vars);\n }\n }\n}",
"public function hasVariabilityOptions();",
"function update_feed_cck_settings_views_data($field) {\r\n}",
"public function getDataEditFieldCatalog(Request $request, $id){\n\n\n\n//\t\treturn $request->eventId;\n\t\ttry{\n\t\t\t$fieldData = Field::from('fields as F')\n\t ->join('form_section_fields as FSF', 'FSF.field_id', 'F.id')\n\t ->join('form_sections as FS', 'FS.id', 'FSF.form_section_id')\n\t ->join('forms as FO', 'FO.id', 'FS.form_id')\n\t ->join('event_forms as EF', 'EF.form_id', 'FO.id')\n\t ->join('data_type_controls as DTC', 'DTC.id', 'F.data_type_control_id')\n\t ->join('controls as C', 'C.id', 'DTC.control_id')\n\t ->join('data_types as DT', 'DT.id', 'DTC.data_type_id')\n\t ->where('EF.event_id', $request->eventId)\n\t ->where('FS.section_id', 1) //section Registro\n\t ->select([\\DB::raw('FSF.id as IDA, F.id as ID, F.fieldText as TAG, F.fieldPlaceHolder as fieldPlaceHolder, F.fieldRequired as isRequired, F.fieldMaxLenght as fieldMaxLenght, F.data_type_control_id as CONTROLTYPE, C.controlName as CONTROLNAME, DT.id as dataTypeId, DT.dataTypeName as TYPENAME, C.id as controlId')])\n\t ->orderBy('FSF.fieldOrder', 'asc')\n\t ->where('F.id', $id)\n\t ->get(); \n\n\n\t $fieldOptions = null;\n\t $multipleOptions = false;\n\n\t if($fieldData[0]->controlId ==2){\n\n\t \t$fieldOptions = DB::table('field_options')->where('field_id', $id)->select([\\DB::raw('optionValue as value, optionName as name')]) ->get();\n\t \t$multipleOptions = true;\n\t }\n\n\n\t $dataFound = count($fieldData);\n\n\t $data = ['status' => 'OK',\n\t \t\t 'found' => $dataFound,\n\t \t\t 'fieldId'=>$fieldData[0]->ID,\n\t 'fieldControlId' => $fieldData[0]->controlId,\n\t 'dataTypeId' => $fieldData[0]->dataTypeId,\n\t 'fieldName' => $fieldData[0]->TAG,\n\t 'fieldPlaceHolder' => $fieldData[0]->fieldPlaceHolder,\n\t 'fieldRequired' => $fieldData[0]->isRequired,\n\t 'fieldMaxLenght' => $fieldData[0]->fieldMaxLenght,\n\t 'fieldOptions' => $fieldOptions,\n\t 'multipleOptions' => $multipleOptions\n\t ];\n\t \n\t } catch(exception $e){\n\n\t \t$data = ['status' => 'error',\n\t 'message' => $e->getMessage()];\n\t \t\n\n\t }\n\n\t\treturn json_encode($data);\n\n\t}",
"final private function has_field_options() {\n\t\treturn ! empty( $this->field_options );\n\t}",
"private function getEntityOptionsCount() {\n $data = $this->entity->getData();\n\n if (isset($data['options']) && count($data['options']) > 0) {\n return count($data['options']);\n }\n\n return 4;\n }",
"public function testGetDataValidSpecificDataField()\n\t{\n\t\t$testData = array(\n\t\t\t'test' => array('a', 'b', 'c')\n\t\t);\n\t\t\n\t\t// set data\n\t\t$this->data->setData($testData);\n\t\t\n\t\t// set data field\n\t\t$this->data->dataField = 'test';\n\t\t\n\t\t$this->assertEquals($testData['test'], $this->data->getData(false));\n\t}",
"protected function OverloadViewSettings()\n {\n if (empty($this->fieldView)) {\n $oListFilterItemType = $this->GetFieldPkgShopListfilterItemType();\n if (!is_null($oListFilterItemType) && !TGlobal::IsCMSMode()) {\n $this->sqlData['view'] = $oListFilterItemType->fieldView;\n $this->fieldView = $this->sqlData['view'];\n $this->sqlData['view_class_type'] = $oListFilterItemType->fieldViewClassType;\n $this->fieldViewClassType = $this->sqlData['view_class_type'];\n }\n }\n }",
"public static function needsChoicesAsValuesOption()\n {\n return self::formChoicesAsValues() && method_exists(\n 'Symfony\\Component\\Form\\FormTypeInterface',\n 'setDefaultOptions'\n );\n }",
"public static function formChoicesAsValues()\n {\n return method_exists(\n 'Symfony\\Component\\Form\\AbstractType',\n 'configureOptions'\n );\n }",
"protected function is_valid_field($data){\n return in_array(strtolower($data->field),self::$allowedFields);\n }",
"public function check_option_value()\n {\n // beacasue values of select tag can be change by the developer mode.\n // those changed values instead of original values can be sent to process and can be easly stored in database.\n // so this is also very important step to see.\n // this step is mainly for hackers or other users who have malicious intension.\n\n foreach ($this->properties as $property) {\n //checking constant is defined or NOT\n if (defined(\"self::\" . $this->combine[$property])) {\n // $set will be an array\n $set = constant(\"self::\".$this->combine[$property]);\n if (has_exclusion_of($this->$property, $set, $case_insensitive=false)) {\n $this->errors[] = \"'\".$this->$property.\"'\" .' is not valid value for ' . ucfirst($property);\n }\n } elseif($property == 'YearOfPassing'){\n $set = $this->combine[$property];\n $set = $this->$set; // $set will be an array\n if (has_exclusion_of($this->$property, $set, $case_insensitive=false)) {\n $this->errors[] = \"'\".$this->$property.\"'\" .' is not valid value for ' . ucfirst($property);\n }\n \n } //elseif\n } //foreach\n }",
"public function testFilterOptionsAddFields() {\n $this->drupalGet('admin/structure/views/view/content');\n\n $session = $this->getSession();\n $web_assert = $this->assertSession();\n $page = $session->getPage();\n\n // Open the dialog.\n $page->clickLink('views-add-field');\n\n // Wait for the popup to open and the search field to be available.\n $options_search = $web_assert->waitForField('override[controls][options_search]');\n\n // Test that the both special fields are visible.\n $this->assertTrue($page->findField('name[views.views_test_field_1]')->isVisible());\n $this->assertTrue($page->findField('name[views.views_test_field_2]')->isVisible());\n\n // Test the \".title\" field in search.\n $options_search->setValue('FIELD_1_TITLE');\n $page->waitFor(10, function () use ($page) {\n return !$page->findField('name[views.views_test_field_2]')->isVisible();\n });\n $this->assertTrue($page->findField('name[views.views_test_field_1]')->isVisible());\n $this->assertFalse($page->findField('name[views.views_test_field_2]')->isVisible());\n\n // Test the \".description\" field in search.\n $options_search->setValue('FIELD_2_DESCRIPTION');\n $page->waitFor(10, function () use ($page) {\n return !$page->findField('name[views.views_test_field_1]')->isVisible();\n });\n $this->assertTrue($page->findField('name[views.views_test_field_2]')->isVisible());\n $this->assertFalse($page->findField('name[views.views_test_field_1]')->isVisible());\n\n // Test the \"label\" field not in search.\n $options_search->setValue('FIELD_1_LABEL');\n $page->waitFor(10, function () use ($page) {\n return !$page->findField('name[views.views_test_field_2]')->isVisible();\n });\n $this->assertFalse($page->findField('name[views.views_test_field_2]')->isVisible());\n $this->assertFalse($page->findField('name[views.views_test_field_1]')->isVisible());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function below generates SQL query to update the property details in database | function updateProperty($property) {
$propertyID = (int) $property['property_id'];
$sqlQuery = "UPDATE property SET ";
$sqlQuery .= " _typeofhouse_id = '" . $property['_typeofhouse_id'] . "',";
$sqlQuery .= " _county_id = '" . $property['_county_id'] . "',";
$sqlQuery .= " address1 = '" . $property['address1'] . "',";
$sqlQuery .= " price = '" . $property['price'] . "', ";
$sqlQuery .= " _houseprice_id = '" . $property['_houseprice_id'] . "', ";
$sqlQuery .= " status = '" . $property['status'] . "'";
$sqlQuery .= " WHERE property_id = $propertyID";
$result = mysql_query($sqlQuery);
if (!$result) {
die("error" . mysql_error());
}
} | [
"public function getForUpdateSQL();",
"private function getSQLForUpdate(): string\n {\n $table = $this->sqlParts['from']['table']\n . ($this->sqlParts['from']['alias'] ? ' ' . $this->sqlParts['from']['alias'] : '');\n\n return 'UPDATE ' . $table\n . ' SET ' . implode(', ', $this->sqlParts['set'])\n . ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->sqlParts['where']) : '');\n }",
"function updateSQL () {\r\n\t\t$tabname = $this->tableName();\r\n\t\t$sql = \"UPDATE $tabname SET %s WHERE id=$this->id\";\r\n\t\t$exclude = $this->notSQL();\r\n\t\tforeach (get_class_vars(get_class($this)) as $field=>$value) {\r\n\t\t\tif (!in_array($field,$exclude) AND $field[0] != '_') $setter[] = $field.\"='\".$this->$field.\"'\";\r\n\t\t}\r\n\t\t$timestamp = $this->timeStampField();\r\n\t\tif ($timestamp) $setter[] = $timestamp.\"='\".date('Y-m-d H:i:s').\"'\";\r\n\t\treturn sprintf($sql,implode(',', $setter));\r\n\t}",
"function getUpdateSql()\n {\n $str = 'UPDATE ';\n if (isset($this->schema))\n $str = $str . $this->schema . \".\";\n\n $str = $str . $this->tblName . ' SET ';\n $n = 0;\n foreach (array_keys(get_class_vars(get_class($this))) as $k) {\n if (!in_array($k, $this->tblIndex) && $k != 'tblName' && $k != 'schema' && $k != 'tblIndex' && $k != 'exists' && isset($this->$k)) {\n if ($n++ > 0) {\n $str .= ',';\n }\n $str = $str . \" \" . $k . \"=\" . $this->prepareForQuery($this->$k);\n\n\n }\n }\n $str .= \" WHERE \" . $this->getWhereCondition($this->tblIndex);\n return $str;\n }",
"private function getUpdateSQL()\n {\n $table = $this->sqlParts['from']['table'] . ($this->sqlParts['from']['alias'] ? ' '\n . $this->sqlParts['from']['alias'] : '');\n\n $query = 'UPDATE ' . $table\n . ' SET ' . implode(\", \", $this->sqlParts['set'])\n . ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string)$this->sqlParts['where']) : '');\n\n return $query;\n }",
"private function getUpdateQuery()\n {\n if (isset($this->parts['from'][0]['alias'])) {\n $fromClause = $this->parts['from'][0]['alias'].' FROM '.$this->getFromClause();\n } else {\n $fromClause = $this->parts['from'][0]['table'];\n }\n\n $setClause = array();\n\n foreach ($this->parts['set'] as $idenfier => $value) {\n $setClause[] = $this->getExpressionBuilder()->equal($idenfier, $value);\n }\n\n return 'UPDATE '.$fromClause.\n ' SET '.implode(', ', $setClause).\n (($this->parts['where'] !== null) ? ' WHERE '.$this->parts['where'] : null);\n }",
"public function constructUpdateQuery()\n {\n $tablesUsed = array();\n $updateString = $this->constructUpdateString($tablesUsed, true);\n $condString = $this->constructCondString($tablesUsed);\n\n return 'UPDATE ' . implode(', ', $tablesUsed) . ' SET ' . $updateString . ' WHERE ' . $condString;\n }",
"private function updatePropertyColumns()\n {\n $db = \\phpws2\\Database::getDB();\n $tbl = $db->addTable('properties');\n $dt = $tbl->addDataType('proptype', 'smallint');\n $dt->setDefault(0);\n $dt->add();\n\n $dt = $tbl->addDataType('no_smoking', 'smallint');\n $dt->setDefault(0);\n $dt->add();\n\n $tbl->addValue('proptype', 1);\n $tbl->addFieldConditional('efficiency', 1);\n $db->update();\n\n $tbl->dropColumn('window_number');\n $tbl->dropColumn('efficiency');\n $tbl->dropColumn('sublease');\n $tbl->dropColumn('approved');\n }",
"private function formatUpdate(): string {\n $rawValues = reset($this->update);\n $table = key($this->update);\n $values = [];\n foreach ($rawValues as $col => $value) {\n $values[] = \"{$col} = \" . ($value !== NULL ? \"{$this->connection->quote($value)}\" : \"null\");\n }\n $values = implode(\", \", $values);\n $query = \"UPDATE {$table} SET {$values}\";\n return $query;\n }",
"private function buildSetPropertyString($properties){\n $string = '';\n \n foreach($properties as $key=>$val){\n $string .= ' SET role_node.'.$key.' = '.$this->getParamQuoting($val);\n }\n return $string;\n }",
"public function forUpdate($sql);",
"function update_propdb11() {\r\n $sql = \"UPDATE propdb11 SET \"\r\n . \"codprop = '$this->codprop', \"\r\n . \"codprod = '$this->codprod', \"\r\n . \"cantidad = '$this->cantidad', \"\r\n . \"costo = '$this->costo', \"\r\n . \"costototal = '$this->costototal', \"\r\n . \"taplicacion = '$this->taplicacion', \"\r\n . \"ordenta = '$this->ordenta', \"\r\n . \"ordenprod = '$this->ordenprod', \"\r\n . \"preciodcto = '$this->preciodcto', \"\r\n . \"cantidadtotal = '$this->cantidadtotal', \"\r\n . \"umedida = '$this->umedida', \"\r\n . \"usemod = '$this->domuser', \"\r\n . \"fecmod = now() \"\r\n . \"WHERE codprop = '$this->codpropold' and codprod = '$this->codprod' and coditem = '$this->coditem' and taplicacion = '$this->taplicacion';\";\r\n $result = $this->consultas($sql);\r\n return $result;\r\n }",
"function updateObjectDB () {\n\t\t$this->prepareValues();\n\t\t$database = mamboDatabase::getInstance();\n\t\t$database->doSQL($this->updateSQL());\n\t}",
"function compile_update_sql($primarykey){\n //\n //Compile the update header section of the statement\n $sql = \"UPDATE `$this->tname` SET \";\n //\n //Set the leading comma separator to nothing; it will be updated later\n $comma = \"\";\n //\n //Compile the comma separated list of values to update\n foreach($this->fields as $fname=>$field){\n //\n //Exclude fields that cannot be modified, e.g., primary key field and\n //derived fields\n if ($field->is_modifiable()){\n //\n //Define a writable field value\n $fvalue = \"\";\n //\n //Only valid values are updated\n if ($field->try_writable_value($this->values, $fvalue)){\n //\n //Add the leading comma and compile the header. The field's \n //value is already quote delimited or is null\n $sql.= \"$comma `$fname` = $fvalue\";\n //\n //Update the comma separator\n $comma = \", \";\n }\n } \n }\n //\n //Compile the write footer section\n $sql.=\" WHERE `$this->tname` = $primarykey\";\n //\n return $sql;\n }",
"public function getUpdateQuery();",
"public function compileUpdate(): string\n {\n $sql = $this->compilePartUpdate();\n $sql .= $this->compilePartSet();\n $sql .= $this->compilePartWhere();\n $sql .= $this->compilePartOrderBy();\n $sql .= $this->compilePartLimitOffset();\n return $sql;\n }",
"function compile_update_sql($primarykey) {\n //\n //Compile the update header section of the statement\n $sql = \"UPDATE `$this->tname` SET \";\n //\n //Set the leading comma separator to nothing; it will be updated later\n $comma = \"\";\n //\n //Compile the comma separated list of values to update\n foreach ($this->fields as $fname => $field) {\n //\n //Exclude fields that cannot be modified, e.g., primary key field and\n //derived fields\n if ($field->is_modifiable()) {\n //\n //Define a writable field value\n $xvalue = \"\";\n //\n //Only valid values are updated\n if ($field->try_writable_value($this->values, $xvalue)) {\n //\n //Add the leading comma and compile the header. The field's \n //value is already quote delimited or is null\n $sql .= \"$comma `$fname` = $xvalue\";\n //\n //Update the comma separator\n $comma = \", \";\n }\n }\n }\n //\n //Compile the write footer section\n $sql .= \" WHERE `$this->tname` = $primarykey\";\n //\n return $sql;\n }",
"public function db_update_from_object(array $props_to_upd, array $conditions){\n $array_to_upd = [];\n foreach ($props_to_upd as $prop) {\n if (self::object_has_prop($this, $prop)) $array_to_upd[$prop] = $this->$prop;\n }\n// var_dump($array_to_upd);\n $updated = $this->update(static::$db_table, $array_to_upd, $conditions);\n return $updated;\n}",
"function sqlUpdate($table, $fields_values, $conditions = \"\"){\nglobal $_shibahug__conn;\n$where_clause = _shibahug_formatWhere($conditions);\n$sql = \"UPDATE $table SET \".$fields_values.$where_clause;\nif ($_shibahug__conn->query($sql) !== TRUE) {\ndie(\"ShibaHug Error: sqlUpdate failed (\" . $_shibahug__conn->connect_error.\" | \" . $_shibahug__conn->error.\")\");\n}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ The function returns to the data team controller the function. This function is responsible to add team data. | public function insertDataTeam(){
return $this->dataTeamCO->_insertDataTeam($dataTeam);
} | [
"public function add_new_team()\r\n\t{\t\r\n\t\t$data = array(\r\n\t 'country_id' => $this->get_country_id(),\r\n\t 'court_id' => $this->get_court_id()\r\n\t\t);\r\n\t\t$this->db->insert('tbl_team', $data);\r\n\t}",
"public function add($team);",
"private function createteam(){\n\t\t\tinclude_once 'biz/portalbiz.php';\n\t\t\t$port = new portalbiz();\t\n\t\t\t// Cross validation if the request method is GET else it will return \"Not Acceptable\" status\n\t\t\t//if($this->get_request_method() != \"POST\")\n\t\t\t//\t$this->response('',406);\t\t\t\t\n\t\t\t//$teamDetails['name'] = $this->_REQUEST['teamname'];\n\t\t\t//$teamDetails['country'] = $this->_REQUEST['country'];\n\t\t\t//$teamDetails['zipcode'] = $this->_REQUEST['zipcode'];\n\t\t\t$teamDetails['name']=\"RR\";\n\t\t\t$teamDetails['country']='India';\n\t\t\t$teamDetails['zipcode']='987789';\n\t\t\t$port->addTeam($teamDetails);\n\t\t\t$this->response('',201);\t// If no records \"No Content\" status\n\t\t}",
"public function addPlayertoTeam()\n\t{\n\t\t$request = Request::all();\n\t\t$team_id = Request::get('team_id');\n\t\t$player_id = Request::get('response');\n\t\t$match_id = Request::get('match_id');\n\t\t$selected_team = Request::get('selected_team');\n\t\t\n\t\tif($team_id>0 && $player_id>0)\n\t\t{\n\t\t\t$role = 'player';\n\t\t\t$user_id = Request::get('response');\n\t\t\t$TeamPlayer = new TeamPlayers();\n\t\t\t$TeamPlayer->team_id = $team_id;\n\t\t\t$TeamPlayer->user_id = $player_id;\n\t\t\t$TeamPlayer->role = $role;\n\t\t\tif($TeamPlayer->save())\n\t\t\t{\n\t\t\t\tif($selected_team=='a')//if team a selected\n\t\t\t\t{\n\t\t\t\t\t$get_a_player_ids = MatchSchedule::where('id',$match_id)->where('a_id',$team_id)->pluck('player_a_ids');//get team a players\n\t\t\t\t\t$get_a_player_ids = $get_a_player_ids.','.$player_id;\n\t\t\t\t\tMatchSchedule::where('id',$match_id)->where('a_id',$team_id)->update(['player_a_ids'=>$get_a_player_ids]);\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$get_b_player_ids = MatchSchedule::where('id',$match_id)->where('b_id',$team_id)->pluck('player_b_ids');//get team a players\n\t\t\t\t\t$get_b_player_ids = $get_b_player_ids.','.$player_id;\n\t\t\t\t\tMatchSchedule::where('id',$match_id)->where('b_id',$team_id)->update(['player_b_ids'=>$get_b_player_ids]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn Response()->json( array('success' => trans('message.sports.teamplayer')) );\n\t\t}else\n\t\t{\n\t\t\treturn Response()->json( array('failure' => trans('message.sports.teamvalidation')) );\n\t\t}\n\t}",
"public function save_teams()\n {\n $deleteSuccess = 0;\n $insertSuccess = 0;\n \n if (!empty($this->teams_to_delete) && isset($this->teams_to_delete))\n {\n //call delete_teams_from_db() function to delete teams from database\n $deleteSuccess = $this->delete_teams_from_db();\n }\n if (!empty($this->teams_to_add) && isset($this->teams_to_add))\n {\n //call insert_teams_into_db() function to insert teams into database\n $insertSuccess = $this->insert_teams_into_db();\n }\n \n //check if all teams of the passed array have been inserted/deleted successfully\n if ($deleteSuccess == count($this->teams_to_delete) || count($this->teams_to_add) == $insertSuccess)\n {\n //call regenerate_new_url function to regenerate new key and url\n $new_generated_url = $this->regenerate_new_url();\n\n //call regenerate_new_org_chart function to regenerate org chart for the new tree with saved data\n $this->new_generated_org_chart = $this->regenerate_new_org_chart();\n\n //call regenerate_new_tree function to regenerate tree with newly saved teams\n $new_generated_tree = $this->regenerate_new_tree();\n\n //return newly generated tree and url as array provided both values are not empty\n if ($new_generated_url && !empty($new_generated_tree))\n {\n $saveDataReturnArray = array(\n \"newTree\" => $new_generated_tree,\n \"newUrl\" => $new_generated_url\n );\n echo json_encode($saveDataReturnArray);\n }\n //return 404 failure error\n else\n {\n echo 404;\n }\n\n }\n\n }",
"public function addPlayertoTeam()\n\t{\n\t\t$request = Request::all();\n\t\t$team_id = Request::get('team_id');\n\t\t$player_id = Request::get('response');\n\t\t$match_id = Request::get('match_id');\n\t\t$selected_team = Request::get('selected_team');\n\n\t\tif($team_id>0 && $player_id>0)\n\t\t{\n\t\t\t$role = 'player';\n\t\t\t$user_id = Request::get('response');\n\t\t\t$TeamPlayer = new TeamPlayers();\n\t\t\t$TeamPlayer->team_id = $team_id;\n\t\t\t$TeamPlayer->user_id = $player_id;\n\t\t\t$TeamPlayer->role = $role;\n\t\t\tif($TeamPlayer->save())\n\t\t\t{\n\t\t\t\tif($selected_team=='a')//if team a selected\n\t\t\t\t{\n\t\t\t\t\t$get_a_player_ids = MatchSchedule::where('id',$match_id)->where('a_id',$team_id)->pluck('player_a_ids');//get team a players\n\t\t\t\t\t$get_a_player_ids = $get_a_player_ids.$player_id.',';\n\t\t\t\t\tMatchSchedule::where('id',$match_id)->where('a_id',$team_id)->update(['player_a_ids'=>$get_a_player_ids]);\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$get_b_player_ids = MatchSchedule::where('id',$match_id)->where('b_id',$team_id)->pluck('player_b_ids');//get team a players\n\t\t\t\t\t$get_b_player_ids = $get_b_player_ids.$player_id.',';\n\t\t\t\t\tMatchSchedule::where('id',$match_id)->where('b_id',$team_id)->update(['player_b_ids'=>$get_b_player_ids]);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn Response()->json( array('success' => trans('message.sports.teamplayer')) );\n\t\t}else\n\t\t{\n\t\t\treturn Response()->json( array('failure' => trans('message.sports.teamvalidation')) );\n\t\t}\n\t}",
"public function copyTeam()\r\n\t{\r\n\t\t$this->isValidToken();\r\n\r\n\t\t$teamId = isset($this->requestData->teamId) ? $this->requestData->teamId : \"\";\t\t\r\n\t\t$matchId = isset($this->requestData->matchId) ? $this->requestData->matchId : \"\";\t\t\r\n\t\t$userId = $this->loggedInUserId;\r\n\r\n\t\tif (!$teamId && !$matchId)\r\n\t\t\t$this->response(\"teamId and matchId are required!\");\r\n\r\n\t\t//get user team record\r\n\t\t$userTeam = $this->CommonModel->selectRecord(array('user_team_id' => $teamId, 'user_id' => $userId, 'match_id' => $matchId), 'user_team', 'players, caption, vice_caption');\r\n\t\tif (!$userTeam)\r\n\t\t\t$this->response(\"There is no such team found!\");\r\n\r\n\t\t//user can create only 10 teams for one match\r\n\t\t$usr_team_cnt = $this->CommonModel->selectRecord(array('user_id' => $userId, 'match_id' => $matchId), 'user_team', 'COUNT(user_team_id) AS usr_team_cnt');\r\n\t\tif ($usr_team_cnt['usr_team_cnt'] >= 10) \r\n\t\t\t$this->response('Limit exceed, User can not create more then 10 teams!');\r\n\r\n\t\t//insert team record\r\n\t\t$teamData = array();\r\n\t\t$teamData['user_id'] = $userId;\r\n\t\t$teamData['match_id'] = $matchId;\r\n\t\t$teamData['user_team_number'] = $usr_team_cnt['usr_team_cnt']+1;\r\n\t\t$teamData['players'] = $userTeam['players'];\r\n\t\t$teamData['caption'] = $userTeam['caption'];\r\n\t\t$teamData['vice_caption'] = $userTeam['vice_caption'];\r\n\t\t$newTeamId = $this->CommonModel->insertData('user_team', $teamData);\r\n\r\n\t\tif ($newTeamId)\r\n\t\t{\r\n\t\t\t//get players of copied team\r\n\t\t $plyrs = $this->CommonModel->selectRecord(array('user_team_id' => $newTeamId), 'user_team', 'players');\r\n\t\t $plyrs = get_object_vars(json_decode(unserialize($plyrs['players'])));\r\n\t\t $teams = array_keys($plyrs);\r\n\t\t $ply_ids = array_merge($plyrs[$teams[0]], $plyrs[$teams[1]]);\r\n\r\n\t\t //get old players and update count (-1) for those players\r\n\t\t //update player selected count (for select by percent)\r\n\t\t $this->Model->updatePlayerSelectCount($ply_ids, $matchId, 'INC', $userTeam['caption'], $userTeam['vice_caption']);\r\n\r\n\t\t\t$this->response('new team created', TRUE, $newTeamId);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->response('unable to copy team');\r\n\t}",
"function complete_create_team() {\n if (valid_request(array(isset($_POST['name'])))) {\n \n global $smarty;\n global $db; \n \n //test if name fits into name conventions\n if (!preg_match('/^[a-zA-Z0-9-. ]+$/', $_POST['name'])){\n display_errors(200); \n }\n elseif (strlen($_POST['name']) > 50) {\n display_errors(201);\n } \n else { \n //insert team \n //create password\n require_once('classes/class.password.php');\n $password = new password(8);\n $password->uppercase = false;\n \n $sql = \"add_team('\".$_POST['name'].\"', '\".$password->generate().\"', \".$_SESSION['user_id'].\");\";\n $db->run($sql);\n \n if ($db->error_result)\n display_errors(203);\n else { \n $row = $db->get_result_row(); \n display_success(\"create_team\", $row['team_id']);\n $smarty->assign('content', $smarty->fetch(\"succes.tpl\")); \n }\n }\n }\n return true; \n }",
"private function teamData($team, $data) {\n $query = db_select('node__field_team_player', 't')\n ->fields('t', ['field_team_player_target_id'])\n ->condition('entity_id', $data, '=')\n ->execute()\n ->fetchAll();\n $player = [];\n\n $stats = ['assists', 'goals', 'pim', 'shots_on_goal'];\n $form[\"team{$team}roster\"]['prefix'] = [\n '#prefix' => \"<div class=\\\"team{$team}roster\\\"><strong>Team {$team} Roster</strong><table><tr><th width=\\\"300\\\">Name / Number</th><th>Assits</th><th>Goals</th><th>Pim</th><th>Shots On Goal</th></tr>\",\n ];\n\n foreach ($query as $key => $value) {\n $node = Node::load($value->field_team_player_target_id);\n $form[\"team{$team}roster\"][]['name'] = [\n '#prefix' => \"<div class=\\\"team{$team}rosterrow\\\"><tr class=\\\"team{$team}row\\\"><td>\",\n '#markup' => '<strong>' . $node->title->value . '</strong> ' . $node->field_player_number->value . ' ' . $node->field_player_position->value,\n '#size' => 25,\n '#attributes' => [\n 'id' => [\"team-{$team}-roster-{$node->field_player_number->value}\"],\n ],\n ];\n\n // $disabled = ($node->field_player_position == 'Goalie' ? true : false);\n\n foreach ($stats as $stat) {\n $form[\"team{$team}roster\"][][$stat] = [\n '#type' => 'textfield',\n '#size' => 6,\n '#prefix' => '<td>',\n '#suffix' => '</td>',\n '#attributes' => [\n 'id' => [\"team-{$team}-roster-{$node->field_player_number->value}\"],\n ],\n ];\n }\n $form[\"team{$team}roster\"][][$stat] = [\n '#suffix' => '</td></tr></div>',\n ];\n }\n\n $form[\"team{$team}roster\"]['suffix'] = [\n '#suffix' => '</table></div>',\n ];\n\n return $form;\n }",
"public function create_team()\n {\n $this->form_validation->set_rules('name', 'Team Name', 'trim|required|alpha_numeric|is_unique[team.name]');\n \n if ($this->form_validation->run() == false) {\n \n $this->data['teams'] = $this->CreateTeamModel->get_teams();\n $this->load->view('create_team_view',$this->data);\n } else {\n $this->load->model('CreateTeamModel');\n if ($result = $this->CreateTeamModel->create_team()) {\n \n echo '<script>alert(\"Team has been created successfully!\");</script>';\n $this->data['teams'] = $this->CreateTeamModel->get_teams();\n $this->load->view('create_team_view',$this->data);\n } else {\n echo '<script>alert(\"Team creation failed!\");</script>';\n $this->data['teams'] = $this->CreateTeamModel->get_teams();\n $this->load->view('create_team_view',$this->data);\n }\n }\n }",
"function action_add_team()\n\t{\n\t\t// Loading form validation helper.\n\t\t$this->load->library('form_validation');\n\n\t\t$this->form_validation->set_rules('tid', 'Team ID', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('lid', 'Player ID', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('sid', 'Season ID', 'trim|required|xss_clean');\n\n\t\t$tid = $this->input->post('tid');\n\t\t$lid = $this->input->post('lid');\n\t\t$sid = $this->input->post('sid');\n\n\t\tif ($this->form_validation->run())\n\t\t{\n\t\t\tif ($this->standings->insert($tid, $lid, $sid))\n\t\t\t{\n\t\t\t\techo json_encode(array(\n\t\t\t\t\t'status' => 'success',\n\t\t\t\t\t'message' => 'The team has successfully been added to the league.'\n\t\t\t\t));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\techo json_encode(array(\n\t\t\t'status' => 'danger',\n\t\t\t'message' => 'One or more of the fields are invalid.'\n\t\t));\n\t}",
"public function team_members($project_id)\n {\n if(isset($_SESSION['user']) && $_SESSION['access']['project_team'])\n {\n if(isset($_POST['type']))\n {\n switch($_POST['type'])\n {\n case 'remove':\n $result = $this->User_model->remove_team_member($project_id, $_POST['user_id']);\n if($result)\n {\n $data['sucess'] = true;\n $data['message'] = \"Sucessfully removed team member\";\n }\n else\n {\n $data['fail'] = true;\n $data['message'] = \"Failed to remove team member\";\n }\n case 'add':\n $result = $this->User_model->add_team_member($project_id, $_POST['user_id']);\n if($result)\n {\n $data['sucess'] = true;\n $data['message'] = \"Sucessfully added team member\";\n }\n else\n {\n $data['fail'] = true;\n $data['message'] = \"Failed to add team member\";\n }\n }\n }\n $data['page'] = array('header'=>'Project team', 'description'=>'pick project team members here','app_name'=>'PROJECTS');\n $data['user'] = $_SESSION['user'];\n $data['apps'] = $_SESSION['apps'];\n $data['project_id'] = $project_id;\n $data['data_tables'] = array('team_members','non_team_users');\n $data['tabs'] = $this->make_tabs($_SESSION['access'],$project_id);\n $data['team_members'] = $this->User_model->get_team_members($project_id);\n $data['non_team_users'] = $this->User_model->get_non_team_users($project_id);\n $this->load->view('template/header',$data);\n $this->load->view('Project/Team/team_members.php',$data);\n $this->load->view('template/footer',$data);\n }\n else\n {\n redirect('/Main/login', 'refresh');\n }\n }",
"public function getAdminAddTeam(){\n\n\t\treturn View::make('addteam')->withLeague(Team::$league);\n\t}",
"public function addTeam($team) {\n $user = Person::user();\n\n if ($team->Captain_ID != $user->Person_ID && !$user->hasRole('Organizer')) {\n ApplicationError(\"Team\", \"You must be the team captain to join a tournament!\", 403);\n }\n if ($this->Deleted == 1) {\n ApplicationError(\"Tournament\", \"The tournament has been canceled! Unable to join.\");\n }\n if ($this->Status != 0) {\n ApplicationError(\"Tournament\", \"The tournament has already begun! Unable to join.\");\n }\n\n if (intval($team->Deleted) === 1) {\n ApplicationError(\"Tournament\", \"Only active teams can join tournaments!\");\n }\n\n $dbh = Database::getInstance();\n $sql = \"INSERT INTO TournamentTeams(Tournament_ID, Team_ID)\n Values(?,?)\";\n $sth = $dbh->prepare($sql);\n $sth->execute([$this->Tournament_ID, $team->Team_ID]);\n\n return new Entity(['Success' => 'Your team has joined the tournament.']);\n }",
"public function addUsersToTeam($data)\r\n {\r\n $url = $this->urlFor('/api/v1/team/user');\r\n $post_body = json_encode($data);\r\n return $this->post($url,$post_body);\r\n }",
"public function setTeam()\n\t{\t\n\t\t$this->method->method('POST');\n\n\t\t$postData = file_get_contents('php://input');\n\n\t\t//make an array to store in\n\t\t$post = [];\n\t\t//store serialized data to array\n\t\tparse_str($postData, $post);\n\n\t\t$data = $this->admin_model->setTeam([\n\t\t\t'teamleaderid' => $post['teamleader'],\n\t\t\t'name' => $post['name']\n\t\t]);\n\n\t\tif($data === false) {\n\t\t\t$this->response->response(400, 'Bad Request', 'Shit');\n\t\t} else {\n\t\t\t$this->response->response(200, 'OK', $data);\n\t\t}\n\t}",
"function addTeams($con, $comp, $teams)\n{\n $current = array();\n foreach ($comp->selectTeams($con) as $team) {\n array_push($current, $team->Number);\n // printf(\"%s %s %s %s %s\\n\",\n // $team->Number, $team->Name, $team->City, $team->State, $team->Country);\n }\n\n foreach ($teams as $team) {\n if (!in_array($team->Number, $current)) {\n printf(\"Adding %s to %s\\n\", $team->Number, $comp->Name);\n $st = team::selectTeam($con, $team->Number);\n\n if (!$st) {\n printf(\"New team: $team->Number, $team->Name, $team->City, $team->State, $team->Country\\n\");\n team::insertTeam($con, (array) $team);\n }\n\n $comp->insertTeam($con, $team->Number);\n }\n else {\n printf(\"Team %s to already added.\\n\", $team->Number);\n }\n }\n}",
"function add_team($params) {\n $this->db->insert('team', $params);\n return $this->db->insert_id();\n }",
"public function set_Team_Data_Structure($team_data) {\n\t\tforeach ($team_data as $key => $team) {\n\t\t\t$team_name \t\t\t= $team['name'];\n\t\t\t$team_id \t\t\t= $team['id'];\n\t\t\t$conference_name \t= $team['conference'];\n\t\t\t$division_name \t\t= $team['division'];\n\n\t\t\t// Checks if a conference has already been created. If not, we can assume that no division or team object has been created either\n\t\t\tif ($this->does_Conference_Exist($conference_name)) {\n\t\t\t\t$current_conference = $this->conferences[$conference_name];\n\n\t\t\t\t// Checks if a division instance has already been created and added to the current conference. If not, create one and add the current team to it\n\t\t\t\tif( $current_conference->does_Division_Exist($division_name) ) {\n\t\t\t\t\t$current_division = $current_conference->get_Division_Instance($division_name);\n\t\t\t\t\t$new_team = new Nfl_Team($team_id, $team_name);\n\t\t\t\t\t$current_division->add_Team($new_team);\n\t\t\t\t} else {\n\t\t\t\t\t$new_division = new Nfl_Division($division_name);\n\t\t\t\t\t$new_team = new Nfl_Team($team_id, $team_name);\n\n\t\t\t\t\t$new_division->add_Team($new_team);\n\t\t\t\t\t$current_conference->add_Division($new_division);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$new_conference = new Nfl_Conference($conference_name);\n\t\t\t\t$new_division = new Nfl_Division($division_name);\n\t\t\t\t$new_team = new Nfl_Team($team_id, $team_name);\n\n\t\t\t\t$new_division->add_Team($new_team);\n\t\t\t\t$new_conference->add_Division($new_division);\n\t\t\t\t$this->conferences[$conference_name] = $new_conference;\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the authorization mode for api calls | public function getAuthorizationMode(): AuthorizationMode
{
return $this->authorizationMode;
} | [
"public function getAuthMode();",
"public function getAuthenticationMode();",
"public function getAuthMode()\n {\n return $this->auth_mode;\n }",
"public function getAuthorizationType();",
"public function getAuthorizationStatus();",
"public function getAuthMode()\n {\n $user = $this->loadUser(Yii::app()->user->id);\n return $user->auth_mode;\n }",
"public function getAuthorizationMethod()\n {\n //tipo do token\n return 'bearer';\n }",
"protected function getAuthorizationMethod()\n {\n return static::AUTHORIZATION_METHOD_HEADER_OAUTH;\n }",
"public function getUserAuthModeName();",
"public function getAuthMethod();",
"public function getApiGuard()\n {\n if(Auth::guard('admin_api')->check()) {\n return \"admin\";\n }\n elseif(Auth::guard('api')->check()) {\n return \"user\";\n }\n }",
"public function getOAuthAuthorization()\n {\n return Controllers\\OAuthAuthorization::getInstance();\n }",
"private function getMode()\n {\n if ($this->getRequest()->getParam('store')) {\n return $this->_scopeConfig->getValue(\n Config::XML_PATH_API_DEV_MODE,\n ScopeInterface::SCOPE_STORE,\n $this->getRequest()->getParam('store')\n );\n } elseif ($this->getRequest()->getParam('website')) {\n return $this->_scopeConfig->getValue(\n Config::XML_PATH_API_DEV_MODE,\n ScopeInterface::SCOPE_WEBSITE,\n $this->getRequest()->getParam('website')\n );\n } else {\n return $this->_scopeConfig->getValue(Config::XML_PATH_API_DEV_MODE);\n }\n }",
"public function GetAuthrityMode() : int\n {\n return $this->CurrentProvider->GetAuthorityMode();\n }",
"private function getAuthorization()\n {\n // Post id_token\n if (new DateTime() > $this->tokenExpire) {\n $this->refreshToken();\n }\n $data = [\n 'authenticationToken' => $this->idToken,\n ];\n $url = \"https://api2.ov-chipkaart.nl/femobilegateway/v1/api/authorize\";\n $authorizationResponse = (self::Execute($url, $data));\n\n // Returns string\n $this->authorizationToken = $authorizationResponse['o'];\n }",
"public function getAuthorizationMethod()\n\t{\n\t\treturn ServiceInterface::AUTHORIZATION_METHOD_HEADER_OAUTH;\n\t}",
"private function getAuth() {\n $redirectAuth = $_SERVER[\"REDIRECT_HTTP_AUTHORIZATION\"];\n $httpAuth = $_SERVER[\"HTTP_AUTHORIZATION\"];\n return isset($redirectAuth) ? $redirectAuth : $httpAuth;\n }",
"function getAuthorization() {\n return $this->_request->getHeader('Authorization') ?\n $this->_request->getHeader('Authorization') :\n FALSE;\n }",
"public function getAuthorization()\n {\n return $this->authorization;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Append another item as a child of this item. The $mode parameter can be used to specify the way the item will be appended: moved or copied. | public function appendChild($item, ?\SetaPDF_Core_Document $document = null, $mode = null) {} | [
"public function appendChildCopy($item) {}",
"public function append($obj) {\r\n\t\t$obj->pzkParentId = @$this->id;\r\n\t\t$this->children[] = $obj;\r\n\t}",
"public function append(MenuItemInterface $item);",
"public function add()\n { \n $mode = 'append';\n //Check if the element has a parent. If it doesnt then add it\n //to this container. If it does throw an exception.\n foreach(func_get_args() as $element)\n {\n if(is_string($element) && ($element == Container::PREPEND || $element == Container::APPEND))\n {\n $mode = $element;\n continue;\n }\n \n if($element->parent==null)\n {\n if($mode == Container::PREPEND)\n {\n array_unshift ($this->elements, $element);\n }\n else if($mode == Container::APPEND)\n {\n $this->elements[] = $element;\n }\n \n $element->setMethod($this->getMethod());\n $element->setShowField($this->getShowField());\n $element->parent = $this;\n $element->ajax = $this->ajax;\n $this->hasFile |= $element->getHasFile();\n }\n else\n {\n throw new Exception(\"Element added already has a parent\");\n }\n }\n return $this;\n }",
"function &insertChild($path,$pos,&$child, $content = '', $attributes = array()) {\r\n // direct insert of objects useing array_splice() faild :(\r\n array_splice($this->children,$pos,0,'dummy');\r\n if (is_object($child)) { // child offered is not instanziated\r\n // insert a single node\r\n if (strtolower(get_class($child)) == 'xml_tree_node') {\r\n $this->children[$pos]=&$child;\r\n }\r\n // insert a tree i.e insert root-element\r\n if (strtolower(get_class($child)) == 'xml_tree' && isset($child->root)) {\r\n $this->children[$pos]=$child->root->get_element();\r\n }\r\n } else { // child offered is not instanziated\r\n $this->children[$pos]=new XML_Tree_Node($child, $content, $attributes);\r\n }\r\n return($this);\r\n }",
"public function testAppendChildNewNode()\n {\n $this->_testAppend(true, false);\n }",
"public function append(){\n $args = func_get_args();\n foreach($args as $item){\n $this->data[] = $item;\n }\n\n $this->reload($this->data);\n\n return $this;\n }",
"public function addChild($child, array $options = array());",
"public function attachUrlSegmentItem(UrlSegmentItem $item, $mode = UrlSegmentItem::ATTACH_MODE_BELOW)\n {\n // Check mode\n\n if ( ! is_string($mode) || ($mode != UrlSegmentItem::ATTACH_MODE_ABOVE && $mode != UrlSegmentItem::ATTACH_MODE_BELOW)) {\n throw UrlException::make('Unexpected mode \"' . $mode . '\" given!');\n }\n\n // If no item set, set it mode indipendently\n\n if (empty($this->segments)) {\n $this->segments = $item;\n $this->segmentcount++;\n\n // Attach \"below\" (the easy way)\n //\n // This build the item chain from the top down.\n // The current item will be registered as the item below and\n // the current segment item stores them self as item above\n // inside. After, the current item is the new segment reference,\n // because it is the lowest!\n\n } else if ($mode == UrlSegmentItem::ATTACH_MODE_BELOW) {\n $this->segments->attachSegmentItemBelow($item);\n $this->segments = $item;\n $this->segmentcount++;\n\n // Attach \"above\" (have to finde the last item)\n //\n // This build the item chain from the lowest item up.\n // The current item will be stored. Then the last item is\n // searched. If the last item is reached, the given item\n // will be attached above.\n\n } else if ($mode == UrlSegmentItem::ATTACH_MODE_ABOVE) {\n\n // Store the current\n\n $current = $this->segments;\n\n // Iterate to the last item\n\n while ($current->isLastItem() === false) {\n $current = $current->getAbove();\n }\n\n // Attach the new item as item above\n\n $current->attachSegmentItemAbove($item);\n $this->segmentcount++;\n }\n\n // Calculate the new url weight\n\n $this->calculateNewWeight($item);\n\n // Set flags\n\n $this->updatePlaceholderFlag($item);\n $this->updateWildcardFlag($item);\n\n // Return self for chaining\n\n return $this;\n }",
"function append($data)\n {\n if(empty($data)) return;\n $this->childs[] = $data;\n }",
"public function appendChild($viewmodel, $name=null){ }",
"function PrependItem(wxTreeItemId $parent, $text, $image=-1, $selImage=-1, wxTreeItemData &$data=null){}",
"public function appendTo(Node &$newParent) {\n\t\t$newParent->children[] = $this;\n\t\t$this->_ = $newParent;\n\t}",
"protected function addToParent( SymfonyCommand $command )\n\t{\n\t\treturn parent::add( $command );\n\t}",
"public function add ($obj, $parent = false, $data = false) {\n\t\tif (is_array ($obj)) {\n\t\t\t$obj = (object) $obj;\n\t\t\tif (isset ($obj->attr) && is_array ($obj->attr)) {\n\t\t\t\t$obj->attr = (object) $obj->attr;\n\t\t\t}\n\t\t}\n\n\t\tif (! is_object ($obj)) {\n\t\t\t$data = $data ? $data : $obj;\n\t\t\t$obj = (object) array (\n\t\t\t\t'data' => $data,\n\t\t\t\t'attr' => (object) array (\n\t\t\t\t\t'id' => $obj,\n\t\t\t\t\t'sort' => 0\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// locate $parent and add child\n\t\tif ($parent && ($ref = $this->node ($parent))) {\n\t\t\tif (! isset ($ref->children)) {\n\t\t\t\t$ref->children = array ();\n\t\t\t}\n\t\t\t$obj->attr->sort = count ($ref->children);\n\t\t\t$ref->children[] = $obj;\n\t\t\t$ref->state = 'open';\n\t\t} else {\n\t\t\t$obj->attr->sort = count ($this->tree);\n\t\t\t$this->tree[] = $obj;\n\t\t}\n\n\t\treturn true;\n\t}",
"private function addChild($item)\r\n {\r\n $this->children[] = $item;\r\n }",
"public function testActionExecutionItemAppend() {\n // Test adding a value at the end.\n $list = ['One', 'Two', 'Three'];\n\n $this->action\n ->setContextValue('list', $list)\n ->setContextValue('item', 'Four')\n ->setContextValue('pos', 'end');\n\n $this->action->execute();\n\n // The list should contain four items, with the new item added at the end.\n $this->assertArrayEquals([\n 'One',\n 'Two',\n 'Three',\n 'Four',\n ], $this->action->getContextValue('list'));\n }",
"function append($left, $right) {\n return $left->append($right, $this->innerMonoid);\n }",
"public function useAppendMode()\n\t{\n\t\t$this->flag_file_append = true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of itsm_vars | public function setItsm_vars($itsm_vars)
{
$this->itsm_vars = $itsm_vars;
return $this;
} | [
"function setVariables($vars) {\n foreach($vars as $k=>$v) {\n $this->setVariable($k, $v);\n }\n }",
"public function getItsm_vars()\n {\n return $this->itsm_vars;\n }",
"public function setVars($variables);",
"public function setVars() {\r\n\t$this->varGlobalContener->save();\r\n}",
"abstract function set_var();",
"public function setVars($data = array())\n {\n foreach ($data as $name => $value) {\n $this->set($name, $value);\n }\n }",
"function port_vars( $vars )\n\t{\n\t\tglobal $errors, $cache;\n\t\t\n\t\t$errors->debug_info( $this->debug, 'Module loader', 'port_vars', 'Porting variables' );\n\t\t\n\t\t// because we don't wan't values disappearing we loop through this\n\t\tforeach ( $vars as $name => $val )\n\t\t{\n\t\t\t$this->variables[ '$' . $name ] = $val;\n\t\t\t$errors->debug_info( $this->debug, 'Module loader', 'port_vars', \"Porting variable $name with value $val\" );\n\t\t}\n\t\t// update the cache\n\t\t$this->_store();\n\t}",
"public static function set ()\n {\n $var = &self::$variables;\n $arguments = func_get_args ();\n $value = array_pop ( $arguments );\n foreach ( $arguments as $arg )\n {\n $var = &$var [ $arg ];\n }\n $var = $value;\n\n // Assign the variable to global namespace if we're parsing a view\n if ( isset ( self::$variables [ 'framework' ] [ 'in_view' ] ) )\n {\n $var = &$GLOBALS;\n foreach ( $arguments as $arg )\n {\n $var = &$var [ $arg ];\n }\n $var = $value;\n }\n }",
"protected function setInterpolationVars()\n {\n $this->interpolation_vars = array(\n 'PHPCI' => 1,\n 'PHPCI_COMMIT' => $this->build->getCommitId(),\n 'PHPCI_PROJECT' => $this->build->getProject()->getId(),\n 'PHPCI_BUILD' => $this->build->getId(),\n 'PHPCI_PROJECT_TITLE' => $this->build->getProject()->getTitle(),\n 'PHPCI_BUILD_PATH' => $this->buildPath,\n );\n }",
"public function loadvars()\n {\n $pp = explode(\",\", EMPS_VARS);\n foreach ($pp as $value) {\n $GLOBALS[$value] = $this->VA[$value];\n }\n }",
"protected function assign_variables($vars) {\n $this->out->assign_vars($vars);\n }",
"function setReqValue(){\n\t\tif (!$this->hasAttribute('i')){\n\t\t $varname=\"tmodule_\" . $this->name;\n\t\t\t$this->_value=$_REQUEST[$varname];\n\t\t}\t\t\n\t}",
"function set_var($tplvar,$val='')\n\t {\n\t\t $this->assign($tplvar,$val);\n\t }",
"public function set( $var, $value ) \n {\n\t\t$this->vars[$var] = $value;\n }",
"public function UpdateyActionVariables(){ self::$yAction['_LITE_']['VARS'] = get_object_vars($this); }",
"protected function setSessionVars($vars)\n {\n $GLOBALS[\"BE_USER\"]->setAndSaveSessionData($this->extensionName, $vars);\n }",
"function setVariable($key, $val);",
"public function getSetVariables() {}",
"function assign($var,$val) {\n\t\t$this->_viewVars[$var]=$val;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes extra tabs from a line of text. This is line fixer, removes tabs that may have crept into the line. Just makes the parser more friendly, not strictly speaking conforming to the iCal standard. | private function _fix_line($line) {
$line = preg_replace('/\A\t*/','',$line);
return $line;
} | [
"protected function removeTabs($text)\n\t{\n\t\treturn str_replace(\"\\t\", \"\", $text);\n\t}",
"public static function removeTabs($text)\n {\n if (strpos($text, \"\\t\") !== false) {\n return str_replace(\"\\t\", \" \", $text);\n }\n return $text;\n }",
"private function trim_line($line)\n {\n $trimmed = trim($line, \"\\n\\r\\0\\x0B\");\n\n return preg_replace(array(\n '/\\s*$/D',\n '/\\t/'\n ), array(\n '',\n ' ',\n ), $trimmed);\n }",
"protected function removeTab($response) {\n\t\t$response = preg_replace('/ {2,}/imu', ' ', $response);\n\t\treturn str_replace(\"\\t\", null, $response);\n\t}",
"function fix_tokens($line) {\n $tokens = explode(' ', $line);\n foreach($tokens as &$token) {\n $token = trim($token);\n }\n unset($token);\n\n return $tokens;\n}",
"function clean_data(&$str) {\n $str = preg_replace(\"/\\t/\", \"\\\\t\", $str);\n $str = preg_replace(\"/\\r?\\n/\", \"\\\\n\", $str);\n }",
"protected function clearLine($line){\n $line = str_replace('\\f','',$line);\n\n /*$pos = mb_strpos($line,'');\n if($pos !== false){\n $line = mb_substr($line,0,$pos);\n }*/\n\n return $line;\n }",
"public function stripTabsAndNewlines($value)\n {\n return str_replace([ \"\\t\", \"\\r\", \"\\n\"], '', $value);\n }",
"public function cleanLine($line)\n\t{\n\t\treturn ltrim($line, self::TOKEN_INDENT);\n\t}",
"function test_drop_whitespace_whitespace_line()\n {\n # line consists only of whitespace.\n $text = \"abcd efgh\";\n # Include the result for drop_whitespace=False for comparison.\n $this->check_wrap(\n $text,\n 6,\n [\"abcd\", \" \", \"efgh\"],\n array('drop_whitespace' => False)\n );\n $this->check_wrap($text, 6, [\"abcd\", \"efgh\"]);\n }",
"private function cleanLine($line) {\n return trim(preg_replace('/\\/\\*.*?\\*\\/\\s*/', '', $line));\n }",
"function _fix_indent($text, $tag) {\n\t\t$pattern = '/\\n[\\t ]*?\\{'.$tag.'\\}/';\n\t\tpreg_match($pattern, $text, $matches);\n\t\t$indent = str_replace(\"\\n\", '', $matches[0]);\n\t\t$indent = str_replace('{'.$tag.'}', '', $indent);\n\t\t// Remove tag indent to fix first one\n\t\t$text = preg_replace($pattern, \"\\n{\".$tag.\"}\", $text);\n\t\t\n\t\treturn array($text, $indent);\n\t}",
"function fix_indentation($s)\n{\n // Replace tabs by spaces\n $s = str_replace(\"\\t\", \" \", $s);\n $lines = explode(\"\\n\", $s);\n $num_spaces = 100000; // \"MAX_INT\"\n $out = \"\";\n // We skip the first and last line\n for ($i = 1; $i < count($lines) - 1; $i++)\n {\n $line = $lines[$i];\n if (trim($line) === \"\")\n \tcontinue; // Ignore empty lines in calculation\n $sp = strlen($line) - strlen(ltrim($line));\n $num_spaces = min($num_spaces, $sp);\n }\n for ($i = 1; $i < count($lines) - 1; $i++)\n {\n $line = $lines[$i];\n $out .= substr($line, $num_spaces).\"\\n\";\n }\n return $out;\n}",
"function add_tabs_to_lines($imploded_lines, $n_tabs) {\n\t// calculate tabs to append\n\t$tabs = str_repeat(\"\\t\", $n_tabs);\n\t\n\t// transforms isolated \\n in \\r\\n\n\t$imploded_lines = str_replace(\"\\n\", \"\\r\\n\", $imploded_lines);\n\t$imploded_lines = str_replace(\"\\r\\r\\n\", \"\\r\\n\", $imploded_lines);\n\n\t// transforms isolated \\r in \\r\\n\n\t$imploded_lines = str_replace(\"\\r\", \"\\r\\n\", $imploded_lines);\n\t$imploded_lines = str_replace(\"\\r\\n\\n\", \"\\r\\n\", $imploded_lines);\n\t\n\t// set tabs after each carriage return\n\t$html = str_replace(\"\\r\\n\", \"\\r\\n\" . $tabs, $imploded_lines);\n\t\n\t// return the html without last carriage return\n\treturn rtrim(str_replace(\" \", \"\\t\", $html));\n}",
"public static function removeSpaces($text) {\n\t\t$cleaned = str_replace ( \" \", \"\", $text );\n\t\t$cleaned = str_replace ( \"\\t\", \"\", $cleaned );\n\t\treturn $cleaned;\n\t}",
"function _unIndent($str)\n {\n // remove leading newlines\n $str = preg_replace('/^[\\r\\n]+/', '', $str);\n // find whitespace at the beginning of the first line\n $indent_len = strspn($str, \" \\t\");\n $indent = substr($str, 0, $indent_len);\n $data = '';\n // remove the same amount of whitespace from following lines\n foreach (explode(\"\\n\", $str) as $line) {\n if (substr($line, 0, $indent_len) == $indent) {\n $data .= substr($line, $indent_len) . \"\\n\";\n }\n }\n return $data;\n }",
"function cleanSpaceBeforeTabFromPhp(string $source): string\n{\n return tidyPhpCode($source, function (string $src) {\n return cleanSpaceBeforeTab($src);\n });\n}",
"private function strip_linefeeds($line) {\n return str_replace(array(\"\\015\", \"\\012\"), '', $line);\n }",
"private function applyCSS_INDENTATION($str_line){\n\t\t$str_styled = str_replace('\t', '<span CLASS=\"tab\"> </span>', $str_line);\n\t\t\n\t\treturn $str_styled;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
filter the admin columns by order status | public function ash_orders_filter_columns()
{
$type = 'post';
if ( isset($_GET['post_type']) ) {
$type = $_GET['post_type'];
}
if ( $this->cpt_prefix == $type ) {
$values = [
'Pending Payment' => 'pending',
'Paid' => 'paid',
'Complete' => 'complete',
]; ?>
<select name="ash_orders_filter_by_type">
<option value=""><?php _e('Filter By Status', 'ash'); ?></option>
<?php
$current_v = isset( $_GET['ash_orders_filter_by_type'] ) ? $_GET['ash_orders_filter_by_type'] : '';
foreach ( $values as $label => $value ) {
printf
(
'<option value="%s"%s>%s</option>',
$value,
$value == $current_v ? ' selected="selected"' : '',
$label
);
}
?>
</select>
<?php
}
} | [
"public function showAllOrderStatusesByAdmin()\n {\n if (Gate::allows('isAdmin')) {\n return $this->showAll(OrderStatus::all());\n } else {\n return $this->errorResponse(config('message.errors.unauthorized'), 403);\n }\n }",
"public function filteringByOrderStatus($order_status = '')\n {\n if ($order_status != '') {\n $orders = DB::select(\n 'SELECT DISTINCT\n id\n FROM\n orders\n WHERE \n order_status = :order_status\n AND\n deleted_at IS NULL',\n ['order_status' => $order_status]\n );\n\n $finishedOrderList = [];\n\n foreach ($orders as $order) {\n $finishedOrderList[] = $order->id;\n }\n\n $this->model = $this->model->whereIn('id', $finishedOrderList);\n }\n }",
"public function get_sortable_columns() {\n\t\t$columns = array(\n\t\t\t\t'date' \t => array( 'date', false ),\n\t\t\t\t'status' => array( 'status',false),\n\t\t);\n\t\treturn apply_filters( 'wcap_abandoned_orders_sortable_columns', $columns );\n\t}",
"public function filter_orders_by_export_status() {\n\t\tglobal $typenow;\n\n\t\tif ( 'shop_order' === $typenow ) {\n\n\t\t\t$count = $this->get_order_count();\n\n\t\t\t$terms = array(\n\t\t\t\t0 => (object) array( 'count' => $count['not_exported'], 'term' => __( 'Not Exported to CSV', 'woocommerce-customer-order-csv-export' ) ),\n\t\t\t\t1 => (object) array( 'count' => $count['exported'], 'term' => __( 'Exported to CSV', 'woocommerce-customer-order-csv-export' ) )\n\t\t\t);\n\n\t\t\t?>\n\t\t\t<select name=\"_shop_order_csv_export_status\" id=\"dropdown_shop_order_csv_export_status\">\n\t\t\t\t<option value=\"\"><?php _e( 'Show all orders', 'woocommerce-customer-order-csv-export' ); ?></option>\n\t\t\t\t<?php foreach ( $terms as $value => $term ) : ?>\n\t\t\t\t<option value=\"<?php echo esc_attr( $value ); ?>\" <?php echo esc_attr( isset( $_GET['_shop_order_csv_export_status'] ) ? selected( $value, $_GET['_shop_order_csv_export_status'], false ) : '' ); ?>>\n\t\t\t\t\t<?php printf( '%1$s (%2$s)', esc_html( $term->term ), esc_html( $term->count ) ); ?>\n\t\t\t\t</option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</select>\n\t\t\t<?php\n\t\t}\n\t}",
"public function setListSearchStatus() {\n if ($this->model && strlen($this->model->field_status)){\n if ($this->list_filter['status']>''){\n $status = $this->list_filter['status']+0;\n #if want to see trashed and not admin - just show active\n if ($status==127 && !$this->fw->model('Users')->isAccess('ADMIN')) $status=0;\n $this->list_where .= \" and \".$this->db->quote_ident($this->model->field_status).\"=\".$this->db->quote($status);\n }else{\n $this->list_where .= \" and \".$this->db->quote_ident($this->model->field_status).\"<>127\"; #by default - show all non-deleted\n }\n }\n }",
"function get_all_order_status(){\n return \\App\\Status::lists('name','id');\n }",
"protected function _applyOrderStatusFilter()\n { \n\n if (is_null($this->_orderStatus) || !$this->_orderStatus) {\n return $this;\n } \n $orderStatus = $this->_orderStatus; \n if (is_array($orderStatus)) {\n if (count($orderStatus) == 1 && strpos($orderStatus[0],',')!== false) {\n $orderStatus = explode(\",\",$orderStatus[0]);\n }\n } \n if (!is_array($orderStatus)) { \n $orderStatus = explode(\",\",$orderStatus);\n } \n $this->getSelect()->where($this->_status_field.' IN(?)', $orderStatus); \n return $this;\n }",
"public function findAllOrdersByStatus()\n {\n return $this->createQueryBuilder('o')\n ->addSelect('c')\n ->addSelect('ol')\n ->addSelect('p')\n ->join('o.customer', 'c')\n ->join('o.orderLines', 'ol')\n ->join('ol.product', 'p')\n ->orderBy('o.status', 'ASC')\n ->getQuery()\n ->getResult();\n }",
"public function getOrderUpdateOptions() {\n $queryStr = \"SELECT status_id, name FROM order_statuses\";\n return $this->_registry->getObject('db')->makeDataArray($queryStr, 'status_id', 'name');\n }",
"protected function _applyOrderStatusFilter()\n {\n if (is_null($this->_orderStatus)) {\n return $this;\n }\n $orderStatus = $this->_orderStatus;\n if (!is_array($orderStatus)) {\n $orderStatus = array($orderStatus);\n }\n $this->getSelect()->where('e.status IN(?)', $orderStatus);\n return $this;\n }",
"public static function orderStatusOptions()\n\t{\n\t\t$db = JFactory::getDBO();\n\t\t\n\t\t$query = \"SELECT * FROM #__mymuse_order_status ORDER BY `ordering`\";\n\t\t$db->setQuery($query);\n\t\t$results = $db->loadObjectList();\n\t\t\n\t\t// Build the active state filter options.\n\t\t$options = array();\n\t\tforeach ($results as $res){\n\t\t\t$key = $res->code;\n\t\t\t$val = $res->name;\n\t\t\t$options[] = JHtml::_('select.option', \"$key\", \"$val\");\n\t\t}\n\n\t\treturn $options;\n\t}",
"protected function display_filter_by_status() {\n\t\t$this->status_counts = $this->store->action_counts();\n\t\tparent::display_filter_by_status();\n\t}",
"protected function _applyOrderStatusFilter()\n {\n if (is_null($this->_orderStatus)) {\n return $this;\n }\n $orderStatus = $this->_orderStatus;\n if (!is_array($orderStatus)) {\n $orderStatus = array($orderStatus);\n }\n $this->getSelect()->where('status IN(?)', $orderStatus);\n return $this;\n }",
"function wprss_feed_sortable_columns() {\n $sortable_columns = array(\n // meta column id => sortby value used in query\n 'state'\t\t\t=> 'state',\n 'title'\t\t\t=> 'title',\n\t\t\t'updates'\t\t=>\t'updates',\n\t\t\t'feed-count'\t=>\t'feed-count'\n );\n return apply_filters( 'wprss_feed_sortable_columns', $sortable_columns );\n }",
"function getAdminStatus()\n {\n return $this->getOrder()->getOrderStatus();\n }",
"function orderStatus($order_id) {\n $result = resultAssociate(\"SELECT tag.title FROM `nfw_order_status` as nos join nfw_order_status_tag as tag on nos.status = tag.id where nos.order_id = $order_id \");\n return $result;\n }",
"abstract protected function prepareStatusOrder(array $order);",
"private function filter_order_by($order_by)\n {\n }",
"private function order() {\n if (isset($this->request['order']) && count($this->request['order'])) {\n $orderBy = array();\n $dtColumns = self::pluck($this->columns, 'dt');\n\n for ($i = 0, $ien = count($this->request['order']); $i < $ien; $i++) {\n // Convert the column index into the column data property\n $columnIdx = intval($this->request['order'][$i]['column']);\n $requestColumn = $this->request['columns'][$columnIdx];\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\n $column = $this->columns[$columnIdx];\n\n if ($requestColumn['orderable'] == 'true') {\n $dir = $this->request['order'][$i]['dir'] === 'asc' ?\n ' ASC' :\n ' DESC';\n\n $orderBy[] = $column['db'] . $dir;\n }\n }\n $this->query->orderBy(implode(', ', $orderBy));\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get stream meta data. | public function getStreamMetaData(): array
{
return \stream_get_meta_data($this->getStream());
} | [
"public function getMetaData() {\n\t\treturn stream_get_meta_data($this->handle);\n\t}",
"function stream_get_meta_data($stream)\n{\n if (\\PhowerTest\\Http\\StreamTest::$streamGetMetaDataReturns !== null) {\n return \\PhowerTest\\Http\\StreamTest::$streamGetMetaDataReturns;\n }\n return \\stream_get_meta_data($stream);\n}",
"private function getStreamMetaData() : array\n {\n if ($this->streamSocket === null) {\n throw new ConnectionLostException();\n }\n \n return \\stream_get_meta_data($this->streamSocket);\n }",
"function stream_get_meta_data ($fp) {}",
"public function getMetaData()\n {\n return $this->metaData;\n }",
"function getMetaData(){\n return $this->meta;\n }",
"private function getMetaData ()\n\t\t{\n\t\t\t$data = file_get_contents (\"META.inf\");\n\t\t\t$o = json_decode ($data,true);\n\t\t\treturn $o;\t\n\t\t}",
"public function getMetaInformation()\n {\n return $this->metaInformation;\n }",
"public function get_feed_meta() {\n\t\t\t$feed = $this->get_feed();\n\n\t\t\treturn rgar( $feed, 'meta' );\n\t\t}",
"protected function getMetaData()\n\t{\n\t\treturn $this->data = json_decode(file_get_contents($this->meta_file), true);\n\t}",
"public function getResponseMeta()\n {\n return $this->response['meta'];\n }",
"protected function get_stream_meta($stream_id, $task_id, $key) {\n $result = $this->get_db()->query(\n \"SELECT value FROM \".STREAM_META_TABLE.\n \" WHERE task_id = \".sqlite_escape_string($task_id).\n \" WHERE stream_id = \".sqlite_escape_string($stream_id).\n \" WHERE key = \".sqlite_escape_string($key).\n \";\"\n );\n\n return $this->get_all_results($result);\n }",
"public function getMetaData() {\n\t\tif (!$this->meta) {\n\t\t\t$provider = $this->fileSystem->getFileMetaDataProvider();\n\t\t\t$this->meta = $provider->getMetaData($this);\n\t\t}\n\n\t\treturn $this->meta;\n\t}",
"public function getMeta()\n {\n return $this->getValue('meta');\n }",
"public function meta()\n {\n return $this->meta;\n }",
"public function meta() \n\t{\n\t\treturn $this->envelope()->meta;\n\t}",
"public function getMetaData(){\n if(!file_exists($this->fileName)){\n echo \"Error! {$this->fileName} does not exist.<br />\";\n return false;\n }\n if(!is_readable($this->fileName)){\n echo \"Error! Could not read the file. Check the file permissions.<br />\";\n return false;\n }\n $f = @fopen($this->fileName,\"rb\");\n if(!$f){\n echo \"Unknown Error! Could not read the file.<br />\";\n return;\n }\n $signature = fread($f,3);\n if($signature != \"FLV\"){\n echo \"Error! Wrong file format.<br />\";\n return false;\n }\n $this->metaData[\"version\"] = ord(fread($f,1));\n $this->metaData[\"size\"] = filesize($this->fileName);\n\n $flags = ord(fread($f,1));\n $flags = sprintf(\"%'04b\", $flags);\n $this->typeFlagsAudio = substr($flags, 1, 1);\n $this->typeFlagsVideo = substr($flags, 3, 1);\n\n for ($i=0; $i < 4; $i++) {\n $this->metaData[\"headersize\"] += ord(fread($f,1)) ;\n }\n\n $this->buffer = fread($f, 400);\n fclose($f);\n\tif(strpos($this->buffer, \"onMetaData\") === false){\n echo \"Error! No MetaData Exists.<br />\";\n return false;\n } \n\n foreach($this->metaData as $k=>$v){\n $this->parseBuffer($k);\n }\n\n return $this->metaData;\n }",
"public function getMetadata($key = null)\n {\n if (!isset($this->stream)) {\n return $key ? null : [];\n }\n $meta = stream_get_meta_data($this->stream);\n if ($key) {\n return $meta[$key] ?? null;\n }\n return $meta;\n }",
"public function getMetadata();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
echos a partial string which fits within the range_from and range_to limits the ofs parameter is the current offset within the output stream and is being incremented by the length of the input string. the function returns true in case we passed the range_to limit | public function echo_range($s, &$ofs, $range_from, $range_to, $len = -1)
{
// 0123456789
//s 2345678
//ofs 2
//range_from 5
//range_to 7
if ($len == -1)
$len = strlen($s);
$start = max($ofs, $range_from);
$end = min($ofs + $len - 1, $range_to);
$start -= $ofs;
$end -= $ofs;
echo substr($s, $start, $end - $start + 1);
$ofs += $len;
return $ofs > $range_to;
} | [
"function string_between($string, $start, $end)\n{\n $result = false;\n\n if ($start === $end && substr_count($string, $start) < 2)\n return $result;\n\n if (strlen($string) > 1 && string_contains($string, $start) && string_contains($string, $end))\n {\n $ini = strpos($string, $start) + strlen($start);\n $string = substr($string, $ini);\n\n if (!string_contains($string, $end))\n return $result;\n\n $len = strpos($string, $end);\n $s = substr($string, 0, $len);\n\n $result = $s;\n }\n\n return $result;\n}",
"static function f_Loc_EnlargeToStr(&$Txt,&$Loc,$StrBeg,$StrEnd) {\r\n\r\n\t// Search for the begining string\r\n\t$Pos = $Loc->PosBeg;\r\n\t$Ok = false;\r\n\tdo {\r\n\t\t$Pos = strrpos(substr($Txt,0,$Pos),$StrBeg[0]);\r\n\t\tif ($Pos!==false) {\r\n\t\t\tif (substr($Txt,$Pos,strlen($StrBeg))===$StrBeg) $Ok = true;\r\n\t\t}\r\n\t} while ( (!$Ok) && ($Pos!==false) );\r\n\r\n\tif ($Ok) {\r\n\t\t$PosEnd = strpos($Txt,$StrEnd,$Loc->PosEnd + 1);\r\n\t\tif ($PosEnd===false) {\r\n\t\t\t$Ok = false;\r\n\t\t} else {\r\n\t\t\t$Loc->PosBeg = $Pos;\r\n\t\t\t$Loc->PosEnd = $PosEnd + strlen($StrEnd) - 1;\r\n\t\t}\r\n\t}\r\n\r\n\treturn $Ok;\r\n\r\n}",
"function cut_string($str, $from, $to){\n $start = strpos($str,$from) + strlen($from);\n if (strpos($str,$from) === false) return false;\n $length = strpos($str,$to,$start) - $start;\n if (strpos($str,$to,$start) === false) return false;\n return substr($str,$start,$length);\n }",
"public function endsWith($fragment) {\n $l= strlen($fragment);\n return $l > 0 && $l <= $this->length() && 0 === substr_compare($this->buffer, $fragment, -$l, $l);\n }",
"function CountCharacters($startPos, $endPos){}",
"function inRange($position, $starting_point, $ending_point) {\n if ($position >= $starting_point && $position <= $ending_point) {\n return true;\n }\n return false;\n}",
"private static function ends($s)\n {\n $len = strlen($s);\n $loc = self::$k - $len + 1;\n if ($loc < 0 ||\n substr_compare(self::$buffer, $s, $loc, $len) != 0) {\n return false;\n }\n self::$j = self::$k - $len;\n return true;\n }",
"public function append(): bool\n {\n return str_ends_with($this->fmt->getPattern(), '¤');\n }",
"public static function strUntil($haystack, $until, &$strPos = 0) {\n\t\t\tif ($strPos >= strlen($haystack)) {\n\t\t\t\t$strPos = strlen($haystack);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$untilPos = strpos($haystack, $until, $strPos);\n\t\t\tif ($untilPos === false) $untilPos = strlen($haystack);\n\t\t\t$nbr = $untilPos - $strPos;\n\t\t\t$result = substr($haystack, $strPos, $nbr);\n\t\t\t$strPos += $nbr + strlen($until);\n\n\t\t\t$strLen = strlen($haystack);\n\t\t\tif ($strPos > $strLen) {\n\t\t\t\t$strPos = $strLen;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}",
"public static function rangelength( $str, $minlength, $maxlength )\r\n\t\t{\r\n\t\t\t\r\n\t\t\t// If the string is in the range given, then return true\r\n\t\t\treturn ( (strlen( $str ) >= $minlength) && (strlen( $str ) <= $maxlength) );\r\n\r\n\t\t}",
"function str_ievpifr($number, $rmin, $rmax)\r\n{\r\n if (\r\n str_ievpi($number) &&\r\n ($number >= $rmin) &&\r\n ($number <= $rmax)\r\n ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}",
"static function f_Loc_EnlargeToStr(&$Txt,&$Loc,$StrBeg,$StrEnd) {\n\n\t\t// Search for the begining string\n\t\t$Pos = $Loc->PosBeg;\n\t\t$Ok = false;\n\t\tdo {\n\t\t\t$Pos = strrpos(substr($Txt,0,$Pos),$StrBeg[0]);\n\t\t\tif ($Pos!==false) {\n\t\t\t\tif (substr($Txt,$Pos,strlen($StrBeg))===$StrBeg) $Ok = true;\n\t\t\t}\n\t\t} while ( (!$Ok) && ($Pos!==false) );\n\n\t\tif ($Ok) {\n\t\t\t$PosEnd = strpos($Txt,$StrEnd,$Loc->PosEnd + 1);\n\t\t\tif ($PosEnd===false) {\n\t\t\t\t$Ok = false;\n\t\t\t} else {\n\t\t\t\t$Loc->PosBeg = $Pos;\n\t\t\t\t$Loc->PosEnd = $PosEnd + strlen($StrEnd) - 1;\n\t\t\t}\n\t\t}\n\n\t\treturn $Ok;\n\n\t}",
"public function testUntil()\n {\n $this->assertSame(\"Hello\", Str::until(\"Hello world!\", \" \"));\n }",
"function print_content_char_limit($content,$char_limit , $end_string){\n echo substr($content, 0,$char_limit).$end_string;\n}",
"function f_revsrch_StrposUntilOffset($txt, $what, $offset) {\r\n\t$p = $offset;\r\n\t$b = -1;\r\n\twhile ( (($p=strpos($txt, $what,$b+1))!==false) && ($p<$offset) ) {\r\n\t\t$b = $p; // continue to search\r\n\t}\r\n\tif ($b<0) {\r\n\t\treturn false;\r\n\t} elseif ($p===$offset) {\r\n\t\treturn $offset;\r\n\t} else {\r\n\t\treturn $b;\r\n\t}\r\n}",
"function is_between ($input, $min, $max)\n{\n $n = mb_strlen($input);\n return $min <= $n && $n <= $max;\n}",
"public function testSubstringOutOfRange($start, $end) {\n\t\t$str = new \\Scrivo\\Str(\"a€cdëf\");\n\t\t$this->setExpectedException(\"\\Scrivo\\SystemException\");\n\t\t$tmp = $str->substring($start, $end);\n\t}",
"public function isLengthInRange($name, $minLength, $maxLength, $msg, $callback = null);",
"public function testSubstringOutOfRange($start, $end) {\n\t\t$str = new ByteArray(self::testStr);\n\t\t$this->setExpectedException(\"\\Scrivo\\SystemException\");\n\t\t$tmp = $str->substring($start, $end);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets query for [[AssetType]]. | public function getAssetType()
{
return $this->hasOne(AssetType::className(), ['asset_type_id' => 'asset_type_id']);
} | [
"public function getAssetType()\n {\n return $this->asset_type;\n }",
"public function gettypeAssetId()\n {\n return $this->typeasset_id;\n }",
"public function getAssetTypes()\n {\n return $this->hasMany(AssetType::className(), ['asset_gl_acc_id' => 'account_id']);\n }",
"public function scopeByType(Builder $query, string $assetType)\n {\n return $query->where('type', '=', $assetType);\n }",
"public function assetTypes()\n {\n return $this->apiClient->get(ApiEndPoint::ASSETS);\n }",
"public function getAssetTypes()\n {\n return $this->asset_types;\n }",
"public static function getAssetTypes()\n {\n return static::$_assetTypes;\n }",
"private function get_asset( string $type = '', string $asset_name = '' ) {\n if ( ! in_array( $type, array( 'css', 'js' ) ) || empty( $asset_name ) ) {\n return null;\n }\n\n $registered_type = ( 'css' === $type ) ? $this->registered_css : $this->registered_js;\n\n foreach ( $registered_type as &$asset ) {\n if ( $asset_name === $asset['name'] ) {\n return $asset;\n }\n }\n\n return null;\n }",
"function assetTypeInAsset ( $asset_type_id )\n {\n\n $q = Doctrine_Query::create ()\n ->from ( 'AssetType at' )\n ->innerJoin ( 'at.Asset a' )\n ->where ( 'a.asset_type_id = ?' , $asset_type_id )\n ->limit ( 1 );\n\n $results = $q->execute ();\n return ($results->count () == 0 ? false : true);\n }",
"public function mediaTypeWhere() {}",
"public function getAssetFieldTypeView()\n {\n return $this->asset_field_type_view;\n }",
"public function setType($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Ads\\GoogleAds\\V8\\Enums\\AssetTypeEnum\\AssetType::class);\n $this->type = $var;\n\n return $this;\n }",
"public function getAssetTypesRequest()\n {\n\n $resourcePath = '/AssetTypes';\n $formParams = [];\n $queryParams = [];\n $httpBody = null;\n $multipart = false;\n\n \n\n\n\n // Body parameter\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n \n // For model (json/xml)\n\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present.\n\n if ($headers['Content-Type'] === 'application/json') {\n $httpBodyText = $this->jsonEncode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBodyText = $_tempBody;\n }\n\n $httpBody = $this->createStream($httpBodyText);\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n\n // FIXME: how do we do multiparts with PSR-7?\n // MultipartStream() is a Guzzle tool.\n\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = $this->createStream($this->jsonEncode($formParams));\n\n } else {\n // for HTTP post (form)\n $httpBody = $this->createStream($this->buildQuery($formParams));\n }\n }\n\n\n return $this->buildHttpRequest(\n $headers,\n $queryParams,\n $httpBody,\n 'GET',\n $resourcePath\n );\n }",
"public function getType()\n {\n return $this->query['type'];\n }",
"public function getAssetTransferType();",
"protected static function find_all($asset_type, $criteria = array()) {\r\n\r\n\t\t$method = \"assets/$asset_type\";\r\n\t\t$type = Videojuicer_Request::GET;\r\n\t\t$response_class = \"Videojuicer_Asset_\" . ucfirst($asset_type) . \"_List_Response\";\r\n\t\t$exception_class = \"Videojuicer_Asset_\" . ucfirst($asset_type) . \"_List_Exception\";\r\n\t\t$permission = Videojuicer_Permission::NONE;\r\n\t\t$attributes = Videojuicer_Request::wrap_vars($criteria, \"asset\");\r\n\t\t\r\n\t\t\r\n\t\t$request = new Videojuicer_Request($method, $type, $permission, $response_class, $exception_class);\r\n\t\t$request->set_vars($attributes);\r\n\t\t\r\n\t\treturn Videojuicer::execute_call($request);\r\n\t}",
"public function getAssetTypes1()\n {\n return $this->hasMany(AssetType::className(), ['accdep_gl_acc_id' => 'account_id']);\n }",
"protected function getTypeQuery()\n\t{\n\t\treturn $this->getConfigData('type_query');\n\t}",
"public function cekType() { \n $asset_type = request('type');\n\n if(empty($asset_type)) {\n return response('', 200);\n }\n\n $asset_data = DB::table('asset_type')\n ->select('id')\n ->where('type', '=', $asset_type)\n ->limit(1)\n ->get();\n\n if($asset_data->count()) {\n return response('false', 200); // Sudah ada\n }\n\n return response('true', 200);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the extension installer form | public function installform()
{
$app = &JFactory::getApplication();
$model = &$this->getModel('Install');
$view = &$this->getView('Install');
$ftp = &JClientHelper::setCredentialsFromRequest('ftp');
$view->assignRef('ftp', $ftp);
$view->setModel($model, true);
$view->display();
} | [
"public function showInstallerApp() {\n\t\t$doc = JFactory::getDocument();\n\t\t$this->loadJQuery($doc);\n\t\t$this->loadBootstrap($doc);\n\t\t$doc->addStylesheet ( JUri::root ( true ) . '/administrator/components/com_jmap/css/cpanel.css' );\n\t\t$doc->addScript ( JUri::root ( true ) . '/administrator/components/com_jmap/js/installer.js' );\n\t\n\t\t// Set layout\n\t\t$this->setLayout('default');\n\t\n\t\t// Format data\n\t\tparent::display ('installer');\n\t}",
"function cp_bsf_extensioninstaller_heading()\n{\n return CP_PLUS_NAME . ' Addons';\n}",
"function showInstall()\n {\n /** @var \\Base $f3 */\n $f3 = \\Base::instance();\n\n if (!$this->isInstalled()) {\n// $f3->set('languages', $f3->get('languages'));\n echo Template::instance()->render('installation/install.php');\n } else {\n // todo: change to template\n echo \"WorkTime ist already installed\";\n }\n\n }",
"function cp_extensioninstaller_heading()\n{\n return CP_PLUS_NAME . ' Addons';\n}",
"public static function showForm(){\n\t\tinclude Registry::instance()->getPluginDir() . \"admin/views/settings.php\";\n\t}",
"public function action_plugin_ui_configure ( ) {\n\t\t$ui = new FormUI('addon_catalog');\n\n\t\t$ui->append( 'checkbox', 'use_basepath', 'addon_catalog__keep_pages', _t( 'Use a base path: ', 'addon_catalog' ) );\n\t\t$ui->append( 'text', 'basepath', 'addon_catalog__basepath', _t( 'Base path (without trailing slash), e.g. <em>explore</em> :', 'addon_catalog' ) );\n\t\t$ui->append( 'text', 'date_format', 'addon_catalog__date_format', _t( 'Release Date format :', 'addon_catalog' ) );\n\n\t\t$ui->append( 'submit', 'save', _t( 'Save', 'addon_catalog' ) );\n\n\t\t$ui->out();\n\t}",
"public function cp_extensioninstaller_heading() {\r\n\t\t\treturn __( 'Addons', 'convertpro' );\r\n\t\t}",
"private function update_form()\n\t{\n\t\t$this->title = sprintf(lang('update_title'), $this->installed_version, $this->version);\n\t\t$vars['action'] = $this->set_qstr('do_update');\n\t\t$this->set_output('update_form', $vars);\n\t}",
"public function show() {\n\t\trequire_once(WCF_DIR.'lib/acp/form/PackageUpdateAuthForm.class.php');\n\t\tnew PackageUpdateAuthForm($this);\n\t\texit;\n\t}",
"public function showInstaller()\n {\n /**\n * If we're already installed display user friendly message and direct them to the appropriate next steps.\n *\n * @todo Check if DB is installed etc.\n * @todo Add some automated checks to see exactly what the state of the install is. Potentially would be nice to\n * allow the user to restart the install process\n */\n if (file_exists(base_path('installed'))) {\n return view('Installer.AlreadyInstalled', $this->data);\n }\n\n\n return view('Installer.Installer', $this->data);\n }",
"public abstract function outputSetupForm();",
"static function showAddExtAuthForm() {\n\n if (!Session::haveRight(\"user\", self::IMPORTEXTAUTHUSERS)) {\n return false;\n }\n\n echo \"<div class='center'>\\n\";\n echo \"<form method='post' action='\".Toolbox::getItemTypeFormURL('User').\"'>\\n\";\n\n echo \"<table class='tab_cadre'>\\n\";\n echo \"<tr><th colspan='4'>\".__('Automatically add a user of an external source').\"</th></tr>\\n\";\n\n echo \"<tr class='tab_bg_1'><td>\".__('Login').\"</td>\\n\";\n echo \"<td><input type='text' name='login'></td></tr>\";\n\n echo \"<tr class='tab_bg_1'>\";\n echo \"<td class='tab_bg_2 center' colspan='2'>\\n\";\n echo \"<input type='submit' name='add_ext_auth_ldap' value=\\\"\".__s('Import from directories').\"\\\"\n class='submit'>\\n\";\n echo \"</td></tr>\";\n\n echo \"<tr class='tab_bg_1'>\";\n echo \"<td class='tab_bg_2 center' colspan='2'>\\n\";\n echo \"<input type='submit' name='add_ext_auth_simple' value=\\\"\".__s('Import from other sources').\"\\\"\n class='submit'>\\n\";\n echo \"</td></tr>\\n\";\n\n echo \"</table>\";\n Html::closeForm();\n echo \"</div>\\n\";\n }",
"protected function _showAppForm() {\n\t\tob_start();\n\t\trequire_once ROOTDIR . '/views/appform.phtml';\n\t\tViewController::setView(ob_get_clean());\n\t}",
"public function showEnableInstallToolButtonAction() {}",
"public function installListForm()\n {\n // Use the name to get details about this module.\n $modules = $this->getInstallableModules();\n\n if (count($modules) <= 0)\n throw new InvalidArgumentException(__('Sorry, no modules available to install'), 'modules');\n\n $this->getState()->template = 'module-form-install-list';\n $this->getState()->setData([\n 'modulesToInstall' => $modules,\n 'help' => $this->getHelp()->link('Module', 'Install')\n ]);\n }",
"function bframework_instllation_form(){\ninclude(bframework_installation('template').'form.php');\n}",
"public function output_setup_form() {\n\t\t$this->output_controls_html( 'convertkit' );\n\t}",
"protected function show_install_instructions()\n {\n echo get_class($this) . \" Installation Instructions:\\n\\n - \";\n echo implode(\"\\n - \", $this->install_instructions);\n echo \"\\n\";\n exit();\n }",
"function cplus_extension_installer() {\n\t\tinclude_once BSF_UPDATER_PATH . '/plugin-installer/index.php';\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of pdfName | public function setPdfName(?string $pdfName): void
{
$this->pdfName = $pdfName;
} | [
"private function setPdfRealName()\n {\n $sql = \"SELECT elabid FROM experiments WHERE id = :id\";\n $req = $this->pdo->prepare($sql);\n $req->bindParam(':id', $this->id);\n if (!$req->execute()) {\n throw new Exception('Cannot get elabid!');\n }\n $this->pdfRealName = $req->fetch(\\PDO::FETCH_COLUMN) . \"-timestamped.pdf\";\n }",
"function pdf_set_info_title(& $pdf, $value)\n\t{\n\tpdf_set_info($pdf, \"Title\", $value);\n\t}",
"protected function setName($name)\n\t{\n\t\t$this->pageName = $name;\n\t}",
"function set_name($p_name)\n {\n //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, \"PclXmlTag::set_name\", \"name='\".$p_name.\"'\");\n $v_result = PCLXML_ERR_NO_ERROR;\n \n $this->error_reset();\n\n if (!is_string($p_name)) {\n $v_result = PCLXML_ERR_INVALID_PARAMETER;\n $this->_error_set(PCLXML_ERR_INVALID_PARAMETER,\n 'Invalid type for p_name, string expected');\n //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);\n return $v_result;\n }\n \n $this->name = $p_name;\n \n // ----- Return\n //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);\n return $v_result;\n }",
"public function setInternalName( $value ) { $this->_internalName = $value; }",
"function setName($value) {\n $this->name = $value;\n }",
"private function setName(): void\n {\n $this->componentName = basename(get_class($this));\n $this->setFileName($this->componentName);\n }",
"protected function setName()\n {\n $this->DateName = 'Palmarum/Palmsonntag';\n }",
"public function setFileName( $name )\n {\n $this->properties[\"fileName\"] = $name;\n $this->properties[\"fileNameLength\"] = strlen( $name );\n }",
"public function setPageName($page_name) {\n $this->assign('__page_name', $page_name);\n }",
"public function setFileName($name_){\n\n $this->name = $name_;\n $this->updatePath();\n\n }",
"function pdf_set_info($pdfdoc, $fieldname, $value) {}",
"function setName($new_name)\n {\n\n $this->name = $new_name ;\n }",
"final public function setName($name) {\n\t\t$this->_external_name = $name;\n\t}",
"protected function set_name( string $new_name ) {\n\t\t\t$this->name = $new_name;\n\t\t}",
"function setFilename($name);",
"function setName($name)\n {\n $this->name = cleanGPC($name);\n }",
"public function set_name( $name ) {\n $this->post_name = sanitize_title( $name );\n }",
"public function setFinalFileName($name){\n $this->final_file_name = $name;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get last $num recipies | public static function getLastRecipies($num) {
if (DB::table('posts')->count() <= $num )
{
return DB::table('posts')->where('postStatus_id','=', 3)->orderBy('created_at', 'desc')->get();
} else {
return DB::table('posts')->where('postStatus_id','=', 3)->orderBy('created_at', 'desc')->take($num)->get();
}
} | [
"public function last()\n {\n return array_values(array_slice($this->working_array, -1))[0];\n }",
"public function last(){\r\n return end($this->_results);\r\n }",
"public function getRecentImg($num) {\n $this->db->order_by(\"id\", \"desc\"); // get all pictures descendant order\n $images = $this->db->get($this->_tableName,$num,0);\n return $images->result();// get array of images\n }",
"function GetLastResult()\n {\n \treturn $this->results;\n }",
"function get_last_image_number()\n\t{\n\t\t$sql = \"SELECT * FROM $this->table_image_list ORDER BY image_number DESC LIMIT 1\";\n\t\t\n \t\t$result = $this->conn->query($sql);\n \t\t$row = $result->fetch_assoc();\n \t\t\n\t\treturn $row [\"image_number\"];\n\n\t}",
"public function getnoreg(){\n \t$__thnproses = date(\"Y\");\n $sql_find = DB::select(\"SELECT COALESCE(max(spt_nomor)+1,1) as max_no_spt FROM spt WHERE spt_periode=? \",[$__thnproses]);\n $spt_no = $sql_find[0]->max_no_spt;\n\n $sql_find = DB::select(\"SELECT COALESCE(max(netapajrek_kohir)+1,1) as max_no_spt FROM penetapan_pajak_retribusi\n LEFT JOIN SPT ON SPT.spt_id=netapajrek_id_spt\n WHERE EXTRACT(YEAR FROM netapajrek_tgl)=? and\n spt.spt_periode=? \",[$__thnproses,$__thnproses]);\n $spt_kohir = $sql_find[0]->max_no_spt;\n $last_kohir=0;\n if($spt_no>$spt_kohir) $last_kohir=$spt_no;else\n if($spt_kohir>$spt_no) $last_kohir=$spt_kohir;else $last_kohir=$spt_no;\n\n return $last_kohir;\n }",
"public function getLastNPrices($symbol,$number){\n global $wpdb,$logger;\n $this->InitialiseVars();\n $logger->write_log (\"Getting last \".$number.\" prices for \".$symbol);\n\n $tablefinanceMonitorName = $wpdb->prefix . \"financeMonitor\";\n $tablefinanceMonitorStockDataName = $wpdb->prefix . \"financeMonitorStockData\"; \n \n $query =\"SELECT price FROM $tablefinanceMonitorStockDataName WHERE stockSymbol = '$symbol' ORDER BY id DESC LIMIT $number\";\n\n $retVal = $wpdb->get_col($query);\n \n $logger->write_log (\"Prices- \". implode(',',$retVal));\n \n return $retVal;\n }",
"function getLastResults() {\n return $this->lastResults;\n }",
"public function getLastNumber()\n {\n return $this->last_number;\n }",
"public static function nbrLastPart()\n\t\t{\n\t\t\t$dao = new DAO('pfe');\n\t\t\t$sql='SELECT * FROM Participant ORDER BY id DESC LIMIT 10';\n\t\t\t$result=$dao->getpdo()->query($sql);\n\t\t\twhile($dta=$result->fetch())\n\t {\n\t\t\t\t$L[] = new Participant($dta);\n\t\t\t}\n\t\t\t///print_r($L);\n\t\t\treturn $L;\n\t\t}",
"public function getLast() {\r\n return $this->value[$this->count - 1];\r\n }",
"function get_lastnumber_Cookie($data)\n\t{\n\t\t$cr_datalast=$this->cr->lastcr();\n\t\t//$this->pr($cr_data);\n\t\t//$data['cr_data'] = $cr_data2;\n\t\t$last_cr=(string)$cr_datalast[0]->cr_id;\n\t\tpreg_match_all('/^([^\\d]+)(\\d+)/', $last_cr, $match);\n\t\t\t\n\t\t$text = $match[1][0];\n\t\t$num = $match[2][0];\n\t\t//$last_cr=$last_cr+1;\n\t\t$num=$num+1;\n\t\tif(strlen($num)==3)\n\t\t{$num='0'.$num;}\n\t\t$last_cr=$text.$num;\n\t\t$data['last_cr']=$last_cr;\n\t\t\t\n\t\t\t\n\t\tif(!isset($_COOKIE['cr_processed_by'])) {\n\t\t\t$data['cookies']='';\n\t\t} else {\n\t\t\t//echo \"Cookie '\" . $cookie_name . \"' is set!<br>\";\n\t\t\t$data['cookies']= $_COOKIE['cr_processed_by'];\n\t\t}\n\t\treturn $data;\n\t\t///////////////////////////////////////////////////////// Last CR and Cookies\n\t}",
"function get_last_response_buffer($num)\n\t{\n\t\treturn $this->call(\"Raw.GetLastResponseBuffer?num=\".urlencode($num));\n\t}",
"public function last()\n {\n \treturn $this->get(count($this->_nodes) - 1);\n }",
"function getLast() {\n\t\treturn $this->_getItem($this->getCount() - 1);\n\t}",
"function zg_ai_get_last_value() {\n global $last_value;\n return $last_value;\n}",
"public function last()\n\t{\n\t\treturn array_pop($this->collection);\n\t}",
"function last($countable) {\n return $countable[count($countable) - 1];\n}",
"protected function lastBucket()\n {\n return end($this->buckets);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the default scopes used by this provider. This should not be a complete list of all scopes, but the minimum required for the provider user interface! | protected function getDefaultScopes()
{
return $this->defaultScopes;
} | [
"protected function getDefaultScopes()\n {\n return $this->scopes;\n }",
"public function getDefaultScopes()\n {\n\n return static::$defaultScopes;\n\n }",
"protected function getDefaultScopes() {\n return [];\n }",
"public function getDefaultScope()\n\t{\n\t\treturn $this->getOauthProvider()->getDefaultScope();\n\t}",
"protected function getAllScopes()\r\n {\r\n return config( 'shopify.scopes' );\r\n }",
"public static function registerDefaultScopes()\n {\n self::registerScope('none', new Scope\\None());\n self::registerScope('request', new Scope\\Request());\n self::registerScope('session', new Scope\\Session());\n }",
"public function getAvailableScopes()\n {\n return $this->_scopes;\n }",
"protected function getSupportedScopes() {\n return array();\n }",
"protected static function getSettingsScopes() : Collection\n {\n return collect(app(SettingsManager::class)::getDefaultScope());\n }",
"public function getDefaultScope();",
"public function getAvailScopes()\n {\n return $this->listPublicMethods('#scope([a-zA-Z]+)#');\n }",
"public function getScopes();",
"public function scopes()\n {\n return $this->get('v2/scopes');\n }",
"public function getScopes()\n {\n // We want all the available Nosto API tokens.\n return NostoApiToken::$tokenNames;\n }",
"public function get_scopes() {\n\t\treturn array(\n\t\t\t'https://www.googleapis.com/auth/analytics',\n\t\t\t'https://www.googleapis.com/auth/analytics.readonly',\n\t\t\t'https://www.googleapis.com/auth/analytics.manage.users',\n\t\t\t'https://www.googleapis.com/auth/analytics.edit',\n\t\t);\n\t}",
"public function getAllowedScopes();",
"public function defaultScope()\n\t{\n\t\treturn array(\n\t\t\t// Order newest first\n\t\t\t'order'=>$this->getTableAlias(false, false).'.id DESC',\n\t\t);\n\t}",
"public function scopes() {\n return array(\n 'recent' => array(\n 'order' => 'updatedAt DESC',\n 'limit' => 10,\n )\n );\n }",
"public function getReservedScopes()\n {\n return array('openid', 'offline_access');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function will remove the Post Parent for a particular snippet | public function remove_from_parent($key) {
if (empty($key)) { return false; }
// Make sure the key is in a valid format
$key = sanitize_title($key);
$post_id = $this->get_id($key);
if (!$post_id) { return; }
$info = $this->get_info($key);
$snippet = array(
'ID' => $post_id,
'post_type' => $this->post_type,
'post_name' => $key,
'post_status' => 'publish',
'post_title' => $info['title'],
'post_parent' => 0
);
$post_id = wp_insert_post($snippet);
if (!$post_id) {
return false;
}
return true;
} | [
"function bh_remove_empty_pgparent($post_id) {\n\t// verify this is not an auto save routine. \n if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;\n //authentication checks\n if (!current_user_can('edit_post', $post_id)) return;\n\t //obtain custom field meta for this post\n\tif(get_post_type($post_id)=='products'):\n\t $key = 'wpcf-product-group-parent';\n $pgparent = get_post_meta($post_id,$key,true);\n\t \t if(empty($pgparent)){\n\t\t delete_post_meta($post_id,$key); //Remove post's custom field\n\t\t }\n\t\t endif;\n}",
"function wpse_58799_remove_parent_category() {\n if ('category' != $_GET['taxonomy'])\n return;\n\n $parent = 'parent()';\n\n if (isset($_GET['action']))\n $parent = 'parent().parent()';\n ?>\n <script type=\"text/javascript\">\n jQuery(document).ready(function($)\n { \n $('label[for=parent]').<?php echo $parent; ?>.remove(); \n });\n </script>\n <?php\n}",
"public function parent() { return $this->post->post_parent; }",
"public function removeFromParent();",
"protected function removeParentCategoryFromPostNode(NodeInterface $node)\n {\n $parentCategory = (new FlowQuery([$node]))\n ->parent('[instanceof '. self::DOCUMENT_CATEGORY_TYPE .']')\n ->get(0);\n\n if ($parentCategory !== null) {\n $categories = $node->getProperty('categories');\n $index = array_search($parentCategory, $categories, true);\n if ($index !== false) {\n array_splice($categories, $index, 1);\n $node->setProperty('categories', $categories);\n }\n }\n }",
"function wp_get_post_parent_id($post = \\null)\n {\n }",
"public function getParentPostId()\n {\n return $this->base->post_parent ?: null;\n }",
"function removeFromParent()\n\t{\n\t \tif (isset($this->parent))\n\t \t{\n\t \t\t$index = $this->parent->getIndex($this);\n\t \t\t$this->parent->remove($index);\n\t \t}\n\t}",
"public function getPostParent()\n {\n return $this->post_parent;\n }",
"function me_rb4_give_children_parent_template() {\n\t\tglobal $post;\n\n\t\t$curr_tmp = get_post_meta( $post->ID, '_wp_page_template', true );\n\t\t$parent_tmp = get_post_meta( $post->post_parent, '_wp_page_template', true );\n\n\t\tif ( $post->post_parent ) :\n\t\t\tupdate_post_meta( $post->ID, '_wp_page_template', $parent_tmp,$curr_tmp );\n\t\tendif;\n\t}",
"public function parent_post_id() {\n\t\treturn $this->meta( 'wprm_parent_post_id', 0 );\n\t}",
"function dz_jetpack_remove_relatedposts() {\n if ( class_exists( 'Jetpack_RelatedPosts' ) && is_singular( 'albums' ) ) {\n $jprp = Jetpack_RelatedPosts::init();\n $callback = array( $jprp, 'filter_add_target_to_dom' );\n remove_filter( 'the_content', $callback, 40 );\n }\n}",
"public function getParent()\n {\n if ($this->parent === null) {\n if (($parentId = $this->getParentPostId()) !== null) {\n $this->parent = $this->postFactory->create(get_post($parentId));\n } else {\n $this->parent = false;\n }\n }\n\n return $this->parent ?: null;\n }",
"public function removeFromParent() {\n\t $child = dom_import_simplexml($this);\n \t $child->parentNode->removeChild($child);\n\t\t}",
"function fix_translated_parent($original_id, $translated_id, $lang_code, $language_code){\n global $wpdb;\n\n $icl_post_type = isset($_POST['post_type']) ? 'post_' . $_POST['post_type'] : 'post_page';\n\n $original_parent = $wpdb->get_var(\"SELECT post_parent FROM {$wpdb->posts} WHERE ID = {$translated_id} AND post_type = 'page'\");\n\n if (!is_null($original_parent)){\n if($original_parent){\n $trid = $this->get_element_trid($original_parent, $icl_post_type);\n\n if($trid){\n $translations = $this->get_element_translations($trid, $icl_post_type);\n\n if (isset($translations[$language_code])){\n $current_parent = $wpdb->get_var(\"SELECT post_parent FROM {$wpdb->posts} WHERE ID = \".$translated_id);\n if (!is_null($translations[$language_code]->element_id) && $current_parent != $translations[$language_code]->element_id){\n $wpdb->query(\"UPDATE {$wpdb->posts} SET post_parent={$translations[$language_code]->element_id} WHERE ID = \".$original_id);\n }\n }\n }\n }\n }\n }",
"function jetpackme_remove_rp() {\n\tif (class_exists('Jetpack_RelatedPosts')) {\n\t\t$jprp = Jetpack_RelatedPosts::init();\n\t\t$callback = array( $jprp, 'filter_add_target_to_dom' );\n\t\tremove_filter( 'the_content', $callback, 40 );\n\t}\n}",
"public function column_parent($post)\n {\n }",
"function has_post_parent($post = \\null)\n {\n }",
"public function createPlaceholdersAndDeleteDraftParentPage() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for paymentAddPut Add payment Only for Root/Admins/Agencies. | public function testPaymentAddPut()
{
} | [
"public function testPayWithPaymentAccount()\n {\n }",
"public function testPaymentsAdd()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testAddPaymentMethodIfItIsNotExistingYet()\n {\n\n }",
"public function testTeamMembersIdTeamBillingSubscriptionPlanPut()\n {\n\n }",
"public function testCreativeapprovalsCreativeIdPut()\n {\n }",
"public function testSavePayment()\n {\n }",
"public function testTeamMembersIdTeamBillingPut()\n {\n\n }",
"public function testModifyAdditionalServicesGroupUsingPUT()\n {\n }",
"public function testUpdatePay()\n {\n $this->json('PUT', '/booking/12/pay')\n ->seeJsonEquals([\n 'created' => true,\n ]);\n }",
"public function testWithholdingTaxesIdPut()\n {\n }",
"public function testCancelBrokerageOrderUsingPut()\n {\n }",
"public function testTeamMembersIdTeamBillingSourcePut()\n {\n\n }",
"public function testTaxInvoicesIdPut()\n {\n }",
"public function testSalesOrderPaymentTypesPATCHRequestPaymentTypesPaymentTypeIDUpdate()\n {\n }",
"public function testServiceOrderItemsPutServiceOrderItem()\n {\n }",
"public function testUcpPaymentMethodUpdate()\n {\n\n }",
"public function testPayAlreadyPaid()\n {\n $user = User::factory()->create();\n\n $this->artisan('passport:install');\n\n Passport::actingAs(\n $user,\n ['create-servers']\n );\n\n $order = Order::factory()->create([\n 'status' => 'COMPLETED',\n 'user_id' => $user->id\n ]);\n\n $response = $this->put('/api/v1/order/' . $order->id . '/pay', [\n 'payed' => true,\n ], [\n 'Accept' => 'application/json',\n ]);\n\n $response->assertStatus(403);\n }",
"public function testOrganizationsOrganizationIdAgenciesAgencyIdAdvertisersAdvertiserIdPut()\n {\n }",
"public function testPurchasesIdPut()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ countItem function v2.0 This function count number of item in table [this function accept parameters] $item = The item to count $table = the table to count from $condition = condition to select spesific recorde | function countItem($item, $table, $condition = null){
global $con;
if($condition === null){
$stmt3 = $con->prepare("SELECT COUNT($item) FROM $table");
$stmt3->execute();
}
else{
$stmt3 = $con->prepare("SELECT COUNT($item) FROM $table WHERE $item=?");
$stmt3->execute(array($condition));
}
return $stmt3->fetchColumn();
} | [
"function countItems($item, $table) {\n global $db;\n $selection = $db->prepare(\"SELECT COUNT($item) FROM $table\");\n $selection->execute();\n return $selection->fetchColumn();\n }",
"function countItems($item, $table){\n\t\t\tglobal $con;\n\n\t\t\t$stmt = $con->prepare(\"SELECT COUNT($item) FROM $table\");\n\t\t\t$stmt->execute();\n\n\t\t\treturn $stmt->fetchColumn();\n}",
"function countItems($item, $table) {\n\n\t\tglobal $con;\n\n\t\t$stmt2 = $con->prepare(\"SELECT COUNT($item) FROM $table\");\n\n\t\t$stmt2->execute();\n\n\t\treturn $stmt2->fetchColumn();\n\n\t}",
"function countItems($item, $table) {\r\n global $con;\r\n $stmt = $con->prepare(\"SELECT COUNT($item) FROM $table\");\r\n $stmt->execute();\r\n return $stmt->fetchColumn();\r\n }",
"function countItem($item,$table){\n\t global $con;\n\t $stmt2 = $con->prepare(\"SELECT COUNT($item) FROM $table\");\n\t $stmt2->execute();\n\t $num = $stmt2->fetchColumn();\n\t return $num;\n\t }",
"function countItems($item ,$table){\n\tglobal $conn;\n\t\t$stmt =$conn->prepare(\"SELECT COUNT($item) FROM $table\");\n\t\t$stmt->execute();\n\t\treturn $stmt->fetchColumn();\n}",
"function countanime($item, $table) {\n\n\t\tglobal $con;\n\n\t\t$stmt2 = $con->prepare(\"SELECT COUNT($item) FROM $table\");\n\n\t\t$stmt2->execute();\n\n\t\treturn $stmt2->fetchColumn();\n\n\t}",
"function countItems($count, $table) {\n global $con;\n $stmt = $con ->prepare(\"SELECT COUNT($count) FROM $table\");\n $stmt ->execute();\n return $stmt->fetchColumn();\n }",
"function countItem($item, $from) {\n global $con;\n $stmt = $con->prepare(\"SELECT COUNT($item) FROM $from\");\n $stmt->execute();\n return $stmt->fetchColumn();\n}",
"public function countItems(){\n $sqlQuery = 'SELECT * FROM Books';\n $statement = $this->_dbHandle->prepare($sqlQuery);\n $statement->execute();\n return $statement->rowCount();\n }",
"function getItemsCount($tbl){\n global $connect;\n $stmt = $connect->prepare(\"SELECT * FROM $tbl\");\n $stmt->execute();\n $count = $stmt->rowCount();\n\n return $count;\n }",
"function countElementsInTableForMyEntities($table, $condition = []) {\n $dbu = new DbUtils();\n return $dbu->countElementsInTableForMyEntities($table, $condition);\n}",
"function countItems($column, $table){\n global $con;\n $statement = $con->prepare(\"SELECT COUNT($column) FROM $table\");\n $statement->execute();\n $count = $statement->fetchColumn();\n return $count;\n}",
"function countItems($tableName , $colName , $moreParam){\n\t\t\n\t\tif($moreParam == null || $moreParam == ''){\n\t\t\t$moreParam = '';\n\t\t}\n\t\t\n\t\tglobal $db;\n\t\t$st = $db->prepare(\"SELECT COUNT($colName) AS count FROM $tableName $moreParam\");\n\t\t$st->execute();\n\t\treturn $st->fetchColumn();\n\t}",
"public function getTotalItemCategory($conditions='') {\n \n //no joining is donw with study period table as we dont need to display studyPeriod in the table listing\n \n $query = \"\tSELECT\tCOUNT(*) AS totalRecords \n\t\t\t\t\tFROM\titem_category\n\t\t\t\t\t\t\t$conditions \";\n return SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\n }",
"public function checkItemCategory($conditions='') {\n \n //no joining is donw with study period table as we dont need to display studyPeriod in the table listing\n \n $query = \"SELECT count(itemCategoryId) AS foundRecord \n FROM item_category \n $conditions \";\n return SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\n }",
"public function count($table, $structure, $filter);",
"function getChildrenCount ($item)\n\t{\n\t\tstatic $queries = null; // avoid unecessary multiple inclusions\n\t\tif($queries == null)\n\t\t{\n\t\t\t$type = strtolower($item->type);\n\t\t\tinclude (\"plugins/\".$type.\"s/sql/\".$type.\"Queries.php\");\n\t\t}\n\t\t$query = sprintf ($queries ['getChildrenCount'],\n\t\t\t$item->itemId, $item->owner);\n\t\t$result = $this->db->GetOne ($query);\n\t\tif (!$result)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\t}",
"function get_count_of($table){\n return $this->db->get($table)->num_rows();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the setPopulation() method. | public function testSetPopulation(): void {
$obj = new Commune();
$obj->setPopulation(1);
$this->assertEquals(1, $obj->getPopulation());
} | [
"public function initializePopulation() : void;",
"public function getPopulation();",
"public function getPopulation(){\n\t\treturn $this->population;\n\t}",
"public function getPopulation()\n {\n return $this->population;\n }",
"public function setPopulationS(?Json $value): void {\n $this->getBackingStore()->set('populationS', $value);\n }",
"public function test_setObservations()\n\t{\n\t\t$observations = [1, 2, 3];\n\t\t\n\t\t$sample = new Quantitative();\n\t\t\n\t\t$this->assertSame($sample, $sample->setObservations($observations));\n\t\t$this->assertEquals($observations, $sample->getObservations());\n\t\t\n\t\treturn;\n\t}",
"protected function debugPopulation()\r\n {\r\n \t\r\n \tfor($i = 0; $i < 1; $i ++){\r\n \t$this->debug ($this->debugMemory() . '|' . $this->getPopulationSize(). '|'. $this->getPopulationIncrement() . '|'. $this->getPopulationMutatePercent() . '|' .$this->getGeneMutatePercent() . '|' . $this->getGenerations().'|'.$this->getMember($i)->getFitness().'|'.$this->getMember($i)->getGeneToString() . PHP_EOL);\r\n \t}\r\n \t//$this->debug(PHP_EOL. PHP_EOL. PHP_EOL);\r\n \treturn $this;\r\n }",
"public function getPopulation(): int\n {\n return $this->population;\n }",
"public function __getPopulation(){\n return $this->$population\n }",
"public function testSetSituationGeo() {\n\n $obj = new Etablissements();\n\n $obj->setSituationGeo(\"situationGeo\");\n $this->assertEquals(\"situationGeo\", $obj->getSituationGeo());\n }",
"function newGeneration() {\n if($this->d) echo time().\" - GeneLIB : Initial pop = \". count($this->population) . \"\\n\";\n /* Select population */\n $this->population = $this->selector->selectNextGeneration($this->population);\n if($this->d) echo time().\" - GeneLIB : Population after tournament =\".count($this->population) . \"\\n\";\n /* Now do crossover */\n// $this->crossover_strategy->\n if($this->d) echo time(). \" - GeneLIB: Final pop = \". count($this->population) . \"\\n\";\n //Do mating, do mutation\n return $this->population;\n}",
"public static function getPopulation() {\n\t\t\treturn self::$populationPokemons;\n\t\t}",
"public function testSetCodePostal() {\n\n $obj = new Prospects();\n\n $obj->setCodePostal(\"codePostal\");\n $this->assertEquals(\"codePostal\", $obj->getCodePostal());\n }",
"public function testGetSetImpact()\n {\n $impact = 12;\n $this->manager->setImpact($impact);\n $this->assertEquals(\n $impact,\n $this->manager->getImpact()\n );\n }",
"protected function setUp() {\n\t\t$this->stack = new Stack( array(1, 2, 3));\n\t}",
"public function testSetModulation() {\n\n $obj = new EmployesProprete();\n\n $obj->setModulation(true);\n $this->assertEquals(true, $obj->getModulation());\n }",
"protected function _populateRegistry() {\n\t\t// Clear any existing data.\n\t\t\\Bedrock\\Common\\Registry::clear();\n\n\t\t// Mock: Config\n\t\t$mockConfig = new \\Bedrock\\Common\\Config(array(\n\t\t\t'root' => array(\n\t\t\t\t'web' => ''\n\t\t\t),\n\t\t\t'template' => 'default'\n\t\t), false);\n\n\t\t\\Bedrock\\Common\\Registry::set('config', $mockConfig);\n\n\t\t// Mock: Database\n\t\t\\Bedrock\\Common\\Registry::set('database', new \\stdClass());\n\t}",
"public function testSetRegion(): void {\n\n // Set a Région mock.\n $region = new Region();\n\n $obj = new Commune();\n\n $obj->setRegion($region);\n $this->assertSame($region, $obj->getRegion());\n }",
"private function setPopulated() {\n $this->is_populated = true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ 20100318: B. Garlock Finally a working onthefly PDF creator for any web page on our Intranet! This script will convert an HTML page to a PDF onthefly, simply by placing a link on the resulting .PHP or .HTML file and passing that to the convertme.php script. HTMLDOC 'htmldoc' does all the heavy lifting. See the manpage for more information Gottcha's: Make sure your HTML is VALID HTML! CSS Stylesheets not currently supported. All the thanks in the world to for their HTMLDOC software!! function will check the referer page, pass the url, and name the PDF as the referer page. We flush(), so PHP doesn't complain about headers already being sent! | function topdf($filename, $options = "") {
global $referer;
// Write the content type to the client...
header("Content-Type: application/pdf");
header("Content-Disposition: inline; filename=\"{$referer[3]}.pdf\"");
flush();
// Run HTMLDOC to provide the PDF file to the user...
// Use the --no-localfiles option for enhanced security!
// Currently NO HEADER OR FOOTER, but HTMLDOC certainly supports them!
passthru("htmldoc --no-localfiles --no-compression -t pdf --header ... --footer ... --quiet --jpeg --webpage $options $filename");
} | [
"function pdf_create($bhtml, $filename)\r\n {\r\n \r\n $bhtml = utf8_decode($bhtml);\r\n \r\n $page = $filename;\r\n\r\n $html = $bhtml;\r\n\r\n $mytemp = dirname(FCPATH) . \"/tmp/f\" .time(). \"-\" . mt_rand(111,999) . \".html\";\r\n \r\n $article_f = fopen($mytemp,'w+');\r\n fwrite($article_f,$html);\r\n fclose($article_f);\r\n putenv(\"HTMLDOC_NOCGI=1\");\r\n \r\n # Write the content type to the client...\r\n header(\"Content-Type: application/pdf\");\r\n header(sprintf('Content-Disposition: attachment; filename=\"%s.pdf\"', $page));\r\n flush();\r\n\r\n # if the page is on a HTTPS server and contains images that are on the HTTPS server AND also reachable with HTTP\r\n # uncomment the next line\r\n \r\n #system(\"perl -pi -e 's/img src=\\\"https:\\/\\//img src=\\\"http:\\/\\//g' '$mytemp'\");\r\n\r\n # Run HTMLDOC to provide the PDF file to the user...\r\n passthru(\"htmldoc -t pdf14 --charset iso-8859-1 --color --quiet --jpeg --webpage '$mytemp'\");\r\n \r\n //unlink ($mytemp);\r\n\r\n/*sample\r\nfunction outputpdf()\r\n{\r\n $this->load->plugin('to_htmldoc'); //or autoload\r\n $html = $this->load->view('viewfile', $data, true);\r\n $filename = 'pdf_output';\r\n pdf_create($html, $filename);\r\n}\r\n\r\n*/\r\n}",
"function convert_to_pdf($path_to_html, $path_to_pdf) {\n $pipeline = PipelineFactory::create_default_pipeline(\"\", // Attempt to auto-detect encoding\n \"\");\n // Override HTML source \n $pipeline->fetchers[] = new MyFetcherLocalFile($path_to_html);\n\n $filter = new PreTreeFilterHeaderFooter(\"HEADER\", \"FOOTER\");\n $pipeline->pre_tree_filters[] = $filter;\n\n // Override destination to local file\n $pipeline->destination = new MyDestinationFile($path_to_pdf);\n\n $baseurl = \"\";\n $media = Media::predefined(\"A4\");\n $media->set_landscape(false);\n $media->set_margins(array('left' => 0,\n 'right' => 0,\n 'top' => 10,\n 'bottom' => 10));\n $media->set_pixels(1024); \n\n global $g_config;\n $g_config = array(\n 'cssmedia' => 'screen',\n 'scalepoints' => '1',\n 'renderimages' => true,\n 'renderlinks' => true,\n 'renderfields' => true,\n 'renderforms' => false,\n 'mode' => 'html',\n 'encoding' => '',\n 'debugbox' => false,\n 'pdfversion' => '1.4',\n 'draw_page_border' => false\n );\n $pipeline->configure($g_config);\n $pipeline->add_feature('toc', array('location' => 'before'));\n $pipeline->process($baseurl, $media);\n }",
"function outputPDF($str,$name=null) {\n\n\t//create a temp file\n\t$rand = rand();\n\t$randhtml = TMP_DIR.\"/\".$rand.\".html\";\n\t$randpdf = TMP_DIR.\"/\".$rand.\".pdf\";\n\tfile_put_contents($randhtml,$str);\n\t\n\t//init oo and extract our content\n\t$oo = new OPENOFFICE($randhtml);\n\t\n\t//convert the file to pdf and get the content\n\t$pdffile = $oo->convert(\"pdf\");\n\t\n\tif ($name) $realname = $name;\n\telse $realname = \"Letter_\".date(\"m-d-Y\").\".pdf\";\n\t\n\t// send headers to browser to initiate file download\n\theader (\"Content-Type: application/pdf\");\n\theader (\"Content-Type: application/force-download\");\n\theader (\"Content-Length: \".filesize($pdffile));\n\theader (\"Content-Disposition: attachment; filename=\\\"$realname\\\"\");\n\theader (\"Content-Transfer-Encoding:binary\");\n\theader (\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\theader (\"Pragma: public\");\n\t\n\treadfile($pdffile);\n\tdie;\n\t\n}",
"function pdf_add_weblink($pdfdoc, $llx, $lly, $urx, $ury, $url) {}",
"function generate_pdf($url, $options = [])\n{\n die('generate_pdf() doesnt work in preview or edit mode');\n}",
"function balise_URL_DOCUMENT($p) {\r\n\tif($GLOBALS['forcer_url_dw2']==\"oui\") {\r\n\t\treturn balise_URL_DOC_OUT($p);\r\n\t} else {\r\n\t\treturn balise_URL_DOCUMENT_dist($p);\r\n\t}\r\n}",
"public function generatePDF() {\n\t\tif(!Config::inst()->get('BasePage', 'pdf_export')) return false;\n\n\t\t$binaryPath = Config::inst()->get('BasePage', 'wkhtmltopdf_binary');\n\t\tif(!$binaryPath || !is_executable($binaryPath)) {\n\t\t\tif(defined('WKHTMLTOPDF_BINARY') && is_executable(WKHTMLTOPDF_BINARY)) {\n\t\t\t\t$binaryPath = WKHTMLTOPDF_BINARY;\n\t\t\t}\n\t\t}\n\n\t\tif(!$binaryPath) {\n\t\t\tuser_error('Neither WKHTMLTOPDF_BINARY nor BasePage.wkhtmltopdf_binary are defined', E_USER_ERROR);\n\t\t}\n\n\t\tif(Versioned::get_reading_mode() == 'Stage.Stage') {\n\t\t\tuser_error('Generating PDFs on draft is not supported', E_USER_ERROR);\n\t\t}\n\n\t\tset_time_limit(60);\n\n\t\t// prepare the paths\n\t\t$pdfFile = $this->dataRecord->getPdfFilename();\n\t\t$bodyFile = str_replace('.pdf', '_pdf.html', $pdfFile);\n\t\t$footerFile = str_replace('.pdf', '_pdffooter.html', $pdfFile);\n\n\t\t// make sure the work directory exists\n\t\tif(!file_exists(dirname($pdfFile))) Filesystem::makeFolder(dirname($pdfFile));\n\n\t\t//decide the domain to use in generation\n\t\t$pdf_base_url = $this->getPDFBaseURL();\n\n\t\t// Force http protocol on CWP - fetching from localhost without using the proxy, SSL terminates on gateway.\n\t\tif (defined('CWP_ENVIRONMENT')) {\n\t\t\tConfig::inst()->nest();\n\t\t\tConfig::inst()->update('Director', 'alternate_protocol', 'http');\n\t\t\t//only set alternate protocol if CWP_SECURE_DOMAIN is defined OR pdf_base_url is\n\t\t\tif($pdf_base_url){\n\t\t\t\tConfig::inst()->update('Director', 'alternate_base_url', 'http://'.$pdf_base_url);\n\t\t\t}\n\t\t}\n\n\t\t$bodyViewer = $this->getViewer('pdf');\n\n\t\t// write the output of this page to HTML, ready for conversion to PDF\n\t\tfile_put_contents($bodyFile, $bodyViewer->process($this));\n\n\t\t// get the viewer for the current template with _pdffooter\n\t\t$footerViewer = $this->getViewer('pdffooter');\n\n\t\t// write the output of the footer template to HTML, ready for conversion to PDF\n\t\tfile_put_contents($footerFile, $footerViewer->process($this));\n\n\t\tif (defined('CWP_ENVIRONMENT')) {\n\t\t\tConfig::inst()->unnest();\n\t\t}\n\n\t\t//decide what the proxy should look like\n\t\t$proxy = $this->getPDFProxy($pdf_base_url);\n\n\t\t// finally, generate the PDF\n\t\t$command = $binaryPath . $proxy . ' --outline -B 40pt -L 20pt -R 20pt -T 20pt --encoding utf-8 --orientation Portrait --disable-javascript --quiet --print-media-type ';\n\t\t$retVal = 0;\n\t\t$output = array();\n\t\texec($command . \" --footer-html \\\"$footerFile\\\" \\\"$bodyFile\\\" \\\"$pdfFile\\\" &> /dev/stdout\", $output, $return_val);\n\n\t\t// remove temporary file\n\t\tunlink($bodyFile);\n\t\tunlink($footerFile);\n\n\t\t// output any errors\n\t\tif($return_val != 0) {\n\t\t\tuser_error('wkhtmltopdf failed: ' . implode(\"\\n\", $output), E_USER_ERROR);\n\t\t}\n\n\t\t// serve the generated file\n\t\treturn SS_HTTPRequest::send_file(file_get_contents($pdfFile), basename($pdfFile), 'application/pdf');\n\t}",
"function convert()\n {\n /* Verifica se o arquivo HTML existe */\n if (!file_exists($this->htmlFile) && !preg_match(':^(f|ht)tps?\\://:i', $this->htmlFile)) {\n return new HTML_ToPDFException(\"Erro: O arquivo HTML não existe: $this->htmlFile\");\n }\n\n /* Verifica primeiramente se podemos executar o script htmlpdf\n\t para windows deve-se gerar o certificado da PERL */\n if (!OS_WINDOWS && !@is_executable($this->html2psPath)) {\n return new HTML_ToPDFException(\"Erro: html2ps [$this->html2psPath] não executa\");\n }\n\n if (!@is_executable($this->ps2pdfPath)) {\n return new HTML_ToPDFException(\"Erro: ps2pdf [$this->ps2pdfPath] não executa\");\n }\n\n /* Faz uma verificacao em arquivos grandes */\n set_time_limit(160);\n\n /* Efetua a leitura do arquivo html */\n $this->_htmlString = @implode('', @file($this->htmlFile));\n /* Arquivos adicionais de CSS */\n $this->additionalCSS .= $this->_getCSSFromFile();\n /* Modifica o arquivo de configuração */\n $this->_modifyConfFile();\n $paperSize = $this->_getPaperSize();\n $orientation = $this->_getOrientation();\n\n if ($this->makeAbsoluteImageUrls) {\n /* Substitui as imagens relativas ao dominio */\n $this->_htmlString = preg_replace(':<img (.*?)src=[\"\\']((?!http\\://).*?)[\"\\']:i', '<img \\\\1 src=\"http://'.$this->defaultDomain.'/\\\\2\"', $this->_htmlString);\n }\n\n /* Referente aos formularios do script htmlpdf */\n $this->_htmlString = preg_replace(':<input (.*?)type=[\"\\']?(hidden|submit|button|image|reset|file)[\"\\']?.*?>:i', '<input />', $this->_htmlString);\n\n $a_tmpFiles = array();\n /* Diretorio temporario deve existir */\n $a_tmpFiles['config'] = tempnam($this->tmpDir, 'CONF-');\n\n if (!@is_writable($a_tmpFiles['config'])) {\n return new HTML_ToPDFException(\"Erro: O diretório temporário não existe ou está sem permisões de escrita.\");\n }\n\n $fp = fopen($a_tmpFiles['config'], 'w');\n fwrite($fp, $this->html2psrc);\n fclose($fp);\n $this->_dumpDebugInfo(\"html2ps config: $this->html2psrc\");\n\n /* Arquivo HTML provisorio deve existir */\n $a_tmpFiles['html'] = tempnam($this->tmpDir, 'HTML-');\n while (is_file($a_tmpFiles['html'] . '.html')) {\n unlink($a_tmpFiles['html']);\n $a_tmpFiles['html'] = tempnam($this->tmpDir, 'HTML-');\n }\n\n $a_tmpFiles['html'] .= '.html';\n $fp = fopen($a_tmpFiles['html'], 'w');\n fwrite($fp, $this->_htmlString);\n fclose($fp);\n\n /* Arquivo postscript provisorio deve existir */\n $a_tmpFiles['ps'] = tempnam($this->tmpDir, 'PS-');\n\n $tmp_result = array();\n $cmd = $this->html2psPath . ' ' . $orientation . ' -f ' . $a_tmpFiles['config'] . ' -o ' . \n $a_tmpFiles['ps'] . ' ' . $a_tmpFiles['html'] . ' 2>&1'; \n exec($cmd, $tmp_result, $retCode);\n $this->_dumpDebugInfo(\"html2ps command run: $cmd\");\n $this->_dumpDebugInfo(\"html2ps output: \" . @implode(\"\\n\", $tmp_result));\n\n if ($retCode != 0) {\n $this->_cleanup($a_tmpFiles);\n return new HTML_ToPDFException(\"Erro: Problemas ao executar o script PERL htmlpdf. Erro de conversão, debugador retornou: $retCode. Abilite a opção do debug para ver as informações de execução na tela.\");\n }\n\n $tmp_result = array();\n $cmd = $this->ps2pdfPath . ' -sPAPERSIZE=' . $paperSize . ' -I' . $this->ps2pdfIncludePath . ' ' .\n ' -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode ' . \n $a_tmpFiles['ps'] . ' \\'' . escapeshellcmd($this->pdfFile) . '\\' 2>&1';\n exec($cmd, $tmp_result, $retCode);\n\n $this->_dumpDebugInfo(\"Rodando o ps2pdf: $cmd\");\n $this->_dumpDebugInfo(\"Saída do ps2pdf: \" . @implode(\"\\n\", $tmp_result));\n if ($retCode != 0) {\n $this->_cleanup($a_tmpFiles);\n return new HTML_ToPDFException(\"Erro: Problemas ao executar o script ps2pdf. Erro de conversão, debugador retornou: $retCode. Abilite a opção do debug para ver as informações de execução na tela.\");\n }\n\n $this->_cleanup($a_tmpFiles);\n return $this->pdfFile;\n }",
"function urlToPdf($url,$filename) {\n\t\t$snappy = new \\Knp\\Snappy\\Pdf($this->binary_path);\n//\t\t$cacheDir = $this->fw->fixslashes($this->fw->ROOT.'/'.$this->fw->TEMP);\n//\t\t$snappy->setOption('cache-dir',$cacheDir);\n\n//\t\t$snappy->setTimeout(30);\n\t\t$snappy->setOption('encoding',\"utf-8\");\n//\t\t$snappy->setOption('lowquality',FALSE);\n\n\t\ttry {\n//\t\t\tif ($this->fw->exists('COOKIE',$cookie)) {\n//\t\t\t\t$snappy->setOption('cookie', $cookie);\n//\t\t\t}\n\t\t\t$out = @$snappy->getOutput($url);\n\t\t} /* catch (ProcessTimedOutException $e) {\n\t\t\t// do nothing\n\t\t} */ catch (\\Exception $e) {\n\t\t\t\\Base::instance()->error($e->getCode(),$e->getMessage(),$e->getTrace());\n\t\t}\n\n\t\tif ($out) {\n\t\t\theader('Content-Type: application/pdf');\n\t\t\tif ($this->config['download_attachment'])\n\t\t\t\theader('Content-Disposition: attachment; filename=\"'.$filename.'\"');\n\t\t\techo $out;\n\t\t}\n\t}",
"public function asPdf();",
"function createPDF()\n{\n $pdf= 'Schedule.pdf';\n $pdfPath = '/srv/http/StateFair/Export/pdf/' . $pdf;\n // $output = shell_exec('/srv/http/StateFair/Export/pdf/./wkhtmltopdf /srv/http/StateFair/Export/pdf/Schedule.html ' . $pdfPath);\n $output = shell_exec('wkhtmltopdf /srv/http/StateFair/Export/pdf/Schedule.html ' . $pdfPath);\n return $pdf;\n}",
"function action_makePDFFromHtml($data, $html)\n{\n extract($GLOBALS);\n $tabSplit = explode(\".\", $html);\n $ext = $tabSplit[sizeof($tabSplit) - 1];\n $nameBase = str_replace(\".\" . $ext, \"\", $html);\n $filePDF = html2pdf(string2Tab($data), \"../html/$html\", $nameBase);\n\n return $CFG_URL . $filePDF;\n}",
"public function ConvertPage ( $url = false )\n\t {\n\t\tif ( $url )\n\t\t\t$this -> Url\t= $url ;\n\n\t\tif ( ! $this -> Url )\n\t\t\tthrow ( new ApiLayerException ( \"No url specified for html-to-pdf conversion\" ) ) ;\n\n\t\t$result\t\t\t\t= $this -> Execute ( ) ;\n\t\t$this -> Pdf\t\t\t= $result ;\n\n\t\treturn ( $this -> Pdf ) ;\n\t }",
"function AssemblePDF ()\n\t{\n\t\treturn false;\n\t}",
"function islandora_paged_content_page_derive_pdf(FedoraObject $object, array $options = array('-compress' => 'LZW')) {\n if (!islandora_paged_content_can_derive($object, 'PDF')) {\n return FALSE;\n }\n $source_file\n = islandora_paged_content_get_page_derivative_source($object, 'PDF');\n $pdf_file = islandora_paged_content_convert_to_pdf($source_file, $options);\n file_unmanaged_delete($source_file);\n return $pdf_file;\n}",
"function visitasPDF()\n\t{\n\t\t$wlidvisita=$this->argumentos[\"wl_idvisita\"];\n\t\t//echo \"<error>$wlidvisita</error>\t\";\n \techo \"<abresubvista></abresubvista>\";\n \techo \"<wlhoja>visitasPDF.php</wlhoja>\";\n \techo \"<wlcampos>wlidvisita=\".$wlidvisita.\"</wlcampos>\";\n \techo \"<wldialogWidth>50</wldialogWidth>\";\n \techo \"<wldialogHeight>30</wldialogHeight>\"; \t\n }",
"function makePDF($text){\n\t\tglobal $tp, $pdfpref;\n\n\t\t//call get preferences\n\t\t$pdfpref = $this->getPDFPrefs();\n\n\t\t//define logo and source pageurl (before the parser!)\n\t\tif(is_readable(THEME.\"images/logopdf.png\"))\n\t\t{\n\t\t\t$logo = THEME.\"images/logopdf.png\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$logo = e_IMAGE.\"logo.png\";\n\t\t}\n\t\tdefine('PDFLOGO', $logo);\t\t\t\t\t//define logo to add in header\n\t\tdefine('PDFPAGEURL', $text[6]);\t\t\t\t//define page url to add in header\n\n\t\t//parse the data\n\t\t$text[3] = $this->toPDF($text[3]);\t\t\t\t\t//replace some in the title\n\t\t$text[3] = $this->toPDFTitle($text[3]);\t\t\t//replace some in the title\n\t\tforeach($text as $k=>$v)\n\t\t{\n\t\t\t$text[$k] = $tp->toHTML($v, TRUE);\n\t\t}\n\n\t\t//set some variables\n\t\t$this->SetMargins($pdfpref['pdf_margin_left'],$pdfpref['pdf_margin_top'],$pdfpref['pdf_margin_right']);\n\t\t//$this->SetAutoPageBreak(true,25);\n\n\t\t//start creating the pdf and adding the data\n\t\t$this->DefOrientation=(varset($text[7], 'P') == 'L' ? 'L' : 'P'); \t// Page orientation - P=portrait, L=landscape\n\t\t$this->AliasNbPages();\t\t\t\t\t\t//calculate current page + number of pages\n\t\t$this->AddPage();\t\t\t\t\t\t\t//start page\n\t\t$this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']);\t\t\t\t//set font\n\t\t$this->WriteHTML($text[0], true);\t\t\t//write text\n\t\t$this->SetCreator($text[1]);\t\t\t\t//name of creator\n\t\t$this->SetAuthor($text[2]);\t\t\t\t\t//name of author\n\t\t$this->SetTitle($text[3]);\t\t\t\t\t//title\n\t\t$this->SetSubject($text[4]);\t\t\t\t//subject\n\t\t$this->SetKeywords($text[5]);\t\t\t\t//space/comma separated\n\t\t$file = $text[3].\".pdf\";\t\t\t\t\t//name of the file\n\t\t$this->Output($file, 'D');\t\t\t\t\t//Save PDF to file (D = output to download window)\n\t\treturn;\n\t}",
"private function createPdfFile($pageURL)\r\n\t{\r\n\t\tif (class_exists('Net_Socket'))\r\n\t\t{\r\n\t\t\t$socket = new Net_Socket();\r\n\t\t}\r\n\t\telse\n\t\t{\n\t\t\tthrow new Exception(\"Class Net_Socket not found\");\n\t\t}\r\n\r\n\t\tif(!$socket->connect($this->server_ip,$this->server_port,true,$this->timeout))\r\n\t\t{\r\n\t\t\t$msg = \"[PDF] Can't connect to remote server : [IP:\".$this->server_ip.\" - PORT:\".$this->server_port.\"]\";\r\n\t\t\tif(Framework::isFatalEnabled())\r\n\t\t\t{\r\n\r\n\t\t\t\tFramework::fatal($msg);\r\n\t\t\t}\r\n\t\t\t$socket->disconnect();\r\n\t\t\tthrow new Exception($msg);\r\n\t\t}\r\n\r\n\t\t$socket->readLine();\r\n\t\t$socket->readLine();\r\n\r\n\t\t$socket->writeLine(\"cred \".$this->user.\":\".$this->pwd);\r\n\t\t$response = $socket->readLine();\r\n\r\n\t\tif(trim($response)!='OK')\r\n\t\t{\r\n\t\t\t$msg = \"[PDF] Can't login to server : [user:\".$this->user.\" - pwd:\".$this->pwd.\"]\";\r\n\t\t\tif(Framework::isFatalEnabled())\r\n\t\t\t{\r\n\t\t\t\tFramework::fatal($msg);\r\n\t\t\t}\r\n\t\t\t$socket->disconnect();\r\n\t\t\tthrow new Exception($msg);\r\n\t\t}\r\n\r\n\t\t$socket->writeLine(\"cust \".$this->cust);\r\n\t\t$response = $socket->readLine();\r\n\t\tif(trim($response)!='OK')\r\n\t\t{\r\n\t\t\t$msg = \"[PDF] Can't set customer : [customer:\".$this->cust.\"]\";\r\n\t\t\tif(Framework::isFatalEnabled())\r\n\t\t\t{\r\n\t\t\t\tFramework::fatal($msg);\r\n\t\t\t}\r\n\t\t\t$socket->disconnect();\r\n\t\t\tthrow new Exception($msg);\r\n\t\t}\r\n\t\t// pdf options start\r\n\t\tif(!empty($this->pdf_pwd))\r\n\t\t{\r\n\t\t\t$socket->writeLine(\"pdfpass \".$this->pdf_pwd);\r\n\t\t\t$response = $socket->readLine();\r\n\t\t\tif(trim($response)!='OK')\r\n\t\t\t{\r\n\r\n\t\t\t\tif(Framework::isErrorEnabled())\r\n\t\t\t\t{\r\n\t\t\t\t\tFramework::error(\"[PDF] Can't set pdf pwd : [pdf_pwd:\".$this->pdf_pwd.\"]\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif($this->opt_print == false)\r\n\t\t{\r\n\t\t\t$socket->writeLine(\"pdfnoprint \".(int)$this->opt_print);\r\n\t\t\t$response = $socket->readLine();\r\n\t\t\tif(trim($response)!='OK')\r\n\t\t\t{\r\n\t\t\t\tif(Framework::isErrorEnabled())\r\n\t\t\t\t{\r\n\t\t\t\t\tFramework::error(\"[PDF] Can't disable pdf print\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif($this->opt_copy == false)\r\n\t\t{\r\n\t\t\t$socket->writeLine(\"pdfnocopy \".(int)$this->opt_copy);\r\n\t\t\t$response = $socket->readLine();\r\n\t\t\tif(trim($response)!='OK')\r\n\t\t\t{\r\n\t\t\t\tif(Framework::isErrorEnabled())\r\n\t\t\t\t{\r\n\t\t\t\t\tFramework::error(\"[PDF] Can't disable pdf copy\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif($this->opt_annon == false)\r\n\t\t{\r\n\t\t\t$socket->writeLine(\"pdfnoannon \".(int)$this->opt_annon);\r\n\t\t\t$response = $socket->readLine();\r\n\t\t\tif(trim($response)!='OK')\r\n\t\t\t{\r\n\t\t\t\tif(Framework::isErrorEnabled())\r\n\t\t\t\t{\r\n\t\t\t\t\tFramework::error(\"[PDF] Can't disable pdf annotation\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif($this->opt_modif == false)\r\n\t\t{\r\n\t\t\t$socket->writeLine(\"pdfnomodif \".(int)$this->opt_modif);\r\n\t\t\t$response = $socket->readLine();\r\n\t\t\tif(trim($response)!='OK')\r\n\t\t\t{\r\n\t\t\t\tif(Framework::isErrorEnabled())\r\n\t\t\t\t{\r\n\t\t\t\t\tFramework::error(\"[PDF] Can't disable pdf modification\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$socket->writeLine(\"comp \".$this->opt_zip);\r\n\t\t$response = $socket->readLine();\r\n\t\tif(trim($response)!='OK')\r\n\t\t{\r\n\t\t\tif(Framework::isErrorEnabled())\r\n\t\t\t{\r\n\t\t\t\tFramework::error(\"[PDF] Can't set comporession : [COMPRESSION:\".$this->opt_zip.\"]\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t// pdf options end\r\n\r\n\t\t// define minimum cache time on remote server\r\n\t\t$socket->writeLine(\"ret 1\");\r\n\t\t$socket->readLine();\r\n\r\n\t\tif($this->force_html == true)\r\n\t\t{\r\n\t\t\t$socket->writeLine(\"proto html\");\r\n\t\t\t$response = $socket->readLine();\r\n\t\t\tif(trim($response)!='OK')\r\n\t\t\t{\r\n\t\t\t\tif(Framework::isErrorEnabled())\r\n\t\t\t\t{\r\n\t\t\t\t\tFramework::error(\"[PDF] Can't force html analyse instead of xhtml\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$socket->writeLine(\"print \".$pageURL);\r\n\t\t$remotepdfpath = $socket->readLine();\r\n\r\n\t\tif(substr(trim($remotepdfpath),-(strlen($this->ext)))!=$this->ext)\r\n\t\t{\r\n\r\n\t\t\t$msg = \"[PDF] No pdf url received for page url : \".$pageURL;\r\n\t\t\tif(Framework::isFatalEnabled())\r\n\t\t\t{\r\n\r\n\t\t\t\tFramework::fatal($msg);\r\n\t\t\t}\r\n\r\n\t\t\t$socket->disconnect();\r\n\t\t\tthrow new Exception($msg);\r\n\r\n\t\t}\r\n\r\n\t\t$response = $socket->readLine();\r\n\r\n\t\tif(trim($response)!='OK')\r\n\t\t{\r\n\r\n\t\t\t$msg = \"[PDF] Url received but pdf creation failed\";\r\n\t\t\tif(Framework::isFatalEnabled())\r\n\t\t\t{\r\n\t\t\t\tFramework::fatal($msg);\r\n\t\t\t}\r\n\r\n\t\t\t$socket->disconnect();\r\n\t\t\tthrow new Exception($msg);\r\n\t\t}\r\n\r\n\t\t$socket->writeLine(\"quit\");\r\n\t\t$socket->disconnect();\r\n\t\treturn $remotepdfpath;\r\n\t}",
"abstract protected function getPDFURL();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get login URL, including any scope and redirect URL if set | public function get_login_url()
{
$params = array();
if (isset($this->_scope)) $params['scope'] = $this->_scope;
if (isset($this->_redirect)) $params['redirect_uri'] = $this->_redirect;
return $this->link->getLoginUrl($params);
} | [
"public function get_login_url() { }",
"public function getLoginUrl();",
"protected function getLoginUrl()\n {\n }",
"protected function getLoginUrl()\n {\n return $this->urlGenerator->generate('login');\n }",
"public function login_url()\n {\n return $this->login_url;\n }",
"protected function getUrlLogin() {\r\n return $_SERVER['SCRIPT_NAME'] . '/login';\r\n }",
"protected function getLoginUrl()\n {\n return $this->router->generate('user_login');\n }",
"public function login_url()\n {\n // Login type must be web, else return empty string\n if ($this->config->item('facebook_login_type') != 'web')\n {\n return '';\n }\n // Create login url\n return $this->helper->getLoginUrl($this->config->item('facebook_login_redirect_url'), $this->config->item('facebook_permissions'));\n }",
"public function getLoginUrl()\n {\n $query = [\n 'client_id' => $this->config->key,\n 'response_type' => 'code',\n 'redirect_uri' => $this->config->redirectHost . $this->config->redirectUri,\n 'scope' => implode(',', self::PERMISSIONS),\n ];\n $url = self::URL . '?' . http_build_query($query);\n\n return $url;\n }",
"public function getLoginUrl(): string\n {\n $this->keycloak->redirectUri = $this->getRedirectUri();\n\n return $this->keycloak->getLoginUrl() . \"&state=\" . $this->state;\n }",
"public function login_url() {\n // Login type must be web login, else return empty string\n if ($this->helpertype !='login') {\n return ''; \n }\n return $this->helper->getLoginUrl(\n base_url() . $this->config->item('facebook_redirectUri'), \n $this->config->item('facebook_permissions')); \n }",
"protected function getLoginUrl()\n {\n return $this->router->generate('login');\n }",
"protected function getLoginUrl()\n {\n return $this->router->generate('security_login');\n }",
"public function getLoginURL() {\n\t\treturn $this->loginURL;\n\t}",
"public function getRedirectLoginUrl()\n {\n $loginUrl = $this->getWordpress()->getBlogInfo('wpurl')\n .'/wp-login.php?redirect_to='.urlencode($_SERVER['REQUEST_URI']);\n return $this->getWordpress()->applyFilters('uam_login_url', $loginUrl);\n }",
"public function getLoginUri()\n {\n return $this->loginUri;\n }",
"protected function getLoginUrl()\n {\n return $this->router->generate($this->cas->getRouteLogin());\n }",
"public function woo_slg_linkedin_auth_url() {\n\t\t\t\n\t\t\t//Remove unused scope for login\n\t\t\t\n\t\t\t$scope\t= array( 'r_emailaddress', 'r_liteprofile' );\n\t\t\t\n\t\t\t//load linkedin class\n\t\t\t$linkedin = $this->woo_slg_load_linkedin();\n\t\t\t\n\t\t\t//check linkedin loaded or not\n\t\t\tif( !$linkedin ) return false;\n\t\t\t\n\t\t\t//Get Linkedin config\n\t\t\t$config\t= $this->linkedinconfig;\n\t\t\t\n\t\t\ttry {//Prepare login URL\n\t\t\t\t$preparedurl\t= $this->linkedin->getAuthorizeUrl( $config['appKey'], $config['callbackUrl'], $scope );\n\t\t\t} catch( Exception $e ) {\n\t\t\t\t$preparedurl\t= '';\n\t }\n\t \n\t\t\treturn $preparedurl;\n\t\t}",
"function wpwebapp_get_redirect_url_logged_in() {\n\t$options = wpwebapp_get_plugin_options_user_access();\n\tif ( $options['redirect_logged_in'] === '' ) {\n\t\treturn site_url();\n\t} else {\n\t\treturn $options['redirect_logged_in'];\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update each selector with $choices['selector']. Example: $choices = array( 'ServiceUser' => array(), // e.g. no choices for ServiceUserEntry 'ServicePage' => array( array('firstSelection' => '1', 'secondSelection' => 'b') ), 'ServiceGroup' => array( array('firstSelection' => 'f') ) ); | public function updateSelectors(array $choices); | [
"function simple_feed_array_to_form_selections($selections, $choices) {\n $drupal_form = drupal_map_assoc($choices);\n $choices_flip = array_flip($choices);\n array_walk($drupal_form, function(&$a, $b){$a = 0;});\n foreach($selections as $sel) {\n if (isset($choices_flip[$sel])) {\n $drupal_form[$sel] = $sel;\n }\n }\n return $drupal_form;\n}",
"public function setChoices(array $choices);",
"public function setSelector($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Io\\Token\\Proto\\Extensions\\Service\\RateLimitSelector\\Selector::class);\n $this->selector = $arr;\n\n return $this;\n }",
"public function setSelectors($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\Gaming\\V1\\LabelSelector::class);\n $this->selectors = $arr;\n\n return $this;\n }",
"public function set_choices(array $choices) {\n $this->choices = $choices;\n }",
"function acf_walk_select_input( $choices = array(), $values = array(), $depth = 0 ) {\n\t$html = '';\n\n\t// Sanitize values for 'selected' matching (only once).\n\tif ( $depth == 0 ) {\n\t\t$values = array_map( 'esc_attr', $values );\n\t}\n\n\t// Loop over choices and append to html.\n\tif ( $choices ) {\n\t\tforeach ( $choices as $value => $label ) {\n\n\t\t\t// Multiple (optgroup)\n\t\t\tif ( is_array( $label ) ) {\n\t\t\t\t$html .= sprintf(\n\t\t\t\t\t'<optgroup label=\"%s\">%s</optgroup>',\n\t\t\t\t\tesc_attr( $value ),\n\t\t\t\t\tacf_walk_select_input( $label, $values, $depth + 1 )\n\t\t\t\t);\n\n\t\t\t\t// single (option)\n\t\t\t} else {\n\t\t\t\t$attrs = array(\n\t\t\t\t\t'value' => $value,\n\t\t\t\t);\n\n\t\t\t\t// If is selected.\n\t\t\t\t$pos = array_search( esc_attr( $value ), $values );\n\t\t\t\tif ( $pos !== false ) {\n\t\t\t\t\t$attrs['selected'] = 'selected';\n\t\t\t\t\t$attrs['data-i'] = $pos;\n\t\t\t\t}\n\t\t\t\t$html .= sprintf( '<option %s>%s</option>', acf_esc_attr( $attrs ), esc_html( $label ) );\n\t\t\t}\n\t\t}\n\t}\n\treturn $html;\n}",
"function setSelections(Array $selections);",
"public function forms_select_choices() {\n\n\t\t$forms = \\GFAPI::get_forms();\n\t\t$form_choices = array();\n\t\t$count = 0;\n\n\t\tforeach ( $forms as $form ) {\n\t\t\t$form_choices[ $count ]['label'] = $form['title'];\n\t\t\t$form_choices[ $count ]['value'] = $form['id'];\n\t\t\t$count++;\n\t\t}\n\n\t\treturn apply_filters( 'lc_gforms_dg_form_choices_array', $form_choices );\n\n\t}",
"public function registerChoice($service, $choices)\n {\n $provider = $this->locate($service);\n $providers = $provider->getRegistered();\n foreach ($providers as $p) {\n $name = strtolower($p->getName());\n if (isset($choices[$name])) {\n $p->setPriority($choices[$name]);\n }\n }\n $provider->sortProviders();\n }",
"function options_for_select($choices, $selected = null) {\n $form = new FormOptionsHelper();\n return $form->options_for_select($choices, $selected); \n}",
"private function createSelectorsFromElementsArray()\n {\n foreach ($this->elements as $key => $element) {\n $this->addSelector($key, $this->selectorFactory->create($element));\n }\n }",
"function get_choices_option($choices_group)\n{\n $choices = get_theme_mod('choices_' . $choices_group);\n $choices = explode(\"\\n\", $choices);\n $choices = array_map(function ($row) {\n return explode(' : ', $row);\n }, $choices);\n $out = [];\n foreach ($choices as $choice) {\n $out[trim($choice[0])] = trim($choice[1]);\n }\n // return the field\n return $out;\n}",
"static function arraySetBySelector($array, $selector, $value, $overwrite = false) {\n // make sure the array is an array in case we got here through a subsequent call\n // arraySetElementBySelector(array(), 'item[subitem]', 'value');\n // will call\n // arraySetElementBySelector(null, 'subitem', 'value');\n if (!is_array($array)) {\n $array = array();\n }\n list($container, $subselector) = self::getSelectorParts($selector);\n if (!$subselector) {\n if ($container !== '*') {\n if ($overwrite == true or !array_key_exists($container, $array)) {\n $array[$container] = $value;\n }\n }\n return $array;\n } \n\n // if we have a subselector the $array[$container] must be an array\n if ($container !== '*' and !array_key_exists($container, $array)) {\n $array[$container] = array();\n }\n // we got here through something like *[subitem]\n if ($container === '*') {\n foreach ($array as $key => $v) {\n $array[$key] = self::arraySetBySelector($array[$key], $subselector, $value, $overwrite);\n }\n } else {\n $array[$container] = self::arraySetBySelector($array[$container], $subselector, $value, $overwrite);\n }\n\n return $array;\n }",
"public function getValuesForChoices(array $choices);",
"public function updateSelector($controllerService, $selector)\n {\n $config = $this->configResource->fetch(true);\n $config['api-tools-content-negotiation']['controllers'][$controllerService] = $selector;\n $this->configResource->overwrite($config);\n return true;\n }",
"function update_dropdowns()\n {\n }",
"private static function sort_by_selector ($options)\n {\n $selector_array = array();\n\n foreach ($options as $item => $option) {\n //if we don't have a selector, try to generate one\n if ($option['type'] == 'heading' || $option['type'] == 'info') {\n continue;\n }\n\n if ((is_array($option) && !isset($option['selector'])) || empty($option['selector'])) {\n\n // user can set selector in front of id\n $selector_id_array = explode('.', $option['id']);\n \n if ( isset($selector_id_array[1])) {\n $option['selector'] = $selector_id_array[0]; \n } else {\n $option['selector'] = 'body'; \n }\n } \n\n // yank out all the styles that apply to specific selectors into\n // an array that is 'selector'[0] => style, [1] => style\n if (array_key_exists($option['selector'], $selector_array)) {\n $selector_array[$option['selector']][] = $option;\n } else {\n $selector_array[$option['selector']] = array();\n $selector_array[$option['selector']][] = $option;\n }\n }\n\n return $selector_array;\n }",
"function tp_prepare_poll_choices($poll)\r\n{\r\n if ( !isset($poll->choices) || empty($poll->choices) )\r\n\treturn;\r\n\r\n if ( !is_admin() ):\r\n\t// Check for custom choice types\r\n\t$refresh_choices = false;\r\n\t$builtin_types = array( 'text', 'link', 'image', 'video', 'html' );\r\n\tforeach ( $poll->choices as $index => $choice ):\r\n\t if ( !in_array($choice->type, $builtin_types) &&\r\n\t\t (!has_filter(\"tp_render_{$choice->type}_choice_vote\") || !has_filter(\"tp_render_{$choice->type}_choice_result\")) ):\r\n\t\tunset($poll->choices[$index]);\r\n\t\t$refresh_choices = true;\r\n\t endif;\r\n\tendforeach;\r\n\r\n\tif ( $refresh_choices ):\r\n\t $poll->choices = array_values($poll->choices);\r\n\tendif;\r\n endif;\r\n\r\n // Generate an unique ID for each choice\r\n array_walk($poll->choices, 'tp_generate_choice_id', $poll->special_id);\r\n\r\n // Count total votes\r\n $poll->total_votes = 0;\r\n array_walk($poll->choices, 'tp_count_choices_total_votes', $poll);\r\n array_walk($poll->choices, 'tp_calc_choice_percentages', $poll->total_votes);\r\n\r\n // Strip slashes\r\n array_walk($poll->choices, 'tp_prepare_choice_html');\r\n\r\n /**\r\n * Prepare poll choices\r\n * \r\n * @since 2.0.0\r\n * @action tp_poll_prepare_choices\r\n * @param Poll choices\r\n * @param Poll object\r\n */\r\n do_tp_action('tp_poll_prepare_choices', $poll->choices, $poll);\r\n}",
"function add_category_selectors( $selectors ) {\n\n\t\t// Button Bar\n\t\t$selectors['button_bar'] =\n\t\t\tnew SLP_Power_Category_Selector( array(\n\t\t\t\t 'label' => __( 'Button Bar', 'slp-premier' ),\n\t\t\t\t 'value' => 'button_bar',\n\t\t\t\t 'selected' => ( $this->slplus->SmartOptions->show_cats_on_search->value === 'button_bar' ),\n\t\t\t\t 'ui_builder' => 'SLP_Premier_Category_UI::create_string_for_button_bar_selector'\n\t\t\t ) );\n\n\t\t// Checkboxes\n\t\t$selectors['horizontal_checkboxes'] =\n\t\t\tnew SLP_Power_Category_Selector( array(\n 'label' => __( 'Checkboxes, Horizontal', 'slp-premier' ),\n 'value' => 'horizontal_checkboxes',\n 'selected' => ( $this->slplus->SmartOptions->show_cats_on_search->value === 'horizontal_checkboxes' ),\n 'ui_builder' => 'SLP_Premier_Category_UI::create_string_horizontal_checkboxes'\n ) );\n\t\t$selectors['vertical_checkboxes'] =\n\t\t\tnew SLP_Power_Category_Selector( array(\n\t\t\t\t 'label' => __( 'Checkboxes, Vertical', 'slp-premier' ),\n\t\t\t\t 'value' => 'vertical_checkboxes',\n\t\t\t\t 'selected' => ( $this->slplus->SmartOptions->show_cats_on_search->value === 'vertical_checkboxes' ),\n\t\t\t\t 'ui_builder' => 'SLP_Premier_Category_UI::create_string_vertical_checkboxes'\n\t\t\t ) );\n\n\t\t// Single Parent\n\t\t$selectors['single_parents'] =\n\t\t\tnew SLP_Power_Category_Selector( array(\n\t\t\t\t'label' => __( 'Single Parents', 'slp-premier' ),\n\t\t\t\t'value' => 'single_parents',\n\t\t\t\t'selected' => ( $this->slplus->SmartOptions->show_cats_on_search->value === 'single_parents' ),\n 'ui_builder' => 'SLP_Premier_Category_UI::create_string_for_single_parent_selector'\n\t\t\t) );\n\n\t\treturn $selectors;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set Media Chooser field renderer on defined product form fields | public function setMediaChooserFieldRendererOnProductEditForm(Varien_Event_Observer $observer)
{
$form = $observer->getEvent()->getForm();
$attributes = Mage::getConfig()
->getNode(self::XML_PATH_PRODUCT_ATTRIBUTES);
if ($attributes) {
$fields = array_keys($attributes->asArray());
$this->_setMediaChooserFieldRenderer($form, $fields);
}
return $this;
} | [
"public function setMediaChooserFieldRenderer(Varien_Event_Observer $observer)\n {\n $form = $observer->getEvent()->getForm();\n\n // Replace 'your_field' with a form element Id to apply media chooser to it\n /*$yourField = $form->getElement('your_field');\n if ($yourField) {\n $yourField->setRenderer(\n Mage::app()->getLayout()->createBlock('mediachooserfield/adminhtml_catalog_form_renderer_attribute_mediachooser')\n );\n }*/\n\n return $this;\n }",
"protected function _setMediaChooserFieldRenderer($form, $fields)\n {\n foreach ($fields as $field) {\n if ($element = $form->getElement($field)) {\n $element->setRenderer(\n Mage::app()->getLayout()->createBlock('mediachooserfield/adminhtml_catalog_form_renderer_attribute_mediachooser')\n );\n }\n }\n }",
"function print_media_selector( $setting_id ) {\n $image_id = genesis_get_option( $setting_id, RVA_SETTINGS_FIELD );\n wp_enqueue_media();\n ?>\n <div class='image-preview-wrapper'>\n <?php printf( \n '<img id=\"image_preview_'.$setting_id.'\" src=\"%s\" height=\"100\">', isset( $image_id) ? wp_get_attachment_url( esc_attr( $image_id ) ) : ''\n ); ?> \n </div>\n <input id=\"btn_upload_<?php echo $setting_id; ?>\" type=\"button\" class=\"button\" value=\"<?php _e( 'Select Image' ); ?>\" />\n \n <?php printf( \n '<input type=\"hidden\" id=\"'.$setting_id.'\" name=\"'.RVA_SETTINGS_FIELD.'['.$setting_id.']\" value=\"%s\" />',\n isset( $image_id) ? esc_attr( $image_id ) : ''\n ); ?>\n <script type='text/javascript'>\n jQuery(document).ready( function($){\n rva_admin.bind_media_picker('#btn_upload_<?php echo $setting_id ?>', '#image_preview_<?php echo $setting_id ?>', '#<?php echo $setting_id ?>');\n });\n </script>\n <?php\n}",
"function cspm_post_format_and_media(){\r\n\t\t\t\r\n\t\t\t$fields = array();\r\n\t\t\t\r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'name' => 'Format & Media',\r\n\t\t\t\t'desc' => 'Set your post format & open it inside a modal. You can pop-up the single post or the media files only. Choose your post/location format and upload the media files.',\r\n\t\t\t\t'type' => 'title',\r\n\t\t\t\t'id' => $this->metafield_prefix . '_format_and_media',\r\n\t\t\t\t'attributes' => array(\r\n\t\t\t\t\t'style' => 'font-size:20px; color:#008fed; font-weight:400;'\r\n\t\t\t\t),\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$nearby_palces_option = (!class_exists('CspmNearbyMap')) ? '<strike>Nearby Places Map</strike> <small style=\"color:red;\">(This option requires the addon <a href=\"https://codecanyon.net/item/nearby-places-wordpress-plugin/15067875?ref=codespacing\" target=\"_blank\" class=\"cspm_blank_link\">\"Nearby Places\"</a>!)</small>' : 'Nearby Places Map';\r\n\t\t\t$nearby_palces_option_desc = (!class_exists('CspmNearbyMap')) ? '' : '<br /><span style=\"color:red;\"><u>Note:</u> When using the option <strong>\"Nearby Places Map\"</strong>, make sure to create a new page and assign it to the template page <strong>\"Nearby Places Modal\"</strong>!</span>';\r\n\t\t\t\r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'id' => $this->metafield_prefix . '_post_format',\r\n\t\t\t\t'name' => 'Format',\r\n\t\t\t\t'desc' => 'Select the format. Default \"Standard\". By clicking on the post marker, \r\n\t\t\t\t\t\t the post link or media files will be opened inside a modal/popup! '.$nearby_palces_option_desc,\r\n\t\t\t\t'type' => 'radio',\t\t\t\t\r\n\t\t\t\t'options' => array(\r\n\t\t\t\t\t'standard' => 'Standard',\r\n\t\t\t\t\t'link' => 'Link (Single post page)',\r\n\t\t\t\t\t'nearby_places' => $nearby_palces_option,\r\n\t\t\t\t\t'gallery' => 'Gallery',\r\n\t\t\t\t\t'image' => 'Image',\r\n\t\t\t\t\t'audio' => 'Audio',\r\n\t\t\t\t\t'embed' => 'Embed (Video, Audio playlist, Website and more)',\r\n\t\t\t\t\t'all' => 'All Media',\r\n\t\t\t\t),\r\n\t\t\t\t'default' => 'standard',\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'id' => $this->metafield_prefix . '_enable_media_marker_click',\r\n\t\t\t\t'name' => 'Open media files on marker click?',\r\n\t\t\t\t'desc' => 'By default, when a user clicks on a marker, the media files will pop up on the screen. \r\n\t\t\t\t\t\t You can disable this option from here. Defaults to \"Yes\".<br />\r\n\t\t\t\t\t\t <span style=\"color:red;\"><u>Note:</u> Media files can also be displayed from the map settings under \"Marker menu settings => \"Media Modal\" link\"!</span>',\r\n\t\t\t\t'type' => 'radio_inline',\r\n\t\t\t\t'default' => 'yes',\r\n\t\t\t\t'options' => array(\r\n\t\t\t\t\t'yes' => 'Yes',\r\n\t\t\t\t\t'no' => 'No',\r\n\t\t\t\t),\t\t\t\t\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Gallery */\r\n\t\t\t \r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'name' => 'Gallery',\r\n\t\t\t\t'id' => $this->metafield_prefix . '_post_gallery',\r\n\t\t\t\t'type' => 'file_list',\r\n\t\t\t\t'desc' => 'Upload images. You can sort image by draging an image to the location where you want it to be.<br />\r\n\t\t\t\t\t\t <span style=\"color:red;\">To be used with the format \"Gallery\" or \"All\"!</span>',\r\n\t\t\t\t'text' => array(\r\n\t\t\t\t\t'add_upload_files_text' => 'Upload image(s)',\r\n\t\t\t\t),\r\n\t\t\t\t'preview_size' => array( 70, 50 ),\r\n\t\t\t\t'query_args' => array(\r\n\t\t\t\t\t'type' => 'image',\r\n\t\t\t\t)\t\t\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Image */\r\n\t\t\t \r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'name' => 'Image',\r\n\t\t\t\t'id' => $this->metafield_prefix . '_post_image',\r\n\t\t\t\t'type' => 'file',\r\n\t\t\t\t'desc' => 'Add or upload the image. <span style=\"color:red;\">To be used with the format \"Image\" or \"All\"!</span>',\r\n\t\t\t\t'text' => array(\r\n\t\t\t\t\t'add_upload_file_text' => 'Upload image',\r\n\t\t\t\t),\r\n\t\t\t\t'preview_size' => array( 100, 100 ),\r\n\t\t\t\t'query_args' => array(\r\n\t\t\t\t\t'type' => 'image',\r\n\t\t\t\t),\r\n\t\t\t\t'options' => array(\r\n\t\t\t\t\t'url' => false\r\n\t\t\t\t),\t\t\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Audio */\r\n\t\t\t \r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'name' => 'Audio',\r\n\t\t\t\t'id' => $this->metafield_prefix . '_post_audio',\r\n\t\t\t\t'type' => 'file',\r\n\t\t\t\t'desc' => 'Add or upload the audio file. <span style=\"color:red;\">To be used with the format \"Audio\" or \"All\"!</span>',\r\n\t\t\t\t'text' => array(\r\n\t\t\t\t\t'add_upload_file_text' => 'Upload audio file',\r\n\t\t\t\t),\r\n\t\t\t\t'preview_size' => array( 100, 100 ),\r\n\t\t\t\t'query_args' => array(\r\n\t\t\t\t\t'type' => 'audio',\r\n\t\t\t\t)\t\t\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Embed */\r\n\t\t\t \r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'id' => $this->metafield_prefix . '_post_embed',\r\n\t\t\t\t'name' => 'Embed URL',\r\n\t\t\t\t'desc' => 'Enter the URL that should be embedded. It could be a video (Youtube, vimeo ...) URL, Audio playlist URL, Website URL and more. <span style=\"color:red;\">To be used with the format \"Embed\" or \"All\"!</span><br />\r\n\t\t\t\t\t\t <span style=\"color:red\">Check the list of supported services <a href=\"https://wordpress.org/support/article/embeds/\" target=\"_blank\" class=\"cspm_blank_link\">https://wordpress.org/support/article/embeds/</a>.<br />\r\n\t\t\t\t\t\t If the URL is a valid url to a supported provider, the plugin will use the embed code provided to it. Otherwise, it will be ignored!</span>',\r\n\t\t\t\t'type' => 'text_url',\r\n\t\t\t);\r\n\r\n\t\t\treturn $fields;\r\n\t\t\t\t\t\t \r\n\t\t}",
"public function getFormType()\n {\n return 'oo_media_image';\n }",
"function thisismyurl_add_custom_media_fields($form_fields, $post)\n{\n\n $media_custom_fields = get_option('thisismyurl_custom_media_fields', NULL);\n\n foreach ($media_custom_fields as $custom_field) {\n\n $form_fields[$custom_field['unique_id']] = array(\n 'label' => $custom_field['name'],\n 'value' => get_post_meta($post->ID, '_' . $custom_field['unique_id'], true),\n 'helps' => $custom_field['help']\n );\n\n }\n\n return $form_fields;\n}",
"function ale_media_custom_fields() {\n\treturn array();\n}",
"function aletheme_media_custom_fields() {\n\treturn array();\n}",
"function dk_social_media_fields() {\n\trequire_once( get_template_directory() . '/assets/snippets/options-fields-social-media.php' );\n}",
"function thisismyurl_add_custom_media_fields( $form_fields, $post ) {\n\n $media_custom_fields = get_option( 'thisismyurl_custom_media_fields', NULL );\n\n foreach ( $media_custom_fields as $custom_field ) {\n\n $form_fields[ $custom_field['unique_id'] ] = array(\n 'label' => $custom_field['name'] ,\n 'value' => get_post_meta( $post->ID, '_' . $custom_field['unique_id'] , true ),\n 'helps' => $custom_field['help']\n );\n\n }\n\n\treturn $form_fields;\n}",
"protected function addCustomFields()\n {\n if($this->isNew())\n {\n $this->widgetSchema['resize_size'] = new crWidgetFormChoiceAndChoice(\n array(\n 'choiceA'=>array('choices'=>$this->getObject()->getResizeOptions()),\n 'choiceB'=>array('choices'=>$this->getObject()->getResizeOptions()),\n 'format'=>'%choiceA% x %choiceB% px'\n )\n );\n // Must be set the wished value -30; In this case, the default will be 150 and 120\n $this->setDefault('resize_size','120 120');\n }\n $this->widgetSchema['description'] = new sfWidgetFormTextarea();\n\n }",
"public function getFormRenderer();",
"function add_media_picker( int $post_id, string $key, string $label ): void {\n\t\t\\wpinc\\meta\\add_media_picker( $post_id, $key, $label );\n\t}",
"public function getMediaField($name, $value = null, array $data = array())\n\t{\n\t\t// init media field\n\t\t$field = new JFormFieldMedia(null, $value);\n\t\t// setup an empty form as placeholder\n\t\t$field->setForm(new JForm('managepayment.media'));\n\n\t\t// force field attributes\n\t\t$data['name'] = $name;\n\t\t$data['value'] = $value;\n\n\t\tif (empty($data['previewWidth']))\n\t\t{\n\t\t\t// there is no preview width, set a defualt value\n\t\t\t// to make the image visible within the popover\n\t\t\t$data['previewWidth'] = 480;\t\n\t\t}\n\n\t\t// render the field\t\n\t\treturn $field->render('joomla.form.field.media', $data);\n\t}",
"static function display_form_field_type_image( $field, $value, $name ) {\n\t\t?>\n\t\t<div class=\"clientside-form-image-preview <?php if ( ! $value ) { echo '-empty'; } ?>\" id=\"<?php echo 'clientside-formfield-' . $field['name']; ?>-preview\">\n\t\t\t<img class=\"clientside-form-image-preview-image clientside-media-select-button\" id=\"<?php echo 'clientside-formfield-' . $field['name']; ?>-preview-image\" src=\"<?php echo $value; ?>\">\n\t\t</div>\n\t\t<input class=\"clientside-form-image-input\" id=\"<?php echo 'clientside-formfield-' . $field['name']; ?>\" type=\"text\" name=\"<?php echo esc_attr( $name ); ?>\" value=\"<?php echo $value; ?>\"><br>\n\t\t<a href=\"#\" class=\"button button-primary clientside-media-select-button\" id=\"<?php echo 'clientside-formfield-' . $field['name']; ?>-upload-button\"><?php _ex( 'Upload', 'Upload button text', 'clientside' ); ?></a>\n\t\t<div class=\"clear\"></div>\n\t\t<?php\n\t}",
"public function getFormType()\n {\n return 'oo_media_base';\n }",
"function theme_emimage_image_embed($field, $item, $formatter, $node, $options = array()) {\n if ($item['value'] && $item['provider']) {\n $output = drupal_get_form('emimage_embed_form', $field, $item, $formatter, $node, $options);\n }\n return $output;\n}",
"function image_field($name, $options=array()) {\n // Setup the options\n $options = array_merge(\n array(\n 'id' => 0,\n 'delete' => true,\n 'change' => true,\n 'insert_text' => __('Insert %s'),\n 'change_text' => __('Change'),\n 'add_text' => __('Add'),\n 'delete_text' => __('Delete'),\n 'preview_size' => 'wp-image-form-field-preview',\n 'label' => ''\n ),\n $options);\n \n // Ensure the image size exists, get the dimensions\n global $_wp_additional_image_sizes;\n if(!isset($_wp_additional_image_sizes[$options['preview_size']])) {\n $options['preview_size'] = 'wp-image-form-field-preview';\n }\n $height = $_wp_additional_image_sizes[$options['preview_size']]['height'];\n $width = $_wp_additional_image_sizes[$options['preview_size']]['width'];\n \n $field_id = $this->field_uid($name);\n \n //NOTE #1: the widget id is added here to allow uploader to only return array if this is used with image widget so that all other uploads are not harmed.\n $media_upload_iframe_query = array(\n 'type' => 'image',\n 'wp_image_field' => true,\n 'preview_size' => $options['preview_size'],\n 'insert_text' => sprintf($options['insert_text'], $options['label']),\n );\n global $post;\n $media_upload_iframe_query['post_id'] = $post->ID;\n \n $media_upload_iframe_query = http_build_query($media_upload_iframe_query, '', '&');\n $media_upload_iframe_src = admin_url('media-upload.php?'.$media_upload_iframe_query); \n\t\t$image_upload_iframe_src = apply_filters('image_upload_iframe_src', $media_upload_iframe_src);\n\t\t\n $image = '';\n $image_showing = false;\n if(!empty($options['img'])) {\n $image = $this->get_image($options['img']['src'], $options['img']['attrs']);\n $image_showing = true;\n } elseif(!empty($options['id'])) {\n $image_info = $this->get_image_information($options['id']);\n $preview = $image_info->sizes[$options['preview_size']];\n $image = $this->get_image($preview->src, array('height' => $preview->height, 'width' => $preview->width));\n $image_showing = true;\n }\n \n $image_icon = '<img src=\"' . admin_url( 'images/media-button-image.gif' ) . '\" alt=\"\" align=\"absmiddle\" /> ';\n $delete_icon = '<span class=\"wp-image-form-field--delete-icon\" style=\"background-image: url('.admin_url( 'images/xit.gif' ).');\" > </span> ';\n \n \n ?>\n <div class=\"wp-image-form-field <?php echo $image_showing? 'wp-image-form-field-with-image' : 'wp-image-form-field-without-image' ?>\" \n style=\"height: <?php echo $height; ?>px; width: <?php echo $width; ?>px;\"\n id=\"<?php echo $field_id; ?>\">\n <input type=\"hidden\" name=\"<?php echo $name; ?>\" value=\"<?php echo empty($options['id'])? '': $options['id']; ?>\" />\n <div class=\"wp-image-form-field--image\" style=\"line-height: <?php echo $height; ?>px\"><?php echo $image;?></div> \n <div class=\"wp-image-form-field--buttons\">\n <a href=\"<?php echo $image_upload_iframe_src; ?>&TB_iframe=true\" class=\"button wp-image-form-field--add wp-image-form-field--open-media-library thickbox\"><?php echo $image_icon . sprintf($options['add_text'], $options['label']); ?></a>\n <?php if($options['change']): ?>\n <a href=\"<?php echo $image_upload_iframe_src; ?>&image_id=&tab=library&TB_iframe=true\" class=\"button wp-image-form-field--change wp-image-form-field--open-media-library thickbox\"><?php echo $image_icon . sprintf($options['change_text'], $options['label']); ?></a>\n <?php endif; ?>\n <?php if($options['delete']): ?>\n <a href=\"#\" class=\"button delete wp-image-form-field--delete\"><?php echo $delete_icon . sprintf($options['delete_text'], $options['label']); ?></a>\n <?php endif; ?>\n </div>\n </div>\n <?php if(!empty($options['additional'])): ?>\n <script type=\"text/javascript\">\n jQuery('#<?php echo $field_id; ?>').data('additional', <?php echo json_encode($options['additional']); ?>);\n </script>\n <?php endif; ?>\n <?php\n \n }",
"public function getMediaType()\n {\n return $this->getProductForm();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test isValidInput method of class Validator with an invalid type: IPv4 Address. | function testIsValidInput_IPv4Address_invalid_01()
{
$instance = ESAPI::getValidator();
$this->assertFalse($instance->isValidInput('test', '..168.1.234', 'IPAddress', 100, false));
} | [
"public function testValidate() {\n\t\t$ip = 'test';\n\t\t$this->assertFalse ( $this->_ipv4->validateIP ( $ip ) );\n\t\t$this->assertFalse ( $this->_ipv4->check_ip ( $ip ) );\n\t\t$ip = '192.168.0.1';\n\t\t$this->assertTrue ( $this->_ipv4->validateIP ( $ip ) );\n\t\t$this->assertTrue ( $this->_ipv4->check_ip ( $ip ) );\n\t\t$ip = '999.168.0.1';\n\t\t$this->assertFalse ( $this->_ipv4->validateIP ( $ip ) );\n\t\t$this->assertFalse ( $this->_ipv4->check_ip ( $ip ) );\n\t\t$mask = 'test';\n\t\t$this->assertFalse ( $this->_ipv4->validateNetmask ( $mask ) );\n\t\t$mask = '255.255.255.0';\n\t\t$this->assertTrue ( $this->_ipv4->validateNetmask ( $mask ) );\n\t\t$mask = '999.255.255.0';\n\t\t$this->assertFalse ( $this->_ipv4->validateNetmask ( $mask ) );\n\t}",
"public function testIpv4Invalid()\n {\n $controller = new ValidateIpController();\n // $controller->ipv4();\n $res = $controller->ipv4(\"invalid\");\n $this->assertContains(\"Validerar ej\", $res);\n }",
"public function testValidateAddress()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function test_valid_ip()\n\t{\n\t\t$name = 'test';\n\t\t$label = 'Test field';\n\t\t$params = array('label' => $label);\n\n\t\tself::$inst\n\t\t\t-> add($name, $label)\n\t\t\t-> add_rule('valid_ip');\n\n\t\t$this->assertFalse( self::$inst->run(array($name => 'localhost')) );\n\n\t\t$expected = array( $name => \\Lang::get('validation.valid_ip', $params, null, 'ja') );\n\t\t$actual = array_map(function($v){ return (string)$v; }, self::$inst->error());\n\t\t$this->assertEquals($expected, $actual);\n\t}",
"public function testIp()\n\t{\n\t\t$this->assertTrue(Validate::ip('192.168.0.1'));\n\n\t\t$this->assertFalse(Validate::ip('256.256.256.256'));\n\n\t\t$this->assertTrue(Validate::ip('684D:1111:222:3333:4444:5555:6:77', 'ipv6'));\n\n\t\t$this->assertFalse(Validate::ip('192.168.0.1', 'ipv6'));\n\n\t\t$this->assertFalse(Validate::ip('684D:1111:222:3333:4444:5555:6:77', 'ipv4'));\n\t}",
"function is_ipaddr_valid($val)\n{\n return is_string($val) && (is_ipaddr($val) || is_masksubnet($val) || is_subnet($val) || is_iprange_sg($val));\n}",
"public function testValidate()\n {\n $pass = false;\n\n // Sorry have to do this instead of using @dataProvider to avoid breaking the contract.\n foreach ($this->cidrProvider() as $cidr) {\n list ($expected, $address) = $cidr;\n try {\n $this->_definition = new \\Whitelist\\Definition\\IPv4CIDR($address);\n $pass = true;\n } catch (Exception $e) {\n $pass = false;\n }\n $this->assertEquals($expected, $pass);\n }\n\n }",
"function validate_internal_ip_address($value) {\n if (!filter_var($value, FILTER_VALIDATE_IP)) {\n throw new Carbon_Validator_ValidationError(\"Please enter valid IP address. \");\n }\n $pieces = explode('.', $value);\n\n if (count($pieces) !== 4) {\n throw new Carbon_Validator_ValidationError(\"Your IP should have exactly 4 numbers. \");\n }\n\n if (intval($pieces[0]) !== 192 || intval($pieces[1]) !== 168) {\n throw new Carbon_Validator_ValidationError(\"Your IP address should start with 192.168 \");\n }\n\n return true;\n}",
"public function testInvalidIPv4Address()\n {\n $lookup = new Whip(Whip::REMOTE_ADDR);\n $lookup->setSource(array('REMOTE_ADDR' => '127.0.0.256'));\n $this->assertFalse($lookup->getValidIpAddress());\n }",
"public static function validIpDataProvider() {}",
"public function testRuleIsIp(): void {\r\n\r\n //Should pass\r\n foreach(['::1', '192.168.1.1', '127.0.0.1', '1.1.1.1', '255.255.255.255', '2001:0db8:85a3:0000:0000:8a2e:0370:7334'] as $data) {\r\n\r\n $validator = new Validator(['field' => $data]);\r\n $validator -> field('field') -> isIp();\r\n $this -> assertTrue($validator -> passes());\r\n $this -> assertFalse($validator -> fails());\r\n }\r\n\r\n //Should fail\r\n foreach([null, (object) [], [], 'abcdef', true, '255.255.255.256', '20010:0db8:85a3:0000:0000:8a2e:0370:7334'] as $data) {\r\n \r\n $validator = new Validator(['field' => $data]);\r\n $validator -> field('field') -> isIp();\r\n $this -> assertFalse($validator -> passes());\r\n }\r\n\r\n //Should fail\r\n $validator = new Validator();\r\n $validator -> field('field') -> isIp();\r\n $this -> assertFalse($validator -> passes());\r\n }",
"public function testIPAddressRule()\n {\n $this->assertSame($this->rules, $this->rules->ipAddress());\n $this->assertTrue($this->rules->pass('127.0.0.1'));\n }",
"public function valid() {\n return filter_var($this->address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false;\n }",
"public function testTheIPRule()\n\t{\n\t\t$input = array('ip' => '192.168.1.1');\n\t\t$rules = array('ip' => 'ip');\n\t\t$this->assertTrue(Validator::make($input, $rules)->valid());\n\n\t\t$input['ip'] = '192.111';\n\t\t$this->assertFalse(Validator::make($input, $rules)->valid());\n\t}",
"function ipv4_is_valid(string $ipV4): bool\n{\n return filter_var($ipV4, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false;\n}",
"public function testInvalidIPv4Address()\n {\n $_SERVER = array('REMOTE_ADDR' => '127.0.0.01');\n $lookup = new Whip($_SERVER, Whip::REMOTE_ADDR);\n $this->assertTrue(false === $lookup->getValidIpAddress());\n }",
"public function testValidateIpAction()\n {\n // test ip4\n $_GET[\"ipAdress\"] = \"8.8.8.8\";\n $res = $this->apiControllerTest->validateIpApiAction();\n $this->assertIsArray($res);\n\n $_GET[\"ipAdress\"] = \"1.2.4.0\";\n $res = $this->apiControllerTest->validateIpApiAction();\n $this->assertIsArray($res);\n\n // test ip not valid\n $_GET[\"ipAdress\"] = \"1.2.0\";\n $res = $this->apiControllerTest->validateIpApiAction();\n\n $this->assertEquals(\"Ip-adressen 1.2.0 är inte giltig\", $res[0][0][\"valid\"]); // << valid undefined\n $this->assertEquals(null, $res[0][0][\"domain\"]);\n\n // test ip6\n $_GET[\"ipAdress\"] = \"::1\";\n $res = $this->apiControllerTest->validateIpApiAction();\n $this->assertIsString($res[0][0][\"domain\"]);\n }",
"public function testIsIpOnValid() {\n\t\t$validIp = array('192.168.1.1');\n\t\t$nonArrayIp = '10.100.0.1';\n\n\t\t$this->assertTrue($this->SeoAppModel->isIp($validIp));\n\t\t$this->assertTrue($this->SeoAppModel->isIp($nonArrayIp));\n\t}",
"function validateIPAddress($ip_addr)\n{\n\t//echo \"Debug IP validation: ip_addr = '$ip_addr'<br>\";\n\t// first of all the format of the ip address is matched\n\tif(preg_match(\"/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/\",$ip_addr))\n\t{\n\t\t// now all the intger values are separated\n\t\t$parts=explode(\".\",$ip_addr);\n\t\t// now we need to check each part can range from 0-255\n\t\tforeach($parts as $ip_parts)\n\t\t{\n\t\t\tif(intval($ip_parts)>255 || intval($ip_parts)<0)\n\t\t\t\treturn 0; // if number is not within range of 0-255\n\t\t}\n\t\treturn 1;\n\t}\n\telseif(preg_match(\"/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/\", $ip_addr))\n\t{\n\t\t//check for invalid addresses\n\t\tif(preg_match(\"/^[fF][eE]80:|^[fF]{2}00:|^0{1,4}:/\", $ip_addr))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\treturn 1;\n\t}\n\telseif($ip_addr == \"\") { return 1; }\n\treturn 0; // if format of ip address doesn't matches\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the 'sylius.generator.promotion_coupon' service. This service is shared. This method always returns the same instance of the service. | protected function getSylius_Generator_PromotionCouponService()
{
return $this->services['sylius.generator.promotion_coupon'] = new \Sylius\Component\Promotion\Generator\CouponGenerator($this->get('sylius.repository.promotion_coupon'), $this->get('doctrine.orm.default_entity_manager'));
} | [
"public function coupon()\n {\n return new Coupon($this->promotionCode->coupon);\n }",
"protected function getGenerator()\n {\n return $this->get('sylius.generator.promotion_coupon');\n }",
"public function coupon()\n {\n return new Coupon($this->discount->coupon);\n }",
"protected function getSylius_Form_Type_PromotionCouponToCodeService()\n {\n return $this->services['sylius.form.type.promotion_coupon_to_code'] = new \\Sylius\\Bundle\\PromotionBundle\\Form\\Type\\CouponToCodeType($this->get('sylius.repository.promotion_coupon'), $this->get('event_dispatcher'));\n }",
"protected function getSylius_PromotionProcessorService()\n {\n return $this->services['sylius.promotion_processor'] = new \\Sylius\\Component\\Promotion\\Processor\\PromotionProcessor(${($_ = isset($this->services['sylius.active_promotions_provider']) ? $this->services['sylius.active_promotions_provider'] : $this->get('sylius.active_promotions_provider')) && false ?: '_'}, ${($_ = isset($this->services['sylius.promotion_eligibility_checker']) ? $this->services['sylius.promotion_eligibility_checker'] : $this->get('sylius.promotion_eligibility_checker')) && false ?: '_'}, ${($_ = isset($this->services['sylius.promotion_applicator']) ? $this->services['sylius.promotion_applicator'] : $this->get('sylius.promotion_applicator')) && false ?: '_'});\n }",
"protected function getSylius_PromotionProcessorService()\n {\n return $this->services['sylius.promotion_processor'] = new \\Sylius\\Component\\Promotion\\Processor\\PromotionProcessor($this->get('sylius.repository.promotion'), $this->get('sylius.promotion_eligibility_checker'), $this->get('sylius.promotion_applicator'));\n }",
"public function getOrderCoupon()\n {\n return $this->oOrderCoupon;\n }",
"protected function getSylius_Repository_PromotionRuleService()\n {\n return $this->services['sylius.repository.promotion_rule'] = new \\Sylius\\Bundle\\ResourceBundle\\Doctrine\\ORM\\EntityRepository(${($_ = isset($this->services['doctrine.orm.default_entity_manager']) ? $this->services['doctrine.orm.default_entity_manager'] : $this->get('doctrine.orm.default_entity_manager')) && false ?: '_'}, ${($_ = isset($this->services['doctrine.orm.default_entity_manager']) ? $this->services['doctrine.orm.default_entity_manager'] : $this->get('doctrine.orm.default_entity_manager')) && false ?: '_'}->getClassMetadata('Sylius\\\\Component\\\\Promotion\\\\Model\\\\PromotionRule'));\n }",
"protected function getSylius_Fixture_PromotionService()\n {\n return $this->services['sylius.fixture.promotion'] = new \\Sylius\\Bundle\\CoreBundle\\Fixture\\PromotionFixture(${($_ = isset($this->services['doctrine.orm.default_entity_manager']) ? $this->services['doctrine.orm.default_entity_manager'] : $this->get('doctrine.orm.default_entity_manager')) && false ?: '_'}, ${($_ = isset($this->services['sylius.fixture.example_factory.promotion']) ? $this->services['sylius.fixture.example_factory.promotion'] : $this->get('sylius.fixture.example_factory.promotion')) && false ?: '_'});\n }",
"public function personalCoupon()\n {\n return $this->hasOne('App\\Coupon');\n }",
"public function coupon()\n {\n return $this->belongsTo(Coupon::class);\n }",
"public function coupon()\n {\n return $this->belongsTo(\"App\\Models\\Merchant\\CouponModel\", \"coupon_id\", \"id\");\n }",
"public function getCouponRef()\n\t{\n\t\treturn $this->couponRef;\n\t}",
"public static function instance()\n {\n if( empty(self::$_instance) or !self::$_instance instanceof CouponMaker ) {\n self::$_instance = new CouponMaker();\n }\n\n return self::$_instance;\n }",
"public function getCouponInfo()\n {\n return $this->couponInfo;\n }",
"protected function getCouponMappingRepository()\n {\n return Shopware()->Models()->getRepository('Shopware\\CustomModels\\Blisstribute\\BlisstributeCoupon');\n }",
"public function coupons()\n {\n return $this->morphMany('App\\Coupon', 'reduction');\n }",
"public function getCouponCode()\n {\n return $this->couponCode;\n }",
"protected function getSylius_Factory_PromotionRuleService()\n {\n return $this->services['sylius.factory.promotion_rule'] = new \\Sylius\\Component\\Core\\Factory\\PromotionRuleFactory(new \\Sylius\\Component\\Resource\\Factory\\Factory('Sylius\\\\Component\\\\Promotion\\\\Model\\\\PromotionRule'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves Github general statistics from local database | public function getGithubGeneralStats() {
$dataArray = array('total_repos' => 0, 'total_commits' => 0);
$totalReposQuery = "SELECT COUNT(*) FROM github_repos";
$result = $this->connection->query($totalReposQuery);
$result = $result->fetchAll(PDO::FETCH_ASSOC)[0]['COUNT(*)'];
$dataArray['total_repos'] = (isset($result) && is_numeric($result)) ? $result : 0;
$totalCommitsQuery = "SELECT SUM(commits) FROM github_repos";
$result = $this->connection->query($totalCommitsQuery);
$result = $result->fetchAll(PDO::FETCH_ASSOC)[0]['SUM(commits)'];
$dataArray['total_commits'] = (isset($result) && is_numeric($result)) ? $result : 0;
return $dataArray;
} | [
"public function get_statistics();",
"function print_db_stats() {\n\t\techo 'Documents: '.$this->get_num_papers();\n\t\techo '<br>';\n\t\techo 'Similarities: '.$this->get_num_sim();\n\t\techo '<br>';\n\t}",
"public function getStats()\n\t{\n\t $this->load->model('tasks');\n\t $this->tasks->truncate('stats');\n\t $this->load->model('configuration');\n\t $dbList = $this->configuration->getDBList();\n\t foreach($dbList->result() as $db)\n\t $this->tasks->pullStats($db->dbGroup,$db->friendlyName);\n\n\t $this->_updateCronStats();\n\t}",
"private function readStats() {\n\t\t\t$STH = $this->db->DBH->prepare(\"SELECT * FROM statistics ORDER BY lastCreatedGame ASC LIMIT 1\");\n\t\t\t$STH->execute();\n\t\t\treturn $STH->fetch(\\PDO::FETCH_ASSOC);\n\t\t}",
"protected function acquireSocialStats()\n {\n $this->em = $this->getContainer()->get('doctrine')->getManager();\n $posts = $this->em->getRepository('EmpireBundle:Post')->createQueryBuilder('p')\n ->orderBy('p.socialDate', 'ASC')\n ->setFirstResult(0)\n ->setMaxResults(500)\n ->getQuery()\n ->getResult();\n foreach ($posts as $post) {\n $url = 'http://'.$post->getSite()->getSiteUrl().'/'.$post->getSlug();\n $fb = $this->getFacebookShares($url);\n echo 'FB:' .$fb.PHP_EOL;\n //$tw = $this->getTwitterStats($url);\n echo 'TW:' .$fb.PHP_EOL;\n $bs = $this->getBuzzSumoQuery($url);\n //echo 'TW:' .$fb.PHP_EOL;\n //$post->setFacebookShares($fb);\n //$post->setSocialDate(Carbon::now()->timestamp);\n //$this->em->persist($post);\n //$this->em->flush();\n }\n }",
"function drush_donl_statistics_collect() {\n \\Drupal::service('donl_statistics.collect')->collect();\n}",
"public static function repoStat($human = false)\n {\n return self::statsRepo($human);\n }",
"public function get_project_stats( $request ) {\n\t\tif ( isset( $request['org'] ) && isset( $request->get_query_params()['project_name'] ) ) {\n\t\t\t$org = esc_html( $request['org'] );\n\t\t\t$project_name = esc_html( $request->get_query_params()['project_name'] );\n\t\t} else {\n\t\t\treturn new WP_Error(\n\t\t\t\t'not_found',\n\t\t\t\tesc_html__( 'You did not specify a valid GitHub org and/or project_name', 'ghactivity' ),\n\t\t\t\tarray(\n\t\t\t\t\t'status' => 404,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// [average_time, date_of_record, recorded_issues]\n\t\t$records = GHActivity_Queries::fetch_project_stats( $org, $project_name );\n\n\t\t$response = array(\n\t\t\t'org' => $org,\n\t\t\t'project_name' => $project_name,\n\t\t\t'records' => $records,\n\t\t);\n\t\treturn new WP_REST_Response( $response, 200 );\n\t}",
"public function refreshStatistics()\n {\n $query = 'useStats/summary/?what=' . $this->contentType;\n\n $response = self::doGETRequest($query);\n\n // Check status code of response\n if (isset($response['Statuscode']) && $response['Statuscode'] == 'OK')\n {\n if (isset($response['StatisticsSummary']) && isset($response['StatisticsSummary']['NowTimestamp']))\n {\n $this->lastUpdate = $response['StatisticsSummary']['NowTimestamp'];\n }\n\n $this->cachedData = $response;\n }\n else\n {\n $errorMessage = (isset($response['Message']) ? $response['Message'] : 'Could not fetch remote data.');\n\n die('<p><b>Error:</b> ' . $errorMessage . '</p>');\n }\n }",
"public function get_protocol_stats()\n {\n\n if (! $this->authorized()) {\n // die('Authenticate first.'); // Todo: return json\n $out['error'] = 'Not authorized';\n }\n\n $queryobj = new munkiinfo_model();\n $sql = \"SELECT COUNT(1) as total,\n COUNT(CASE WHEN `munkiinfo_key` = 'munkiprotocol' AND `munkiinfo_value` = 'http' THEN 1 END) AS http,\n COUNT(CASE WHEN `munkiinfo_key` = 'munkiprotocol' AND `munkiinfo_value` = 'https' THEN 1 END) AS https,\n COUNT(CASE WHEN `munkiinfo_key` = 'munkiprotocol' AND `munkiinfo_value` = 'localrepo' THEN 1 END) AS localrepo\n FROM munkiinfo\n LEFT JOIN reportdata USING (serial_number)\n \".get_machine_group_filter();\n $obj = new View();\n $obj->view('json', array('msg' => current($queryobj->query($sql))));\n }",
"function globalStatistics() {\r\n\r\n\t// We need some stuff.\r\n\tglobal $DB;\r\n\tglobal $MySelf;\r\n\r\n\t/*\r\n\t * Global Information\r\n\t */\r\n\r\n\t// Create the header of the table\r\n\t$stat_table = new table(2, true);\r\n\t$stat_table->addHeader(\">> Global Information for \" . getConfig(\"sitename\"));\r\n\r\n\t// Total Users\r\n\t$temp = $DB->getCol(\"SELECT COUNT(id) FROM users WHERE deleted='0'\");\r\n\t$totalUsers = $temp[0];\r\n\t$stat_table->addRow();\r\n\t$stat_table->addCol(\"Total user accounts:\");\r\n\t$stat_table->addCol(number_format($totalUsers, 0));\r\n\r\n\t// Total Logins\r\n\t$temp = $DB->getCol(\"SELECT COUNT(authkey) FROM auth\");\r\n\t$temp = $temp[0];\r\n\t$stat_table->addRow();\r\n\t$stat_table->addCol(\"Total logins:\");\r\n\t$stat_table->addCol(number_format($temp, 0));\r\n\r\n\t// Total failed logins\r\n\t$temp = $DB->getCol(\"SELECT COUNT(incident) FROM failed_logins\");\r\n\t$temp = $temp[0];\r\n\t$stat_table->addRow();\r\n\t$stat_table->addCol(\"Total failed logins:\");\r\n\t$stat_table->addCol(number_format($temp, 0));\r\n\r\n\t// Total API keys\r\n\t$temp = $DB->getCol(\"SELECT COUNT(userid) FROM api_keys\");\r\n\t$totalApiKeys = $temp[0];\r\n\tif ($totalApiKeys > 0) {\r\n\t\t$stat_table->addRow();\r\n\t\t$stat_table->addCol(\"Total API keys stored:\");\r\n\t\t$stat_table->addCol(number_format($totalApiKeys, 0));\r\n\r\n\t\t// Total API keys\r\n\t\t$temp = $DB->getCol(\"SELECT COUNT(userid) FROM api_keys WHERE api_valid=1\");\r\n\t\t$totalValidApiKeys = $temp[0];\r\n\t\t$stat_table->addRow();\r\n\t\t$stat_table->addCol(\"Total API keys validated:\");\r\n\t\t$stat_table->addCol(number_format($totalValidApiKeys, 0));\r\n\r\n\t\t// Total API keys percentage\r\n\t\t$stat_table->addRow();\r\n\t\t$stat_table->addCol(\"Percent of stored keys valid:\");\r\n\t\t$stat_table->addCol(number_format((($totalValidApiKeys * 100) / $totalApiKeys), 2) . \"%\");\r\n\r\n\t\t// Total API keys percentage (over all users)\r\n\t\t$stat_table->addRow();\r\n\t\t$stat_table->addCol(\"Percent of pilots submited API keys:\");\r\n\t\t$stat_table->addCol(number_format((($totalApiKeys * 100) / $totalUsers), 2) . \"%\");\r\n\t}\r\n\r\n\t/*\r\n\t * Mining Information\r\n\t */\r\n\r\n\t// Create the header of the table\r\n\t$mining_table = new table(2, true);\r\n\t$mining_table->addHeader(\">> Mining Information for \" . getConfig(\"sitename\"));\r\n\r\n\t// Total Mining Operations\r\n\t$temp = $DB->getCol(\"SELECT COUNT(id) FROM runs WHERE isOfficial = 1\");\r\n\t$totalMiningOps = $temp[0];\r\n\t$mining_table->addRow();\r\n\t$mining_table->addCol(\"Total Mining Operations:\");\r\n\t$mining_table->addCol(number_format($totalMiningOps, 0));\r\n\r\n\t// Total Number of Joins\r\n\t$temp = $DB->getCol(\"SELECT COUNT( uJoinups ) FROM (SELECT COUNT( id ) AS uJoinups FROM joinups GROUP BY `run`,`userid`) AS suJoinups\");\r\n\t$totalJoinUps = $temp[0];\r\n\t$mining_table->addRow();\r\n\t$mining_table->addCol(\"Total joinups:\");\r\n\t$mining_table->addCol(number_format($totalJoinUps, 0));\r\n\r\n\t// Total Hauling Runs\r\n\t$temp = $DB->getCol(\"SELECT COUNT(id) FROM hauled\");\r\n\t$totalHaulingRuns = $temp[0];\r\n\t$mining_table->addRow();\r\n\t$mining_table->addCol(\"Total Hauling Runs:\");\r\n\t$mining_table->addCol(number_format($totalHaulingRuns, 0));\r\n\r\n\t// Total ISK Mined\r\n\t$mining_table->addRow();\r\n\t$mining_table->addCol(\"Total ISK mined:\");\r\n\t$totalIskMined = calculateTotalIskMined();\r\n\t$mining_table->addCol(number_format($totalIskMined) . \" ISK\");\r\n\r\n\t// Average TMEC\r\n\t$aTMEC = $DB->getCol(\"SELECT AVG(tmec) FROM runs WHERE isOfficial = 1\");\r\n\t$aTMEC = $aTMEC[0];\r\n\t$mining_table->addRow();\r\n\t$mining_table->addCol(\"Average TMEC:\");\r\n\tif ($aTMEC <= 0) {\r\n\t\t$aTMEC = 0;\r\n\t}\r\n\t$mining_table->addCol(number_format($aTMEC, 3));\r\n\t\r\n\t// Total time spent mining\r\n\t$temp = $DB->getCol(\"SELECT SUM(endtime-starttime) AS time FROM runs WHERE endtime >0 AND isOfficial = 1\");\r\n\t$time = $temp[0];\r\n\r\n\tif ($time > 0) {\r\n\t\t$totalTimeSpentMining = $time;\r\n\t\t$string = numberToString($time);\r\n\t} else {\r\n\t\t$string = \"Never mined at all!\";\r\n\t}\r\n\t$mining_table->addRow();\r\n\t$mining_table->addCol(\"Total time spent mining:\");\r\n\t$mining_table->addCol($string);\r\n\r\n\t// Total pilot time\r\n\t$time = $DB->getCol(\"select SUM(parted-joined) as time from joinups WHERE parted >0\");\r\n\t$time = $time[0];\r\n\t$mining_table->addRow();\r\n\t$mining_table->addCol(\"Total time combined from all pilots:\");\r\n\tif ($time > 0) {\r\n\t\t$totalPilotTime = $time;\r\n\t\t$string = numberToString($time);\r\n\t} else {\r\n\t\t$string = \"Never mined at all!\";\r\n\t}\r\n\t$mining_table->addCol($string);\r\n\r\n\t/*\r\n\t * Money Stuff\r\n\t */\r\n\t$trans_Count = $DB->getCol(\"SELECT COUNT(id) FROM transactions\");\r\n\t$trans_Count = $trans_Count[0];\r\n\tif ($trans_Count > 0) {\r\n\t\t$trans = new table(2, true);\r\n\t\t$trans->addHeader(\">> Financial Statistics\");\r\n\r\n\t\t$trans->addRow();\r\n\t\t$trans->addCol(\"Total Transactions made:\");\r\n\t\t$trans->addCol(number_format($trans_Count, 0));\r\n\r\n\t\t$tmw = $DB->getCol(\"SELECT SUM(amount) FROM transactions WHERE type ='1'\");\r\n\t\t$tmd = $DB->getCol(\"SELECT SUM(amount) FROM transactions WHERE type ='0'\");\r\n\t\t$tmw = $tmw[0];\r\n\t\t$tmd = $tmd[0];\r\n\t\t$trans->addRow();\r\n\t\t$trans->addCol(\"Total Money withdrawn:\");\r\n\t\t$trans->addCol(number_format($tmw * -1, 2) . \" ISK\");\r\n\t\t$trans->addRow();\r\n\t\t$trans->addCol(\"Total Money deposited:\");\r\n\t\t$trans->addCol(number_format($tmd, 2) . \" ISK\");\r\n\t\t$trans->addRow();\r\n\t\t$trans->addCol(\"Difference:\");\r\n\t\t$trans->addCol(number_format($tmd + $tmw, 2) . \" ISK\");\r\n\r\n\t\t/*\r\n\t\t * Abbreviations:\r\n\t\t * por - PayOutRequests\r\n\t\t * pord - PayOutRequests Done\r\n\t\t * port - PayOutRequests Total\r\n\t\t * portd - PayOutRequests Total Done\r\n\t\t */\r\n\t\t$por = $DB->getCol(\"SELECT COUNT(request) FROM payoutRequests\");\r\n\t\t$port = $DB->getCol(\"SELECT SUM(amount) FROM payoutRequests\");\r\n\t\t$portd = $DB->getCol(\"SELECT SUM(amount) FROM payoutRequests WHERE payoutTime is NULL\");\r\n\t\t$pord = $DB->getCol(\"SELECT COUNT(request) FROM payoutRequests WHERE payoutTime is NULL\");\r\n\t\t$por = $por[0];\r\n\t\t$pord = $pord[0];\r\n\t\t$port = $port[0];\r\n\t\t$portd = $portd[0];\r\n\r\n\t\t$trans->addRow();\r\n\t\t$trans->addCol(\"Total payout requests:\");\r\n\t\t$trans->addCol(number_format($por, 0));\r\n\r\n\t\t$trans->addRow();\r\n\t\t$trans->addCol(\"Payout requests fulfilled:\");\r\n\t\t$trans->addCol(number_format(($por - $pord), 0));\r\n\r\n\t\t$trans->addRow();\r\n\t\t$trans->addCol(\"Payout requests pending:\");\r\n\t\t$trans->addCol(number_format($pord, 0));\r\n\r\n\t\t$trans->addRow();\r\n\t\t$trans->addCol(\"Total payout requested:\");\r\n\t\t$trans->addCol(number_format($port, 2) . \" ISK\");\r\n\r\n\t\t$trans->addRow();\r\n\t\t$trans->addCol(\"Total requested paid:\");\r\n\t\t$trans->addCol(number_format(($port - $portd), 2) . \" ISK\");\r\n\r\n\t\t$trans->addRow();\r\n\t\t$trans->addCol(\"Total requested open:\");\r\n\t\t$trans->addCol(number_format($portd, 2) . \" ISK\");\r\n\r\n\t\t$trans->addHeader(\"A positive difference means the Corp owes the players, a negative difference means the player owes the Corp.\");\r\n\r\n\t\t$trans_r = \"<br>\" . $trans->flush();\r\n\t}\r\n\r\n\t/*\r\n\t * Mining Statistics\r\n\t */\r\n\r\n\t// Create the header of the table\r\n\t$miningStats_table = new table(2, true);\r\n\t$miningStats_table->addHeader(\">> Mining Statistics for \" . getConfig(\"sitename\"));\r\n\r\n\t// Average ISK / OP\r\n\t$miningStats_table->addRow();\r\n\t$miningStats_table->addCol(\"Average ISK per Op:\");\r\n\t$miningStats_table->addCol(number_format(($totalIskMined / $totalMiningOps), 2) . \" ISK\");\r\n\r\n\t// Average ISK/ Hour\r\n\t$miningStats_table->addRow();\r\n\t$miningStats_table->addCol(\"Average ISK per hour:\");\r\n\t$miningStats_table->addCol(number_format(($totalIskMined / (ceil($totalTimeSpentMining / 3600))), 2) . \" ISK\");\r\n\r\n\t// Average joinups / Op\r\n\t$miningStats_table->addRow();\r\n\t$miningStats_table->addCol(\"Average Joinups per Op:\");\r\n\t$miningStats_table->addCol(number_format(($totalJoinUps / $totalMiningOps), 2));\r\n\r\n\t// Average hauls per OP:\r\n\t$miningStats_table->addRow();\r\n\t$miningStats_table->addCol(\"Average hauls per Op:\");\r\n\t$miningStats_table->addCol(number_format(($totalHaulingRuns / $totalMiningOps), 2));\r\n\r\n\t/*\r\n\t * Hauler statistics\r\n\t */\r\n\t$haulers = $DB->query(\"SELECT DISTINCT hauler, COUNT(miningrun) AS runs FROM hauled GROUP BY hauler ORDER BY runs DESC LIMIT 15\");\r\n\tif ($haulers->numRows() > 0) {\r\n\t\t\r\n\t\t$hauler_stats = new table(2, true);\r\n\t\t$hauler_stats->addHeader(\"Most hauling trips\");\r\n\t\t\r\n\t\twhile ($h = $haulers->fetchRow()) {\r\n\t\t\t\r\n\t\t\t// place counter.\r\n\t\t\t$place++;\r\n\r\n\t\t\t$hauler_stats->addRow();\r\n\t\t\t$hauler_stats->addCol(\"Place #\".$place.\":\");\r\n\t\t\t$hauler_stats->addCol(makeProfileLink($h[hauler]) . \" with \" . number_format($h[runs]) . \" runs!\");\r\n\t\t}\r\n\t\t$hauler_stats_table = \"<br>\" . $hauler_stats->flush();\t\r\n\t}\r\n\t\t\r\n\t/*\r\n\t * Most frequent joiners\r\n\t */\r\n\r\n $MFJDB = $DB->query(\"SELECT COUNT(userid) AS count, userid FROM (SELECT * FROM joinups GROUP BY userid,run) AS ujoinups GROUP BY userid ORDER BY count DESC LIMIT 15\");\r\n\t\r\n\tif ($MFJDB->numRows() > 0) {\r\n\t\t// Create the header of the table\r\n\t\t$frequentJoiners_table = new table(2, true);\r\n\t\t$frequentJoiners_table->addHeader(\">> Most frequent joiners for \" . getConfig(\"sitename\"));\r\n\r\n\t\t$place = \"1\";\r\n\t\twhile ($FJ = $MFJDB->fetchRow()) {\r\n\t\t\t$frequentJoiners_table->addRow();\r\n\t\t\t$frequentJoiners_table->addCol(\"Place #\" . $place . \":\");\r\n\t\t\t$frequentJoiners_table->addCol(makeProfileLink($FJ[userid]) . \" with \" . $FJ[count] . \" joinups!\");\r\n\t\t\t$place++;\r\n\t\t}\r\n\t\t$MFJ_r = \"<br>\" . $frequentJoiners_table->flush();\r\n\t}\r\n\r\n\t/*\r\n\t * Pilot record with mining time\r\n\t */\r\n\t$PMT = $DB->query(\"select SUM(parted-joined) AS totaltime, userid from joinups WHERE parted >0 GROUP BY userid ORDER BY totaltime DESC LIMIT 15\");\r\n\r\n\tif ($PMT->numRows() > 0) {\r\n\t\t// Create the header of the table\r\n\t\t$mostOnline_table = new table(2, true);\r\n\t\t$mostOnline_table->addHeader(\">> Most time spent mining\");\r\n\r\n\t\t$place = 1;\r\n\t\twhile ($P = $PMT->fetchRow()) {\r\n\t\t\t$time = $P[totaltime];\r\n\t\t\tif ($time > 0) {\r\n\t\t\t\t$string = numberToString($time);\r\n\r\n\t\t\t\t$mostOnline_table->addRow();\r\n\t\t\t\t$mostOnline_table->addCol(\"Place #\" . $place . \":\");\r\n\t\t\t $mostOnline_table->addCol(makeProfileLink($P[userid]) . \" with \" . $string);\r\n\t\t\t\t\r\n\t\t\t\t$place++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$MO_r = \"<br>\" . $mostOnline_table->flush();\r\n\t}\r\n\r\n\t/*\r\n\t * Longest OPS\r\n\t */\r\n\r\n\t$LOPS = $DB->query(\"select SUM(endtime-starttime) AS totaltime, id, location FROM runs WHERE endtime > 0 AND isOfficial = 1 GROUP BY id ORDER BY totaltime DESC LIMIT 15\");\r\n\tif ($LOPS->numRows() > 0) {\r\n\t\t// Create the header of the table\r\n\t\t$lops_table = new table(2, true);\r\n\t\t$lops_table->addHeader(\">> Longest Ops for \" . getConfig(\"SITENAME\"));\r\n\r\n\t\t$place = 1;\r\n\t\twhile ($OP = $LOPS->fetchRow()) {\r\n\t\t\t$time = $OP[totaltime];\r\n\r\n\t\t\tif ($time > 0) {\r\n\t\t\t\t$string = numberToString($time);\r\n\r\n\t\t\t\t// Make system clickable.\r\n\t\t\t\t$system = new solarSystem($OP[location]);\r\n\t\t\t\t$loc = $system->makeFancyLink();\r\n\r\n\t\t\t\t$lops_table->addRow();\r\n\t\t\t\t$lops_table->addCol(\"Place #\" . $place . \": Operation <a href=\\\"index.php?action=show&id=\" . $OP[id] . \"\\\">#\" . str_pad($OP[id], 4, \"0\", STR_PAD_LEFT) . \"</a> in \" . $loc . \":\");\r\n\t\t\t\t$lops_table->addCol($string);\r\n\t\t\t\t$place++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$LOPS_r = \"<br>\" . $lops_table->flush();\r\n\t}\r\n\r\n\t/*\r\n\t * Highest TMEC runs\r\n\t */\r\n\r\n\t// Load the top runs out of the database.\r\n\t$TMECDB = $DB->query(\"SELECT * FROM runs WHERE isOfficial = 1 AND endtime > 0 ORDER BY tmec DESC LIMIT 15\");\r\n\r\n\t// Check that we have any!\r\n\tif ($TMECDB->numRows() > 0) {\r\n\r\n\t\t// Create table header for tmec.\r\n\t\t$TMEC = new table(3, true);\r\n\t\t$TMEC->addHeader(\">> Highest rated TMEC Ops\");\r\n\r\n\t\t// Reset first place again.\r\n\t\t$place = 1;\r\n\r\n\t\t// Now loop through the winners.\r\n\t\twhile ($r = $TMECDB->fetchRow()) {\r\n\r\n\t\t\t// Calculate TMEC\r\n\t\t\t$thisTMEC = calcTMEC($r[id]);\r\n\r\n\t\t\t// This this is TMEC is zero or below.\r\n\t\t\tif ($thisTMEC <= 0) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// If TMEC > 0, add it.\r\n\t\t\t$TMEC->addRow();\r\n\r\n\t\t\t// Load the solarsystem its in.\r\n\t\t\t$system = new solarSystem($r[location]);\r\n\t\t\t$location = $system->makeFancyLink();\r\n\r\n\t\t\t// Add tmec stuff.\r\n\t\t\t$TMEC->addCol(\"Place #\" . $place . \":\");\r\n\t\t\t$TMEC->addCol(\"Op #<a href=\\\"index.php?action=show&id=\" . $r[id] . \"\\\">\" . str_pad($r[id], 4, \"0\", STR_PAD_LEFT) . \"</a> in \" . $location);\r\n\t\t\t$TMEC->addCol(\"Scored a TMEC of \" . $thisTMEC . \"!\");\r\n\r\n\t\t\t// Increase place by one.\r\n\t\t\t$place++;\r\n\t\t}\r\n\r\n\t\t// Render the table.\r\n\t\t$TMEC_r = \"<br>\" . $TMEC->flush();\r\n\t}\r\n\r\n\t/* \r\n\t * Total mined ore\r\n\t */\r\n\r\n\t/*\r\n\t * Assemble the heavy-duty SQL query.\r\n\t * It is dynamic because this way we can easily add ores from \r\n\t * config-system.php to the system without code rewrite.\r\n\t */\r\n\tglobal $DBORE;\r\n\tglobal $ORENAMES;\r\n\tforeach ($DBORE as $ORE) {\r\n\t\t$new = $ORE;\r\n\t\tif ($last) {\r\n\t\t\t$SQLADD .= \"SUM(\" . $last . \") AS total\" . $last . \", \";\r\n\t\t}\r\n\t\t$last = $new;\r\n\t}\r\n\t$SQLADD .= \"SUM(\" . $last . \") AS total\" . $last . \" \";\r\n\t$SQL = \"SELECT \" . $SQLADD . \" FROM runs\";\r\n\r\n\t// Now query it.\r\n\t$totalOREDB = $DB->query(\"$SQL\");\r\n\r\n\t// Create table.\r\n\t$totalOre_table = new table(2, true);\r\n\t$totalOre_table->addHeader(\">> Total ore mined for \" . getConfig(\"SITENAME\"));\r\n\r\n\t// Loop through the result (single result!)\r\n\tif ($totalOREDB->numRows() > 0) {\r\n\t\t\r\n\t\twhile ($totalORE = $totalOREDB->fetchRow()) {\r\n\t\t\t// Now check each ore type.\r\n\t\t\tforeach ($ORENAMES as $ORE) {\r\n\t\t\t\t// And ignore never-hauled ore\r\n\t\t\t\tif ($totalORE[total . $DBORE[$ORE]] > 0) {\r\n\t\t\t\t\t// We got some ore!\r\n\t\t\t\t\t$totalOre_table->addRow();\r\n\t\t\t\t\t$totalOre_table->addCol(\"<img width=\\\"20\\\" height=\\\"20\\\" src=\\\"./images/ores/\" . $ORE . \".png\\\">Total \" . $ORE . \" mined:\");\r\n\t\t\t\t\t$totalOre_table->addCol(number_format($totalORE[total . $DBORE[$ORE]]));\r\n\t\t\t\t\t$gotOre = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($gotOre) {\r\n\t\t\t$oretable_r = \"<br>\" . $totalOre_table->flush();\r\n\t\t}\r\n\t}\r\n\t\r\n\t/*\r\n\t * Assemble the heavy-duty SQL query.\r\n\t * It is dynamic because this way we can easily add ships from \r\n\t * config-system.php to the system without code rewrite.\r\n\t */\r\n\tglobal $DBSHIP;\r\n\tglobal $SHIPNAMES;\r\n\tforeach ($DBSHIP as $SHIP) {\r\n\t\t$new = $SHIP;\r\n}\r\n\t/*\r\n\t * Most beloved Systems\r\n\t */\r\n\r\n\t$MBS = $DB->query(\"select SUM(endtime-starttime) as timespent, location FROM runs WHERE endtime > 0 AND isOfficial = 1 GROUP BY location ORDER BY timespent DESC LIMIT 10\");\r\n\tif ($MBS->numRows() > 0) {\r\n\t\t$MBST = new table(2, true);\r\n\t\t$MBST->addHeader(\">> Most loved locations\");\r\n\r\n\t\twhile ($LOC = $MBS->fetchRow()) {\r\n\t\t\tif ($LOC[timespent] > 0) {\r\n\t\t\t\t$MBST->addRow();\r\n\t\t\t\t$system = new solarSystem($LOC[location]);\r\n\t\t\t\t$MBST->addCol($system->makeFancyLink());\r\n\r\n\t\t\t\t$MBST->addCol(numberToString($LOC[timespent]));\r\n\t\t\t}\r\n\t\t}\r\n\t\t$MBST_r = \"<br>\" . $MBST->flush();\r\n\t}\r\n\t\r\n\t/*\r\n\t* Most charitable folks\r\n\t*/\r\n\t$charity = $DB->query(\"SELECT users.username, COUNT(uJoinups.charity) as NOBLE FROM (SELECT * FROM joinups GROUP BY userid,run) as uJoinups, users WHERE users.id = uJoinups.userid AND uJoinups.charity=1 GROUP BY users.username ORDER BY NOBLE DESC, username ASC LIMIT 15\");\r\n\r\n\t if ($charity->numRows() > 0){\r\n\t \t$charity_table = new table(2, true);\r\n\t \t$charity_table->addHeader(\">> Most charitable pilots\");\r\n\t \tunset($j);\r\n\t \twhile ($c = $charity->fetchRow()) {\r\n\t \t\t$j++;\r\n\t \t\t$charity_table->addRow();\r\n\t\t\t$charity_table->addCol(\"Place #\".$j.\":\");\r\n\t\t\t$charity_table->addCol(makeProfileLink(usernameToID($c[username])) . \" with \" . $c[NOBLE] . \" charitable acts!\");\r\n\t\t\t$charityCount = $charityCount + $c[NOBLE];\t \t\t\r\n\t \t}\r\n\t \t$charity_table->addHeader(\"A total of $charityCount charitable actions have been recorded.\");\r\n\t \t$charity_table = \"<br>\" . $charity_table->flush();\r\n\t }\r\n\r\n\t$page = \"<h2>Global statistics</h2>\" . $stat_table->flush() .\r\n\t$trans_r . \"<br>\" .\r\n\t$mining_table->flush() . \"<br>\" .\r\n\t$miningStats_table->flush() .\r\n\t$hauler_stats_table .\r\n\t$MFJ_r .\r\n\t$MO_r .\r\n\t$charity_table.\r\n\t$LOPS_r .\r\n\t$TMEC_r .\r\n\t$oretable_r .\r\n\t$MBST_r;\r\n\treturn ($page);\r\n\r\n}",
"public function getSummary(){\n\t\t\t$bugQuery = \n\t\t\t\t\"SELECT Last_Logon_Time, Rank, COUNT(DISTINCT Bug_ID) as 'Bugs'\n\t\t\t\tFROM users \n\t\t\t\t\tLEFT JOIN bugs ON bugs.Author = users.Username\n\t\t\t\tWHERE users.Username = ?\";\n\n\t\t\t$bugInfo = Connection::query($bugQuery, \"s\", array($this->username))[0];\n\n\t\t\t$developingQuery = \t\n\t\t\t\t\t\"SELECT COUNT(DISTINCT developers.Section_ID) as 'Developing_Sections'\n\t\t\t\t\tFROM developers\n\t\t\t\t\tWHERE developers.Username = ?\";\n\t\t\t$developingInfo = Connection::query($developingQuery, \"s\", array($this->username))[0];\n\n\t\t\t$lastLogon = $bugInfo['Last_Logon_Time'];\n\t\t\t$developingSections = $developingInfo['Developing_Sections'];\n\t\t\t$bugs = $bugInfo['Bugs'];\n\t\t\t$rankInt = $bugInfo['Rank'];\n\n\t\t\t//Find when last notification was generated by user\n\t\t\t$activeQuery = \n\t\t\t\t\t\t\t'SELECT Creation_Date\n\t\t\t\t\t\t\tFROM notifications\n\t\t\t\t\t\t\tWHERE Triggered_By = ?\n\t\t\t\t\t\t\tORDER BY Creation_Date DESC';\n\t\t\t$lastActive = Connection::query($activeQuery, \"s\", array($this->username))[0]['Creation_Date'][0];\n\n\t\t\tif ($lastLogon > $lastActive){\n\t\t\t\t$lastActive = $lastLogon;\n\t\t\t}\n\n\t\t\tif ($developingSections > 0 && $rankInt == 1){\n\t\t\t\t$rank = 2;\n\t\t\t}\n\n\t\t\t//determine name for rank\n\t\t\tif ($rankInt == Users::RANK_ADMIN){\n\t\t\t\t$rank = 'Administrator';\n\t\t\t}else if($rankInt == Users::RANK_MOD){\n\t\t\t\t$rank = 'Moderator';\n\t\t\t}else if ($rankInt == Users::RANK_DEVELOPER){\n\t\t\t\t$rank = 'Developer';\n\t\t\t}else if ($rankInt == Users::RANK_STANDARD){\n\t\t\t\t$rank = 'Lurker';\n\t\t\t}else if ($rankInt == Users::RANK_UNVERIFIED){\n\t\t\t\t$rank = 'Unverified';\n\t\t\t}\n\n\t\t\t$infoHTML = $rank . \"<br>\" . $bugs;\n\n\t\t\tif ($bugs == 1){\n\t\t\t\t$infoHTML .= \" bug\";\n\t\t\t}else{\n\t\t\t\t$infoHTML .= \" bugs\";\n\t\t\t}\n\n\t\t\tif ($rankInt >= 2){\n\t\t\t\t$infoHTML .= \" - developing in \" . $developingSections ;\n\n\t\t\t\tif ($developingSections == 1){\n\t\t\t\t\t$infoHTML .= ' section';\n\t\t\t\t}else {\n\t\t\t\t\t$infoHTML .= ' sections';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$infoHTML .= \"<br>\" . \"Last active \" . strtolower(String::timeago($lastActive));\n\n\t\t\t$infoSummary = array(\n\t\t\t\t'lastActive' => String::timeago($lastActive),\n\t\t\t\t'rank' => $rank,\n\t\t\t\t'developing' => $developingSections,\n\t\t\t\t'bugs' => $bugs\n\t\t\t);\n\n\t\t\treturn $infoHTML;\n\t\t}",
"public function statistics()\n\t{\n\t\t$this->load->library('installer_lib');\n\t\t$this->installer_lib->mysql_acceptable('server');\n\t\t$this->installer_lib->mysql_acceptable('client');\n\t\t$this->installer_lib->gd_acceptable();\n\n\t\t$data = array(\n\t\t\t'version' => CMS_VERSION,\n\t\t\t'php_version' => phpversion(),\n\t\t\t'webserver_hash' => md5($this->session->userdata('http_server').$this->input->server('SERVER_NAME').$this->input->server('SERVER_ADDR').$this->input->server('SERVER_SIGNATURE')),\n\t\t\t'webserver_software' => $this->input->server('SERVER_SOFTWARE'),\n\t\t\t'dbserver' => $this->installer_lib->mysql_server_version,\n\t\t\t'dbclient' => $this->installer_lib->mysql_client_version,\n\t\t\t'gd_version' => $this->installer_lib->gd_version,\n\t\t\t'zlib_version' => $this->installer_lib->zlib_enabled(),\n\t\t\t'curl' => $this->installer_lib->curl_enabled(),\n\t\t);\n\n\t\tinclude '../system/sparks/curl/1.2.1/libraries/Curl.php';\n\t\t$url = 'https://www.pyrocms.com/statistics/add';\n\t\t$curl = new Curl;\n\t\t$curl->simple_post($url, $data);\n\t}",
"function yourls_get_db_stats( $where = [ 'sql' => '', 'binds' => [] ] ) {\n\t$table_url = YOURLS_DB_TABLE_URL;\n\n\t$totals = yourls_get_db()->fetchObject( \"SELECT COUNT(keyword) as count, SUM(clicks) as sum FROM `$table_url` WHERE 1=1 \" . $where['sql'] , $where['binds'] );\n\t$return = [ 'total_links' => $totals->count, 'total_clicks' => $totals->sum ];\n\n\treturn yourls_apply_filter( 'get_db_stats', $return, $where );\n}",
"function retrieve_client_statistics(){\n\t\t\n\t}",
"public function getStatistics()\n {\n if ($this->cmdexists) {\n //Command invokes intel_gpu_top in JSON output mode with an update rate of 5 seconds\n $command = self::STATISTICS_WRAPPER . ES . self::CMD_UTILITY;\n $this->runCommand($command, self::STATISTICS_PARAM, false);\n if (!empty($this->stdout) && strlen($this->stdout) > 0) {\n $this->parseStatistics();\n } else {\n $this->pageData['error'][] = Error::get(Error::VENDOR_DATA_NOT_RETURNED);\n }\n }\n }",
"private function siteStatistics()\n {\n\t\t// ------------------------------------\n\t\t// Fetch stats\n\t\t// ------------------------------------\n\n $stats = DB::table('stats')\n \t->where('site_id', Site::config('site_id'))\n \t->select('total_entries')\n \t->first();\n\n\t\t// ------------------------------------\n\t\t// Table Header\n\t\t// ------------------------------------\n\n $r = Cp::table('tableBorder', '0', '0', '100%').\n '<tr>'.PHP_EOL.\n Cp::tableCell('tableHeading',\n \t\t[\n \t\t\t__('home.site_statistics'),\n \t\t\t__('home.value')\n \t\t]\n\t\t\t\t).\n\t\t\t\t'</tr>'.PHP_EOL;\n\n\n\t\tif (Session::userdata('group_id') == 1) {\n\t\t\t$r .= $this->systemStatusRow();\n\t\t\t$r .= $this->systemVersionRow();\n\t\t}\n\n\t\t$r .= $this->totalEntriesRow($stats);\n\n\t\tif (Session::userdata('group_id') == 1) {\n\t\t\t$r .= $this->totalMembersRow();\n\t\t}\n\n $r .= '</table>'.PHP_EOL;\n\n\t\treturn $r;\n\t}",
"public function statistics()\r\n {\r\n // construct and send the request\r\n $query = self::_URL_API . '/v1/people/~/network/network-stats';\r\n $response = $this->fetch('GET', $query);\r\n \r\n /**\r\n * Check for successful request (a 200 response from LinkedIn server) \r\n * per the documentation linked in method comments above.\r\n */\r\n return $this->setResponse(200, $response);\r\n }",
"private function getStats()\n {\n /** @var EntityManager $em */\n $em = $this->getDoctrine()->getManager();\n $journal = $this->get(\"ojs.journal_service\")->getSelectedJournal();\n $stats['userCount'] = $em->getRepository('OjsUserBundle:User')->getCountBy('journalId', $journal->getId());\n $stats['articleCount'] = $em->getRepository('OjsJournalBundle:Article')->getCountBy('journalId', $journal->getId());\n $stats['issueCount'] = $em->getRepository('OjsJournalBundle:Issue')->getCountBy('journalId', $journal->getId());\n\n /**\n * get most common value from article_event_log\n * for query {@link http://stackoverflow.com/a/7693627/2438520}\n * @todo query result can set session or memcache for more performance.\n * @todo SQL code will be moved\n */\n $now = new \\DateTime('-30 days');\n $last30Day = $now->format(\"Y-m-d H:i:s\");\n $mostViewedArticleLog = $em\n ->createQuery(\n 'SELECT a.articleId,COUNT(a) AS viewCount FROM OjsJournalBundle:ArticleEventLog a WHERE a.eventInfo = :event_info AND a.eventDate > :date GROUP BY a.articleId ORDER BY viewCount DESC'\n )\n ->setParameter('event_info', ArticleEventLogParams::$ARTICLE_VIEW)\n ->setParameter('date', $last30Day)\n ->setMaxResults(1)\n ->getResult();\n if (isset($mostViewedArticleLog[0])) {\n $stats['article']['mostViewedArticle'] = $em\n ->getRepository('OjsJournalBundle:Article')\n ->find($mostViewedArticleLog[0]['articleId']);\n $stats['article']['mostViewedArticleCount'] = $mostViewedArticleLog[0]['viewCount'];\n }\n\n $mostDownloadedArticleLog = $em\n ->createQuery(\n 'SELECT a.articleId,COUNT(a) AS downloadCount FROM OjsJournalBundle:ArticleEventLog a WHERE a.eventInfo = :event_info AND a.eventDate > :date GROUP BY a.articleId ORDER BY downloadCount DESC'\n )\n ->setParameter('event_info', ArticleEventLogParams::$ARTICLE_DOWNLOAD)\n ->setParameter('date', $last30Day)\n ->setMaxResults(1)\n ->getResult();\n if (isset($mostDownloadedArticleLog[0])) {\n $stats['article']['mostDownloadedArticle'] = $em\n ->getRepository('OjsJournalBundle:Article')\n ->find($mostDownloadedArticleLog[0]['articleId']);\n $stats['article']['mostDownloadedArticleCount'] = $mostDownloadedArticleLog[0]['downloadCount'];\n }\n\n return $stats;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set dropdown jenis kasus penyakit | public function actionSetDropdownJeniskasuspenyakit()
{
if(Yii::app()->getRequest()->getIsAjaxRequest()) {
$model = new RJPendaftaranT;
$option = CHtml::tag('option',array('value'=>''),CHtml::encode('-- Pilih --'),true);
if(!empty($_POST['ruangan_id'])){
$data = $model->getJenisKasusPenyakitItems($_POST['ruangan_id']);
$data = CHtml::listData($data,'jeniskasuspenyakit_id', 'jeniskasuspenyakit_nama');
foreach($data as $value=>$name){
$option .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);
}
}
$dataList['listKasuspenyakit'] = $option;
echo json_encode($dataList);
Yii::app()->end();
}
} | [
"public function actionSetDropdownJeniskasuspenyakit()\n {\n if(Yii::app()->getRequest()->getIsAjaxRequest()) {\n $model = new LBPendaftaranT;\n $option = CHtml::tag('option',array('value'=>''),CHtml::encode('-- Pilih --'),true);\n if(!empty($_POST['ruangan_id'])){\n $data = $model->getJenisKasusPenyakitItems($_POST['ruangan_id']);\n $data = CHtml::listData($data,'jeniskasuspenyakit_id', 'jeniskasuspenyakit_nama');\n foreach($data as $value=>$name){\n $option .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n }\n } \n $dataList['listKasuspenyakit'] = $option;\n echo json_encode($dataList);\n Yii::app()->end();\n }\n }",
"public function actionSetDropdownDaerahPasien()\n\t{\n\t\tif(Yii::app()->getRequest()->getIsAjaxRequest()) {\n\t\t\t$modPasien = new PPPasienM;\n\t\t\t$propinsi_id = $_POST['propinsi_id'];\n\t\t\t$kabupaten_id = $_POST['kabupaten_id'];\n\t\t\t$kecamatan_id = $_POST['kecamatan_id'];\n\t\t\t$kelurahan_id = (isset($_POST['kelurahan_id']) ? $_POST['kelurahan_id'] : null);\n\n\t\t\t$propinsis = PropinsiM::model()->findAll('propinsi_aktif = TRUE');\n\t\t\t$propinsis = CHtml::listData($propinsis,'propinsi_id','propinsi_nama');\n\t\t\t$propinsiOption = CHtml::tag('option',array('value'=>''),\"-- Pilih --\",true);\n\t\t\tforeach($propinsis as $value=>$name)\n\t\t\t{\n\t\t\t\tif($value==$propinsi_id)\n\t\t\t\t\t$propinsiOption .= CHtml::tag('option',array('value'=>$value,'selected'=>true),CHtml::encode($name),true);\n\t\t\t\telse\n\t\t\t\t\t$propinsiOption .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n\t\t\t}\n\t\t\t$kabupatens = $modPasien->getKabupatenItems($propinsi_id);\n\t// $kabupatens = KabupatenM::model()->findAllByAttributes(array('propinsi_id'=>$propinsi_id,'kabupaten_aktif'=>true,));\n\t\t\t$kabupatens = CHtml::listData($kabupatens,'kabupaten_id','kabupaten_nama');\n\t\t\t$kabupatenOption = CHtml::tag('option',array('value'=>''),\"-- Pilih --\",true);\n\t\t\tforeach($kabupatens as $value=>$name)\n\t\t\t{\n\t\t\t\tif($value==$kabupaten_id)\n\t\t\t\t\t$kabupatenOption .= CHtml::tag('option',array('value'=>$value,'selected'=>true),CHtml::encode($name),true);\n\t\t\t\telse\n\t\t\t\t\t$kabupatenOption .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n\t\t\t}\n\t\t\t$kecamatans = $modPasien->getKecamatanItems($kabupaten_id);\n\t// $kecamatans = KecamatanM::model()->findAllByAttributes(array('kabupaten_id'=>$kabupaten_id,'kecamatan_aktif'=>true,));\n\t\t\t$kecamatans = CHtml::listData($kecamatans,'kecamatan_id','kecamatan_nama');\n\t\t\t$kecamatanOption = CHtml::tag('option',array('value'=>''),\"-- Pilih --\",true);\n\t\t\tforeach($kecamatans as $value=>$name)\n\t\t\t{\n\t\t\t\tif($value==$kecamatan_id)\n\t\t\t\t\t$kecamatanOption .= CHtml::tag('option',array('value'=>$value,'selected'=>true),CHtml::encode($name),true);\n\t\t\t\telse\n\t\t\t\t\t$kecamatanOption .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n\t\t\t}\n\t\t\t$kelurahans = $modPasien->getKelurahanItems($kecamatan_id);\n\t\t\t$kelurahans = CHtml::listData($kelurahans,'kelurahan_id','kelurahan_nama');\n\t\t\t$kelurahanOption = CHtml::tag('option',array('value'=>''),\"-- Pilih --\",true);\n\t\t\tforeach($kelurahans as $value=>$name)\n\t\t\t{\n\t\t\t\tif($value==$kelurahan_id)\n\t\t\t\t\t$kelurahanOption .= CHtml::tag('option',array('value'=>$value,'selected'=>true),CHtml::encode($name),true);\n\t\t\t\telse\n\t\t\t\t\t$kelurahanOption .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n\t\t\t}\n\n\t\t\t$dataList['listPropinsi'] = $propinsiOption;\n\t\t\t$dataList['listKabupaten'] = $kabupatenOption;\n\t\t\t$dataList['listKecamatan'] = $kecamatanOption;\n\t\t\t$dataList['listKelurahan'] = $kelurahanOption;\n\n\t\t\techo json_encode($dataList);\n\t\t\tYii::app()->end();\n\t\t}\n\t}",
"public function actionSetDropdownDaerahPasien()\n {\n if(Yii::app()->getRequest()->getIsAjaxRequest()) {\n $modPasien = new LBPasienM;\n $propinsi_id = $_POST['propinsi_id'];\n $kabupaten_id = $_POST['kabupaten_id'];\n $kecamatan_id = $_POST['kecamatan_id'];\n $kelurahan_id = $_POST['kelurahan_id'];\n\n $propinsis = PropinsiM::model()->findAll('propinsi_aktif = TRUE');\n $propinsis = CHtml::listData($propinsis,'propinsi_id','propinsi_nama');\n $propinsiOption = CHtml::tag('option',array('value'=>''),\"-- Pilih --\",true);\n foreach($propinsis as $value=>$name)\n {\n if($value==$propinsi_id)\n $propinsiOption .= CHtml::tag('option',array('value'=>$value,'selected'=>true),CHtml::encode($name),true);\n else\n $propinsiOption .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n }\n $kabupatens = $modPasien->getKabupatenItems($propinsi_id);\n// $kabupatens = KabupatenM::model()->findAllByAttributes(array('propinsi_id'=>$propinsi_id,'kabupaten_aktif'=>true,));\n $kabupatens = CHtml::listData($kabupatens,'kabupaten_id','kabupaten_nama');\n $kabupatenOption = CHtml::tag('option',array('value'=>''),\"-- Pilih --\",true);\n foreach($kabupatens as $value=>$name)\n {\n if($value==$kabupaten_id)\n $kabupatenOption .= CHtml::tag('option',array('value'=>$value,'selected'=>true),CHtml::encode($name),true);\n else\n $kabupatenOption .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n }\n $kecamatans = $modPasien->getKecamatanItems($kabupaten_id);\n// $kecamatans = KecamatanM::model()->findAllByAttributes(array('kabupaten_id'=>$kabupaten_id,'kecamatan_aktif'=>true,));\n $kecamatans = CHtml::listData($kecamatans,'kecamatan_id','kecamatan_nama');\n $kecamatanOption = CHtml::tag('option',array('value'=>''),\"-- Pilih --\",true);\n foreach($kecamatans as $value=>$name)\n {\n if($value==$kecamatan_id)\n $kecamatanOption .= CHtml::tag('option',array('value'=>$value,'selected'=>true),CHtml::encode($name),true);\n else\n $kecamatanOption .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n }\n $kelurahans = $modPasien->getKelurahanItems($kecamatan_id);\n $kelurahans = CHtml::listData($kelurahans,'kelurahan_id','kelurahan_nama');\n $kelurahanOption = CHtml::tag('option',array('value'=>''),\"-- Pilih --\",true);\n foreach($kelurahans as $value=>$name)\n {\n if($value==$kelurahan_id)\n $kelurahanOption .= CHtml::tag('option',array('value'=>$value,'selected'=>true),CHtml::encode($name),true);\n else\n $kelurahanOption .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n }\n \n $dataList['listPropinsi'] = $propinsiOption;\n $dataList['listKabupaten'] = $kabupatenOption;\n $dataList['listKecamatan'] = $kecamatanOption;\n $dataList['listKelurahan'] = $kelurahanOption;\n\n echo json_encode($dataList);\n Yii::app()->end();\n }\n }",
"public function actionSetDropdownDaerahPasien()\n {\n if(Yii::app()->getRequest()->getIsAjaxRequest()) {\n $modPasien = new PPPasienM;\n $propinsi_id = $_POST['propinsi_id'];\n $kabupaten_id = $_POST['kabupaten_id'];\n $kecamatan_id = $_POST['kecamatan_id'];\n $kelurahan_id = (isset($_POST['kelurahan_id']) ? $_POST['kelurahan_id'] : null);\n\n $propinsis = PropinsiM::model()->findAll('propinsi_aktif = TRUE');\n $propinsis = CHtml::listData($propinsis,'propinsi_id','propinsi_nama');\n $propinsiOption = CHtml::tag('option',array('value'=>''),\"-- Pilih --\",true);\n foreach($propinsis as $value=>$name)\n {\n if($value==$propinsi_id)\n $propinsiOption .= CHtml::tag('option',array('value'=>$value,'selected'=>true),CHtml::encode($name),true);\n else\n $propinsiOption .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n }\n $kabupatens = $modPasien->getKabupatenItems($propinsi_id);\n// $kabupatens = KabupatenM::model()->findAllByAttributes(array('propinsi_id'=>$propinsi_id,'kabupaten_aktif'=>true,));\n $kabupatens = CHtml::listData($kabupatens,'kabupaten_id','kabupaten_nama');\n $kabupatenOption = CHtml::tag('option',array('value'=>''),\"-- Pilih --\",true);\n foreach($kabupatens as $value=>$name)\n {\n if($value==$kabupaten_id)\n $kabupatenOption .= CHtml::tag('option',array('value'=>$value,'selected'=>true),CHtml::encode($name),true);\n else\n $kabupatenOption .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n }\n $kecamatans = $modPasien->getKecamatanItems($kabupaten_id);\n// $kecamatans = KecamatanM::model()->findAllByAttributes(array('kabupaten_id'=>$kabupaten_id,'kecamatan_aktif'=>true,));\n $kecamatans = CHtml::listData($kecamatans,'kecamatan_id','kecamatan_nama');\n $kecamatanOption = CHtml::tag('option',array('value'=>''),\"-- Pilih --\",true);\n foreach($kecamatans as $value=>$name)\n {\n if($value==$kecamatan_id)\n $kecamatanOption .= CHtml::tag('option',array('value'=>$value,'selected'=>true),CHtml::encode($name),true);\n else\n $kecamatanOption .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n }\n $kelurahans = $modPasien->getKelurahanItems($kecamatan_id);\n $kelurahans = CHtml::listData($kelurahans,'kelurahan_id','kelurahan_nama');\n $kelurahanOption = CHtml::tag('option',array('value'=>''),\"-- Pilih --\",true);\n foreach($kelurahans as $value=>$name)\n {\n if($value==$kelurahan_id)\n $kelurahanOption .= CHtml::tag('option',array('value'=>$value,'selected'=>true),CHtml::encode($name),true);\n else\n $kelurahanOption .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n }\n \n $dataList['listPropinsi'] = $propinsiOption;\n $dataList['listKabupaten'] = $kabupatenOption;\n $dataList['listKecamatan'] = $kecamatanOption;\n $dataList['listKelurahan'] = $kelurahanOption;\n\n echo json_encode($dataList);\n Yii::app()->end();\n }\n }",
"public function actionSetDropdownDokter()\n {\n if(Yii::app()->getRequest()->getIsAjaxRequest()) {\n $model = new BKPendaftaranT;\n $option = CHtml::tag('option',array('value'=>''),CHtml::encode('-- Pilih --'),true);\n if(!empty($_POST['ruangan_id'])){\n $data = $model->getDokterItems($_POST['ruangan_id']);\n $data = CHtml::listData($data,'pegawai_id','NamaLengkap');\n foreach($data as $value=>$name){\n $option .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n }\n } \n $dataList['listDokter'] = $option;\n echo json_encode($dataList);\n Yii::app()->end();\n }\n }",
"public function selectBox_lokasi()\n\t{\n\t\t$id = $this->input->post('id');\n\t\t$this->session->set_userdata('idlok',$id);\n\t\t$option = $this->input->post('op');\n\t\tif ($option==1)\n\t\t\t{ \t$lokasidetail=$this->BarangModel->getlokasidetail($id);\n\t\t\t\t echo \"<option value=''>--------------------------------------------------------------Pilih Detail Ruangan----------------------------------------------------------------------------</option>\";\n\t\t\t\tforeach($lokasidetail as $ld)\n\t\t\t\t{\n\t\t\t\t\t echo \"<option value='\".$ld['id_detail_ruangan'].\"'>\".$ld['detail_nama_ruangan'].\"</option>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t}\n\t}",
"public function getdesa(){\n $id_kec = $this->input->post('nama_kecamatan');\n $dataDesa=$this->PendafAkteM->get_desa($id_kec);\n echo '<select class=\"form-control m-bot15\" name=\"nama_desakelurahan\" id=\"nama_desakelurahan\">';\n echo '<option value=\"\" disabled selected><i>---Pilih Desa/Kelurahan---</i></option>';\n if(! empty($dataDesa)){\n foreach ($dataDesa as $d) {\n echo '<option value=\"'.$d->id_desakelurahan.'\">'.$d->nama_desakelurahan.'</option>';\n }\n }else{\n echo '<option>- Data Belum Tersedia -</option>';\n }\n echo '</select>';\n }",
"function cetak_ruang($ruang){\n\t\t$nm_ruang = 'E.E303';\n\t\t$html='<select id=\"ruang\" name=\"ruang\" class=\"cek-bentrok-1 ruang form-control\" style=\"width: 100px\">';\n\t\t$opt = '';\n\t\tforeach($ruang as $key => $value){\n\t\t\t//$opt .= $v['nm_ruang'];\n\t\t\t//$opt .= $v->nm_ruang;\n\t\t\tif($value->nm_ruang == $nm_ruang){\n $html.= '<option value=\"'.$value->kd_ruang.'\" selected >'.$value->nm_ruang.'</option>'; \n } else {\n $html.= '<option value=\"'.$value->kd_ruang.'\">'.$value->nm_ruang.'</option>';\n } \n\t\t}\n\t\t$html.='</select>';\n\t\treturn $html;\n\t}",
"function dropdown_teknisi()\n { \n //Query untuk mengambil data user yang memiliki level 'Technician'\n $query = $this->db->query(\"SELECT A.username, B.nama FROM user A LEFT JOIN karyawan B ON B.nik = A.username WHERE A.level = 'Technician'\");\n\n //Value default pada dropdown\n $value[''] = '-- CHOOSE --';\n //Menaruh data user teknisi ke dalam dropdown, value yang akan diambil adalah value id_user yang memiliki level 'Technician'\n foreach ($query->result() as $row) {\n $value[$row->username] = $row->nama;\n }\n return $value;\n }",
"public function buildDropdown()\n\t\t{\n\t\t\t$Kartentypen = array('Wetterlage', 'Temperatur', 'Wind', 'Pollenbelastung');\n\t\t\t\n\t\t\techo \"<input type='hidden' name='date' value='\". $this->Filter->getDatum() .\"'>\\n\";\n\t\t\techo \"<select class='form-control' name='Kartentyp'>\\n\";\n\t\t\tfor($i = 0; $i < count($Kartentypen); $i++) \n\t\t\t{\n\t\t\t\techo \"<option value='\". ($i + 1) .\"' \" . (($this->Filter->getType() == ($i + 1)) ? \"selected\" : \"\") . \">\" . $Kartentypen[$i] . \"</option>\\n\";\n\t\t\t}\n\t\t\techo \"</select>\\n\";\n\t\t}",
"protected function get_model_kenaikan_select(){\n $name = $this->get_model_name();\n $default = array( \"class\" => \"selectpicker col-md-12\" , \"name\" => $name , \"id\" => $name , 'selected' => $this->get_value($name) );\n $items = array(\"Persen\" , \"Peringkat\");\n return $this->get_select( $items , $default);\n }",
"public function selipkan()\n\t{\n\t\t$obj = $this->db->query(\"SELECT tb_album.*, tb_lemari.*, tb_rak.* FROM tb_album JOIN tb_lemari ON tb_album.no_lemari = tb_lemari.no_lemari JOIN tb_rak ON tb_album.no_rak = tb_rak.no_rak WHERE tb_album.no_album = '{$this->input->get('no_album')}'\")->row();\n\t\t$data = array(\n\t\t\t'title' => 'Tambah Buku Tanah'.DEFAULT_TITLE,\n\t\t\t'lemari' => $this->m_apps->lemari(),\n\t\t\t'hakmilik' => $this->mbpn->jenis_hak(),\n\t\t\t'data' => $obj\n\t\t);\n\t\t$this->template->view('buku/selipkan_buku', $data);\n\t}",
"function dropdown ($tabel, $value = \"id\", $display , $default = '') {\n\tglobal $conn;\n\n\t// Citim datele din tabelul selectat\n\t$sql = \"SELECT * FROM $tabel\";\n\t$stmt = $conn->prepare($sql);\n\t$stmt->execute();\n\n\t// Citim toate rezultatele sub forma de array in variabila $rows ;\n\t$rows = $stmt->fetchAll();\n\n\t// Parcurgem toaterezultatele \n\t// <option value=\"{valoare}\">{text}</option>\n\n\tforeach ($rows as $row) { ?>\n\t\t\t<?php //$selected = ($default == $row[$value]) ? \"selected\" : \"\"; ?>\n\t\t\t<?php \n\t\t\t\t// Presupunem ca valoarea curent nu este valoare implicita\n\t\t\t\t$selected = \"\";\n\t\t\t\t// Daca valoarea curenta este egala cu valoare implicita sa marcheze dropdonw-ul selectat. \n\t\t\t\tif ($default == $row[$value]) {\n\t\t\t\t\t$selected = \"selected\";\n\t\t\t\t} \n\n\t\t\t?>\n\n\t\t\t<option value=\"<?php echo $row[$value] ?>\" <?php echo $selected ?>>\n\t\t\t\t<?php echo $row[$value] . \"-\" . $row[$display] ?>\n\t\t\t</option>\n\t\t<?php } // sfarsit foreach \n\n}",
"public function actionCariBarang()\n\t{\n\t $namabarang = Yii::app()->request->getParam('namabarang');\n\t\t$dropdownlist = array();\n\t\t//$dropdownlist[-1] = 'Pilih produk...';\n\t\t\n\t\tif( trim($namabarang) != '')\n\t\t{\n\t\t //explode string menjadi 2 array. Array pertama berisi string saja. Array kedua berisi numeric\n\t\t //lakukan loop pencarian berdasarkan array nama.\n\t\t //pada setiap loop nama, lakukan pencarian berdasarkan array ukuran.\n\t\t \n\t\t $array_temp = explode(\" \", trim($namabarang));\n\t\t \n\t\t $array_numeric = array();\n\t\t $array_string = array();\n\t\t foreach($array_temp as $test)\n\t\t {\n\t\t if( is_numeric($test))\n\t\t {\n\t\t $array_numeric[] = $test;\n\t\t }\n\t\t else\n\t\t {\n\t\t $array_string[] = $test;\n\t\t }\n\t\t }\n\t\t \n\t\t foreach($array_string as $test_string)\n\t\t {\n\t\t $command = Yii::app()->db->createCommand()\n ->select('produk.*')\n ->from('inv_inventory produk')\n ->where(\n \"produk.nama like :nama AND\n produk.is_del = 0\", \n array(\n ':nama' => \"%$test_string%\"\n ))\n ->order('produk.nama');\n //->limit('100');\n $daftar_produk = $command->queryAll();\n \n foreach($daftar_produk as $produk)\n {\n $idproduk = $produk['id'];\n \n $real_nama_produk = FHelper::GetProdukName($idproduk);\n $real_brand_produk = FHelper::GetProdukBrand($idproduk);\n $real_ukuran_produk = FHelper::GetProdukUkuran($idproduk);\n $barang = $real_nama_produk . ' | ' .\n $real_brand_produk . ' | ' .\n $real_ukuran_produk;\n \n if( count($array_numeric) > 0 )\n {\n //lakukan pencarian string menggunakan array_numeric\n foreach($array_numeric as $test)\n {\n if(strpos($barang, $test))\n {\n $temp['id'] = $idproduk;\n $temp['value'] = $barang;\n $dropdownlist[] = $temp;\n }\n } //loop array_numeric\n }\n else\n {\n $temp['id'] = $idproduk;\n $temp['value'] = $barang;\n $dropdownlist[] = $temp;\n }\n \n }//loop produk\n\t\t } //loop array_string\n \n if (empty($daftar_produk)) \n {\n $temp['id'] = 0;\n $temp['value'] = 'Barang tidak ditemukan';\n $dropdownlist[] = $temp;\n\t\t }\n\t\t}// if namabarang not empty\n\t\t\n\t\techo CJSON::encode(\n\t\t array(\n\t\t\t'dropdownlist' => $dropdownlist\n\t\t )\n\t\t);\n\t}",
"public function dropdown_kategori()\n {\n //Query untuk mengambil data kategori dan diurutkan berdasarkan nama kategori\n $sql = \"SELECT * FROM kategori ORDER BY nama_kategori\";\n $query = $this->db->query($sql);\n\n //Value default pada dropdown\n $value[''] = '-- CHOOSE --';\n //Menaruh data kategori ke dalam dropdown, value yang akan diambil adalah value id_kategori\n foreach ($query->result() as $row) {\n $value[$row->id_kategori] = $row->nama_kategori;\n }\n return $value;\n }",
"public function ComboCiudades(){\n $conect = new conexion(\"localhost\",\"root\",\"\",\"agendatelefonica\");\n $SqlCiudades = \"Select * From ciudades\";\n $DatosCiudades = $conect->consultar($SqlCiudades);\n if($DatosCiudades->num_rows>0){\n while($fila=$DatosCiudades->fetch_assoc()){\n echo'<option value = \"'.$fila['idciudades'].'\">'.$fila['nomciudad'].'</option>';\n }\n }\n }",
"public function vistaBicicletaSelectController(){\n\t\t\t$respuesta = Datos::vistaBicicletaModel(\"bicicleta\");\n\t\t\t$a=\"\";\n\n\t\t\n\t\t\tforeach($respuesta as $row => $item){\n\t\t\t\t$id=$item[\"id_bicicleta\"];\n\t\t\t\t$e=$item[\"marca\"];\n\n\t\t\t\n\t\t\techo'<option value='.$id.'>'.$e.'</option>';\n\t\t\n\n\t\t\t}\n\t\t}",
"public function get_jur_by_univ() {\r\n if (isset($_POST['univ']) && $_POST['univ'] != \"\") {\r\n $univ = $_POST['univ'];\r\n $jurusan = new Jurusan($this->registry);\r\n $data = $jurusan->get_jur_by_univ($univ);\r\n echo \"<option value=''>Pilih Jurusan</option>\";\r\n foreach ($data as $jur) {\r\n if (isset($_POST['jur_def'])) {\r\n if ($jur->get_kode_jur() == $_POST['jur_def']) {\r\n $select = \" selected\";\r\n } else {\r\n $select = \"\";\r\n }\r\n echo \"<option value=\" . $jur->get_kode_jur() . \"\" . $select . \">\" . $jur->get_nama() . \"</option>\\n\";\r\n } else {\r\n echo \"<option value=\" . $jur->get_kode_jur() . \">\" . $jur->get_nama() . \"</option>\\n\";\r\n }\r\n }\r\n } else {\r\n echo \"<option value=''>Pilih Jurusan</option>\";\r\n }\r\n }",
"function dropdown_item_clase($campo, $categoria_id, $valor, $att_select)\n {\n\n //\n if ($this->session->userdata('area_id') > 0) {\n $this->db->where('item_grupo', $this->session->userdata('area_id'));\n }\n\n $this->db->where('categoria_id', $categoria_id);\n $opciones = $this->db->get('item');\n\n $html_select = '<select id=\"field-' . $campo . '\" name=\"' . $campo . '\"' . $att_select . '>';\n $html_select .= '<option value=\"\">(Vacío)</option>'; //Vacío\n\n foreach ($opciones->result() as $row_item) {\n\n\n $item_grupo_id = $this->Pcrn->si_nulo($row_item->item_grupo, 0);\n\n $clase_option = $this->nombre_item($item_grupo_id, 2);\n if ($clase_option == '') { $clase_option = 'general'; } //Evitar que quede una clase vacía\n $nombre_item_grupo = $this->nombre_item($item_grupo_id, 1);\n\n $select_add = \"\";\n if ($row_item->id == $valor) {\n $select_add = \" selected='selected'\";\n }\n\n $html_select .= \"<option class='{$clase_option}' value='{$row_item->id}' {$select_add}>{$nombre_item_grupo} - {$row_item->item}</option>\";\n }\n\n $html_select .= '</select>';\n\n return $html_select;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test for the hideLocation() method without children in location. | public function testHideLocationWithChildren()
{
$this->setGuzzleExpectationsFor('DELETE', self::CONTENT_ID + 1, 0 * 3);
$this->setGuzzleExpectationsFor('DELETE', self::CONTENT_ID + 2, 1 * 3);
$this->setGuzzleExpectationsFor('DELETE', self::CONTENT_ID, 2 * 3);
$locationServiceMock = $this->getLocationServiceMock();
$locationServiceMock
->expects($this->at(0))
->method('loadLocation')
->with($this->equalTo(self::LOCATION_ID))
->willReturn(new Location([
'id' => 5,
'path' => ['1', '5'],
'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID]),
]));
$locationServiceMock
->expects($this->at(1))
->method('loadLocationChildren')
->with($this->equalTo(new Location([
'id' => 5,
'path' => ['1', '5'],
'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID]),
])))
->willReturn(new LocationList([
'totalCount' => 2,
'locations' => [
new Location([
'id' => 20,
'path' => ['1', '5', '20'],
'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID + 1]),
]),
new Location([
'id' => 30,
'path' => ['1', '5', '30'],
'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID + 2]),
]),
],
]));
$locationServiceMock
->expects($this->at(2))
->method('loadLocation')
->with($this->equalTo(20))
->willReturn(new Location([
'id' => 20,
'path' => ['1', '5', '20'],
'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID + 1]),
]));
$locationServiceMock
->expects($this->at(3))
->method('loadLocationChildren')
->with($this->equalTo(new Location([
'id' => 20,
'path' => ['1', '5', '20'],
'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID + 1]),
])))
->willReturn(new LocationList(['totalCount' => 0, 'locations' => []]));
$locationServiceMock
->expects($this->at(4))
->method('loadLocation')
->with($this->equalTo(30))
->willReturn(new Location([
'id' => 30,
'path' => ['1', '5', '30'],
'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID + 2]),
]));
$locationServiceMock
->expects($this->at(5))
->method('loadLocationChildren')
->with($this->equalTo(new Location([
'id' => 30,
'path' => ['1', '5', '30'],
'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID + 2]),
])))
->willReturn(new LocationList(['totalCount' => 0, 'locations' => []]));
$locationServiceMock
->expects($this->at(6))
->method('loadLocations')
->with($this->equalTo(new ContentInfo([
'id' => self::CONTENT_ID,
'contentTypeId' => self::CONTENT_TYPE_ID,
])))
->willReturn([
new Location(['path' => ['1', '5'], 'hidden' => true]),
new Location(['path' => ['1', '5', '8'], 'hidden' => true]),
new Location(['path' => ['1', '5', '9'], 'hidden' => true]),
]);
$contentServiceMock = $this->getContentServiceMock();
$contentServiceMock
->expects($this->at(0))
->method('loadContent')
->with($this->equalTo(self::CONTENT_ID + 1))
->willReturn(new Content([
'versionInfo' => new VersionInfo([
'contentInfo' => new ContentInfo([
'id' => self::CONTENT_ID + 1,
'contentTypeId' => self::CONTENT_TYPE_ID,
]),
]),
'internalFields' => [],
]));
$contentServiceMock
->expects($this->at(1))
->method('loadVersionInfo')
->with(new ContentInfo(['id' => self::CONTENT_ID + 1, 'contentTypeId' => self::CONTENT_TYPE_ID]))
->willReturn(new VersionInfo(['languageCodes' => ['eng-GB']]));
$contentServiceMock
->expects($this->at(2))
->method('loadContent')
->with($this->equalTo(self::CONTENT_ID + 2))
->willReturn(new Content([
'versionInfo' => new VersionInfo([
'contentInfo' => new ContentInfo([
'id' => self::CONTENT_ID + 2,
'contentTypeId' => self::CONTENT_TYPE_ID,
]),
]),
'internalFields' => [],
]));
$contentServiceMock
->expects($this->at(3))
->method('loadVersionInfo')
->with(new ContentInfo(['id' => self::CONTENT_ID + 2, 'contentTypeId' => self::CONTENT_TYPE_ID]))
->willReturn(new VersionInfo(['languageCodes' => ['eng-GB']]));
$contentServiceMock
->expects($this->at(4))
->method('loadContent')
->with($this->equalTo(self::CONTENT_ID))
->willReturn(new Content([
'versionInfo' => new VersionInfo([
'contentInfo' => new ContentInfo([
'id' => self::CONTENT_ID,
'contentTypeId' => self::CONTENT_TYPE_ID,
]),
]),
'internalFields' => [],
]));
$contentServiceMock
->expects($this->at(5))
->method('loadVersionInfo')
->with(new ContentInfo(['id' => self::CONTENT_ID, 'contentTypeId' => self::CONTENT_TYPE_ID]))
->willReturn(new VersionInfo(['languageCodes' => ['eng-GB']]));
$repositoryServiceMock = $this->getRepositoryServiceMock();
$repositoryServiceMock
->expects($this->any())
->method('sudo')
->willReturn(new ContentType(['fieldDefinitions' => [], 'identifier' => self::CONTENT_TYPE_ID]));
/* Use Case */
$notifier = new SignalSlotService(
$this->clientMock,
$repositoryServiceMock,
$contentServiceMock,
$locationServiceMock,
$this->getContentTypeServiceMock(),
$this->credentialsCheckerMock,
new NullLogger()
);
$notifier->setIncludedContentTypes([self::CONTENT_TYPE_ID]);
$notifier->hideLocation(self::LOCATION_ID);
} | [
"public function isHidden(): bool\n {\n $location = $this->getLocation();\n if ($location === null) {\n return false;\n }\n\n return $location->getHideFromSearch();\n }",
"public function testUnhideLocationWithChildren()\n {\n $this->setGuzzleExpectationsFor('UPDATE', self::CONTENT_ID + 1, 0 * 3);\n $this->setGuzzleExpectationsFor('UPDATE', self::CONTENT_ID + 2, 1 * 3);\n $this->setGuzzleExpectationsFor('UPDATE', self::CONTENT_ID, 2 * 3);\n\n $locationServiceMock = $this->getLocationServiceMock();\n $locationServiceMock\n ->expects($this->at(0))\n ->method('loadLocation')\n ->with($this->equalTo(self::LOCATION_ID))\n ->willReturn(new Location([\n 'id' => 5,\n 'path' => ['1', '5'],\n 'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID]),\n ]));\n\n $locationServiceMock\n ->expects($this->at(1))\n ->method('loadLocationChildren')\n ->with($this->equalTo(new Location([\n 'id' => 5,\n 'path' => ['1', '5'],\n 'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID]),\n ])))\n ->willReturn(new LocationList([\n 'totalCount' => 2,\n 'locations' => [\n new Location([\n 'id' => 20,\n 'path' => ['1', '5', '20'],\n 'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID + 1]),\n ]),\n new Location([\n 'id' => 30,\n 'path' => ['1', '5', '30'],\n 'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID + 2]),\n ]),\n ],\n ]));\n\n $locationServiceMock\n ->expects($this->at(2))\n ->method('loadLocation')\n ->with($this->equalTo(20))\n ->willReturn(new Location([\n 'id' => 20,\n 'path' => ['1', '5', '20'],\n 'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID + 1]),\n ]));\n $locationServiceMock\n ->expects($this->at(3))\n ->method('loadLocationChildren')\n ->with($this->equalTo(new Location([\n 'id' => 20,\n 'path' => ['1', '5', '20'],\n 'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID + 1]),\n ])))\n ->willReturn(new LocationList(['totalCount' => 0, 'locations' => []]));\n\n $locationServiceMock\n ->expects($this->at(4))\n ->method('loadLocation')\n ->with($this->equalTo(30))\n ->willReturn(new Location([\n 'id' => 30,\n 'path' => ['1', '5', '30'],\n 'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID + 2]),\n ]));\n $locationServiceMock\n ->expects($this->at(5))\n ->method('loadLocationChildren')\n ->with($this->equalTo(new Location([\n 'id' => 30,\n 'path' => ['1', '5', '30'],\n 'contentInfo' => new ContentInfo(['id' => self::CONTENT_ID + 2]),\n ])))\n ->willReturn(new LocationList(['totalCount' => 0, 'locations' => []]));\n\n $contentServiceMock = $this->getContentServiceMock();\n\n $contentServiceMock\n ->expects($this->at(0))\n ->method('loadContent')\n ->with($this->equalTo(self::CONTENT_ID + 1))\n ->willReturn(new Content([\n 'versionInfo' => new VersionInfo([\n 'contentInfo' => new ContentInfo([\n 'id' => self::CONTENT_ID + 1,\n 'contentTypeId' => self::CONTENT_TYPE_ID,\n ]),\n ]),\n 'internalFields' => [],\n ]));\n $contentServiceMock\n ->expects($this->at(1))\n ->method('loadVersionInfo')\n ->with(new ContentInfo(['id' => self::CONTENT_ID + 1, 'contentTypeId' => self::CONTENT_TYPE_ID]))\n ->willReturn(new VersionInfo(['languageCodes' => ['eng-GB']]));\n\n $contentServiceMock\n ->expects($this->at(2))\n ->method('loadContent')\n ->with($this->equalTo(self::CONTENT_ID + 2))\n ->willReturn(new Content([\n 'versionInfo' => new VersionInfo([\n 'contentInfo' => new ContentInfo([\n 'id' => self::CONTENT_ID + 2,\n 'contentTypeId' => self::CONTENT_TYPE_ID,\n ]),\n ]),\n 'internalFields' => [],\n ]));\n $contentServiceMock\n ->expects($this->at(3))\n ->method('loadVersionInfo')\n ->with(new ContentInfo(['id' => self::CONTENT_ID + 2, 'contentTypeId' => self::CONTENT_TYPE_ID]))\n ->willReturn(new VersionInfo(['languageCodes' => ['eng-GB']]));\n\n $contentServiceMock\n ->expects($this->at(4))\n ->method('loadContent')\n ->with($this->equalTo(self::CONTENT_ID))\n ->willReturn(new Content([\n 'versionInfo' => new VersionInfo([\n 'contentInfo' => new ContentInfo([\n 'id' => self::CONTENT_ID,\n 'contentTypeId' => self::CONTENT_TYPE_ID,\n ]),\n ]),\n 'internalFields' => [],\n ]));\n $contentServiceMock\n ->expects($this->at(5))\n ->method('loadVersionInfo')\n ->with(new ContentInfo(['id' => self::CONTENT_ID, 'contentTypeId' => self::CONTENT_TYPE_ID]))\n ->willReturn(new VersionInfo(['languageCodes' => ['eng-GB']]));\n\n $repositoryServiceMock = $this->getRepositoryServiceMock();\n $repositoryServiceMock\n ->expects($this->any())\n ->method('sudo')\n ->willReturn(new ContentType(['fieldDefinitions' => [], 'identifier' => self::CONTENT_TYPE_ID]));\n\n /* Use Case */\n $notifier = new SignalSlotService(\n $this->clientMock,\n $repositoryServiceMock,\n $contentServiceMock,\n $locationServiceMock,\n $this->getContentTypeServiceMock(),\n $this->credentialsCheckerMock,\n new NullLogger()\n );\n $notifier->setIncludedContentTypes([self::CONTENT_TYPE_ID]);\n $notifier->unhideLocation(self::LOCATION_ID);\n }",
"function ul_is_location_child_page() {\n\tif ( ! is_singular( 'location_page' ) ) {\n\t\treturn false;\n\t}\n\t// If viewing a top level location page\n\tglobal $post;\n\tif ( $post->post_parent > 0 ) {\n\t\treturn true;\n\t}\n\treturn false;\n}",
"public function getHideLoc()\n\t{\n\t\treturn $this->hide_loc;\n\t}",
"public function testLocationShowNotExistent()\n {\n $user = User::all()->random();\n\n $this->actingAs($user, 'api')\n ->get(\"api/location/999999\");\n $this->seeStatusCode(404);\n }",
"public function shouldHideRealCoordinates()\n {\n return $this->license()->shouldHideRealCoordinates() ||\n optional($this->observation->taxon)->restricted;\n }",
"function FilterLocations( &$locations )\r\n{\r\n BuildLocations( $locations );\r\n \r\n // drop the main index of any hidden locations so they don't show up in the map view\r\n foreach( $locations as $name => $loc )\r\n {\r\n if( $loc['hidden'] && !$_REQUEST['hidden'] )\r\n unset( $locations[$name] );\r\n }\r\n \r\n // only do it if we aren't displaying hidden locations and we're not running on Windows (busted filetime())\r\n if( !$_REQUEST['hidden'] && (PHP_OS!='WINNT' && PHP_OS!='WIN32' && PHP_OS!='Windows'))\r\n {\r\n // first remove any locations that haven't checked in for 30 minutes (could tighten this up in the future)\r\n foreach( $locations as $name => $loc )\r\n {\r\n if( isset($loc['browser']) )\r\n {\r\n // now check the times\r\n $file = \"./tmp/$name.tm\";\r\n if( is_file($file) )\r\n {\r\n $updated = filemtime($file);\r\n $now = time();\r\n $elapsed = 0;\r\n if( $now > $updated )\r\n $elapsed = $now - $updated;\r\n $minutes = (int)($elapsed / 60);\r\n if( $minutes > 30 )\r\n unset($locations[$name]);\r\n }\r\n }\r\n }\r\n }\r\n \r\n // second pass, remove any top-level locations whose sub-locations have all been removed\r\n foreach( $locations as $name => $loc )\r\n {\r\n // top-level locations do not have the browser specified\r\n // and \"locations\" is the uber-top-level grouping\r\n if( $name != 'locations' && !isset($loc['browser']) )\r\n {\r\n $ok = false; // default to deleting the location\r\n $newLoc = array(); // new, filtered copy of the location\r\n $default = null; // the default location for the group\r\n \r\n // remove any of the child locations that don't exist\r\n $index = 0;\r\n foreach( $loc as $key => $val )\r\n {\r\n // the sub-locations are identified with numeric keys (1, 2, 3)\r\n if( is_numeric($key) )\r\n {\r\n // check the location that is being referenced to see if it exists\r\n if( isset($locations[$val]) )\r\n {\r\n $ok = true;\r\n $index++;\r\n $newLoc[$index] = $val;\r\n if( isset($loc['default']) && $loc['default'] == $val )\r\n $default = $val;\r\n }\r\n else\r\n {\r\n if( isset($loc['default']) && $loc['default'] == $val )\r\n unset($loc['default']);\r\n }\r\n }\r\n elseif( $key != 'default' )\r\n $newLoc[$key] = $val;\r\n }\r\n \r\n if( $ok )\r\n {\r\n if( isset($default) )\r\n $newLoc['default'] = $default;\r\n $locations[$name] = $newLoc;\r\n }\r\n else\r\n unset($locations[$name]);\r\n unset($newLoc);\r\n }\r\n }\r\n \r\n // final pass, remove the empty top-level locations from the locations list\r\n $newList = array();\r\n $default = null;\r\n $index = 0;\r\n foreach( $locations['locations'] as $key => $name )\r\n {\r\n if( is_numeric($key) )\r\n {\r\n if( isset( $locations[$name] ) )\r\n {\r\n $index++;\r\n $newList[$index] = $name;\r\n if( isset($locations['locations']['default']) && $locations['locations']['default'] == $name )\r\n $default = $name;\r\n }\r\n }\r\n elseif( $key != 'default' )\r\n $newList[$key] = $name;\r\n }\r\n if( isset($default) )\r\n $newList['default'] = $default;\r\n $locations['locations'] = $newList;\r\n}",
"public function hasLocations(): bool;",
"public function isHidden();",
"abstract public function assertVisibleOption($locator);",
"function hide_mount($mount) {\n\tglobal $hide_mounts;\n\tif (isset($hide_mounts) && is_array($hide_mounts) && in_array($mount, $hide_mounts)) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}",
"public function testDettachLocation()\n {\n\n }",
"public function testOffersUnhide()\n {\n }",
"public function isLocationProvided(): bool;",
"public function isChildOnly();",
"public function isVisible()\n {\n return $this->getLocationAllow() != 0 ? true : false;\n }",
"static function removeISymphonyLocation($location) {\n\t\n\t\t//Move to server mode\n\t\tif(!self::moveToServer()) {\n\t\t\treturn false;\n\t\t}\n\t\n\t\t//Remove element\n\t\treturn self::checkAndSetErrorNone(\"remove location $location\");\n\t}",
"public function is_hidden()\n\t{\n\t\tif ($this->hidden == TRUE OR in_array($this->name, $this->fuel->layouts->hidden))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}",
"function ai_has_sidebar($location)\n{\n global $post;\n \n $location = strtolower($location);\n $sidebar_ids = get_post_meta($post->ID, 'ai_post_sidebars', true);\n \n if (isset($sidebar_ids[$location]) && ! empty($sidebar_ids[$location])) {\n return true;\n }\n return false;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds as airportOriginPref Identifies the preferred origination airport for travel (using IATA airport codes). | public function addToAirportOriginPref(\Devlabs91\TravelgateNotify\Models\Ota\AirportPrefType $airportOriginPref)
{
$this->airportOriginPref[] = $airportOriginPref;
return $this;
} | [
"public function getAirportOriginPref()\n {\n return $this->airportOriginPref;\n }",
"public function issetAirportOriginPref($index)\n {\n return isset($this->airportOriginPref[$index]);\n }",
"public function addToAirlinePref(\\Devlabs91\\TravelgateNotify\\Models\\Ota\\AirlinePrefType $airlinePref)\n {\n $this->airlinePref[] = $airlinePref;\n return $this;\n }",
"private function createAirportObject()\n {\n if($this->altn){\n $this->altnAirport = Airports::icao($this->altn);\n }\n }",
"public function addToAirlinePref($item)\n {\n // validation for constraint: itemType\n if (!false) {\n throw new \\InvalidArgumentException(sprintf('The AirlinePref property can only contain items of anyType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->AirlinePref[] = $item;\n return $this;\n }",
"public function issetAirportRoutePref($index)\n {\n return isset($this->airportRoutePref[$index]);\n }",
"public function buildOrigin()\n\t{\n\t\t$this->apple->setOrigin(\"Italy\");\n\t}",
"public function add_airport(Request $request)\n {\n $this->abort_if_no_admin();\n if(!$request->input('airport_code') ||\n !$request->input('city') ||\n !$request->input('country') ) {\n abort(400, \"Missing argument. Can not add this airline.\");\n }\n try {\n DB::table('airports')->insert(\n [\"airport_code\" => $request->input('airport_code'),\n \"city\" => $request->input('city'),\n \"country\" => $request->input('country')]\n );\n } catch (Exception $e) {\n abort(500, \"Error in inserting airport into database.\");\n }\n }",
"public function getAirportId()\n {\n return $this->airportId;\n }",
"public function getArrivalAirport()\n {\n return $this->arrivalAirport;\n }",
"public function setFromairportident($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->fromairportident !== $v) {\n\t\t\t$this->fromairportident = $v;\n\t\t\t$this->modifiedColumns[] = RpMissionItineraryPeer::FROMAIRPORTIDENT;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function getToAirportId()\n\t{\n\t\treturn $this->to_airport_id;\n\t}",
"public function setSegmentArrivalAirportCode(string $value): self\n {\n $this->SegmentArrivalAirportCode = $value;\n\n return $this;\n }",
"public function setArrivalAirport(string $arrivalAirport): Flight\n {\n $this->arrivalAirport = $arrivalAirport;\n\n return $this;\n }",
"public function getArrivalAirportLocationCode() {\n return $this->arrivalAirportLocationCode;\n }",
"public function getToairportident()\n\t{\n\t\treturn $this->toairportident;\n\t}",
"protected function setDestinyAirport()\n {\n $destinyAirport = new TamCargoDestinyAirport($this->shippingInfo->getReceiverZipCode());\n\n if ($destinyAirport->getStatus() === 'ERROR') {\n $this->result->status = 'ERROR';\n $this->result->errors[] = array_merge($this->result->errors, $destinyAirport->getErrors());\n return;\n }\n\n $destinyAirportCode = $destinyAirport->getAirportCode();\n if ($destinyAirportCode) {\n try {\n $parameters = [\n 'javax.faces.partial.ajax' => 'true',\n 'javax.faces.source' => 'form:destinationId',\n 'javax.faces.partial.execute' => 'form:destinationId',\n 'javax.faces.partial.render' => 'form:destinationId',\n 'form:destinationId' => 'form:destinationId',\n 'form:destinationId_query' => $destinyAirportCode,\n 'form' => 'form',\n 'form:originId_input' => $this->originAirport,\n 'form:j_idt30' => $this->collect,\n 'form:collectCepId' => $this->senderZipCode,\n 'form:destinationId_input' => $destinyAirportCode,\n 'form:j_idt84_input' => 'ALL',\n 'form:j_idt98_input' => 'TAM',\n 'form:j_idt110' => 'P',\n 'form:accordionDC_active' => '0',\n 'form:table_dim_scrollState' => '0,0',\n 'javax.faces.ViewState' => $this->viewStateLogin,\n ];\n\n $promise = $this->client->requestAsync(\n 'POST',\n 'https://mycargomanager.appslatam.com/eBusiness-web-1.0-view/private/CreateQuotation.jsf',\n [\n 'form_params' => $parameters,\n 'headers' => $this->mainHeader\n ])->then(function ($response) {\n $this->destinyAirport = $this->stringBetween($response->getBody(), 'data-item-value=\"', '\"');\n });\n $promise->wait();\n } catch (RequestException $e) {\n $this->result->status = 'ERROR';\n $this->result->errors[] = 'Curl Error: ' . $e->getMessage();\n }\n }\n\n }",
"public function getFromairportname()\n\t{\n\t\treturn $this->fromairportname;\n\t}",
"public function setFromairportcity($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->fromairportcity !== $v) {\n\t\t\t$this->fromairportcity = $v;\n\t\t\t$this->modifiedColumns[] = RpMissionItineraryPeer::FROMAIRPORTCITY;\n\t\t}\n\n\t\treturn $this;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve and add all of the LinEpig records for the search database. We can't use the main Multimedia function because it only includes the primary records. | public function addRecords()
{
$mongo = new Client(env('MONGO_EMU_CONN'), [], config('emuconfig.mongodb_conn_options'));
$emultimedia = $mongo->emu->emultimedia;
$cursor = $emultimedia->find(['MulMultimediaCreatorRef' => '177281']);
$searchCollectionName = $this->searchCollection->getCollectionName();
$i = 0;
foreach ($cursor as $record) {
if (!isset($record['AudAccessURI'])) {
continue;
}
if ($i % 100 === 0) {
Log::info("Added $i doc(s) to the $searchCollectionName collection.");
print("Added $i doc(s) to the $searchCollectionName collection." . PHP_EOL);
}
$taxonomy = new Taxonomy();
$taxonomyIRN = $taxonomy->getTaxonomyIRN($record);
$taxon = $taxonomy->getRecord($taxonomyIRN);
$searchDoc = [];
$searchDoc['irn'] = $record['irn'];
$searchDoc['module'] = "emultimedia";
$searchDoc['genus'] = $taxon['ClaGenus'];
$searchDoc['species'] = $taxon['ClaSpecies'] ?? ""; // IRN 616726 is an example taxon record with no species
$searchDoc['keywords'] = $record['DetSubject'];
$searchDoc['title'] = $record['MulTitle'];
$searchDoc['description'] = $record['MulDescription'];
$searchDoc['thumbnailURL'] = Multimedia::fixThumbnailURL($record['AudAccessURI']);
// Set up created and modified dates
$searchDoc['date_created'] = $this->getMongoDate($record['AdmDateInserted']);
$searchDoc['date_modified'] = $this->getMongoDate($record['AdmDateModified']);
// Remove unnecessary data before combining for search
foreach (config('emuconfig.mongodb_search_docs_fields_to_exclude') as $field) {
unset($record[$field]);
}
$searchDoc['search'] = $record;
$this->searchCollection->insertOne($searchDoc);
$i++;
}
Log::info("Done adding docs to the search collection.");
print("Done adding docs to the search collection." . PHP_EOL);
} | [
"function searchRecords() {\r\n\t\t$searchQuery = $this->parameters ['query'];\r\n\t\t\r\n\t\tif ($this->recordModel->validationFactory->isQueryValid ( $searchQuery )) {\r\n\t\t\t$this->recordModel->setRecordListWithSearchQuery ( $this->userId, $searchQuery );\r\n\t\t\t$this->coreModel->setPageAlert ( \"success\", RECORD_SEARCH_SUCCESS );\r\n\t\t} else {\r\n\t\t\t$this->coreModel->setPageAlert ( \"danger\", RECORD_SEARCH_INVALID );\r\n\t\t\t$this->recordModel->setRecordListWithAll ( $this->userId );\r\n\t\t}\r\n\t}",
"public static function all()\n {\n self::dbConnect();\n\n // @TODO: Learning from the previous method, return all the matching records\n }",
"public function getRecords();",
"public function getAllRecords();",
"public function getAllRecords() {\n\t}",
"function recordsQuery($queryArray, $addWhere, $directory, $uidList, $piObj) {\n\t\t$addWhere = array();\n\t\t// $addWhere[] = '`tx_dam`.`file_mime_type` = \\'image\\'';\n\t\t$addWhere[] = '`tx_dam`.`media_type` IN (2, 4)'; // => image ou video\n\t\tif ($directory) {\n\t\t\t$lastChar = substr($directory, -1);\n\t\t\tif ($lastChar != '/')\n\t\t\t\t$directory .= '/';\n\t\t\t$addWhere[] = '`tx_dam`.`file_path` like \\'' . $directory . '\\'';\n\t\t}\n\t\tif ($uidList)\n\t\t\t$addWhere[] = '`tx_dam`.`uid` in (' . $uidList . ')';\n\t\t$queryArray['WHERE'] = implode(' AND ', $addWhere) . ' ' . $piObj->cObj->enableFields('tx_dam');\t\n\t\t\n\t\t$queryArray['SELECT'] .= ',\n\t\t\t`tx_dam`.`tx_pnfgalleryvideo_time`,\n\t\t\t`tx_dam`.`tx_pnfgalleryvideo_thumbnail`,\n\t\t\t`tx_dam`.`tx_pnfgalleryvideo_accessibility_link`\n\t\t\t';\n\t\t\t\n\t\treturn $queryArray;\n\t}",
"public function LoadRecords()\n {\n \t$this->SetCulture();\n \t$this->retailers_records = $this->GetRetailersRecords();\n }",
"public function records() {\n\n if (!$this->Access->check('QuickAuth', 'read')) {\n if ($this->request->is('ajax')) {\n $this->autoRender = false;\n } else {\n $this->redirect($this->referer());\n }\n return;\n }\n\n $this->Paginator->settings = array(\n 'QuickAuth' => array(\n 'limit' => 25,\n )\n );\n\n $quickauth = Hash::extract($this->Paginator->paginate('QuickAuth'), '{n}.QuickAuth');\n $this->addPlayers($quickauth, '{n}.user_id');\n\n $this->loadModel('Server');\n $servers = Hash::combine($this->Server->find('all', array(\n 'fields' => array(\n 'server_ip', 'name', 'short_name'\n ),\n 'conditions' => array(\n 'server_ip is not null'\n )\n )), '{n}.Server.server_ip', '{n}.Server');\n\n $this->set(array(\n 'servers' => $servers,\n 'quickauth' => $quickauth,\n 'pageModel' => $this->QuickAuth->name,\n 'pageLocation' => array('controller' => 'QuickAuth', 'action' => 'records')\n ));\n }",
"protected function fetchStorageRecords() {}",
"private function getSearchArtistList($searchText, $startFrom, $recordCount, $searchType, $libraryId, $library_terriotry) {\n\n $matchType = 'All';\n $artist = $searchText;\n $composer = '';\n $song = '';\n $album = '';\n $genre = '';\n $sphinxFinalCondition = '@ArtistText \"'.$searchText.'\" & @Territory \"'.$library_terriotry.'\" & @DownloadStatus 1';\n $sphinxSort = '';\n $sphinxDirection = '';\n $country = $library_terriotry;\n\n $_SESSION['webservice_startFrom'] = $startFrom;\n $_SESSION['webservice_recordCount'] = $recordCount;\n $_SESSION['webservice_master'] = 1;\n $_SESSION['webservice_slave'] = 0;\n\n\n\n\t\t\t\t$this->paginate = array('Song' => array(\n 'sphinx' => 'yes', 'sphinxcheck' => $sphinxFinalCondition, 'sphinxsort' => $sphinxSort, 'sphinxdirection' => $sphinxDirection,\n 'cont' => $country));\n\n\t\t\t\t$ArtistData = $this->paginate('Song');\n\n\n\n foreach($ArtistData AS $key => $val){\n\n $sobj = new SearchDataType;\n $sobj->SongProdID = $this->getProductAutoID($val['Song']['ProdID'], $val['Song']['provider_type']);\n $sobj->SongTitle = $this->getTextUTF($val['Song']['SongTitle']);\n $sobj->SongArtist = $this->getTextUTF($val['Song']['Artist']);\n $sobj->Sample_Duration = $val['Song']['Sample_Duration'];\n $sobj->FullLength_Duration = $val['Song']['FullLength_Duration'];\n $sobj->ISRC = $val['Song']['ISRC'];\n \n $sobj->DownloadStatus = $this->IsDownloadable($val['Song']['ProdID'], $library_terriotry, $val['Song']['provider_type']);\n \n if($sobj->DownloadStatus) {\n $sobj->fileURL = 'nostring';\n }else{\n $sobj->fileURL = Configure::read('App.Music_Path').shell_exec('perl '.ROOT.DS.APP_DIR.DS.WEBROOT_DIR.DS.'files'.DS.'tokengen '.$val['Sample_Files']['CdnPath'].\"/\".$val['Sample_Files']['SaveAsName']);\n }\n \n \n $albumData = $this->Album->find('first',\n array(\n 'fields' => array('ProdID', 'AlbumTitle', 'Artist', 'provider_type'),\n 'conditions' => array('ProdID' => $val['Song']['ReferenceID'], 'provider_type' => $val['Song']['provider_type']),\n 'recursive' => -1,\n )\n );\n\n $sobj->AlbumProdID = $this->getProductAutoID($albumData['Album']['ProdID'], $albumData['Album']['provider_type']);\n $sobj->AlbumTitle = $this->getTextUTF($albumData['Album']['AlbumTitle']);\n $sobj->AlbumArtist = $this->getTextUTF($albumData['Album']['Artist']);\n\n $search_list[] = new SoapVar($sobj,SOAP_ENC_OBJECT,null,null,'SearchDataType');\n\n }\n\n $data = new SoapVar($search_list,SOAP_ENC_OBJECT,null,null,'ArraySearchDataType');\n\n\n if(!empty($ArtistData)){\n return $data;\n }\n else {\n throw new SOAPFault('Soap:client', 'Freegal is unable to find any Artist containing the provided keyword.');\n }\n\n }",
"public function records()\n {\n }",
"function getMSITRecords()\r\n {\r\n\t $DBObject = new DBOperations(); // Create Data Base Operations Object\r\n\t $arrayUndergrad=array(); // Array of the Person data\r\n\t $intIndex = 0;\r\n\t \r\n // Connect to data Base\r\n if($DBObject->connect_DataBase() == false)\r\n {\r\n\t\t $arrayUndergrad[0] = \"ERROR1\";\r\n\t\t $arrayUndergrad[1] = \"Error: Could not connect to database. please try again later.\";\r\n\t }\r\n\t else\r\n\t {\r\n\t $result = $DBObject-> getAlLMSIT(); // GET ALL MASTER INFORMATION TECH STUDENTS\r\n\t\t\r\n\t\t // Read the recordset\t\t \r\n\t while ($row=$result->fetch_array()) \r\n\t {\r\n\t $utepid = $row['person_utepid'];\r\n\t\t $lastname = $row['last_name'];\r\n\t\t $firstname = $row['first_name'];\r\n\t\t $middlename = $row['middle_name'];\r\n\t\t $program = $row['program_name'];\r\n\t\t $advisor = $row['advisor'];\r\n\t\t $educationLevel = $row['EdL_name'];\r\n\t\t $term = $row['entryTerm']; \r\n\t\t $gpa = $row['gpa'];\r\n\t\t \t\r\n\t\t \r\n\t\t $record = $utepid . \",\" . $lastname . \",\" . $firstname . \",\" . $middlename . \",\" . $program . \",\" . $advisor . \",\" . $educationLevel . \",\" . $term . \",\" . $gpa;\r\n\t\t \t\t \r\n\t\t $arrayUndergrad[$intIndex] = $record;\r\n\t\t $intIndex++; \r\n }\r\n\t }\r\n\t // ENCODE TO JSON Array AND MOVE TO FRONT END\r\n\t echo json_encode($arrayUndergrad);\r\n $DBObject->disconnect_DataBase();\r\n }",
"public function getAll(){\n\t\t$sql = \"SELECT * from {$this->_dbName}.{$this->_tableName} w \";\n\t\treturn $this->getRecords($sql);\n\t}",
"function search ( $key, $tag, $page = FALSE )\n\t{ \n $this->db->start_cache();\n\t $meta = $this->metadata();\n\t\t$this->db->from( 'ecmnote' );\n \n $this->db->join( 'pubmed', 'pubmed.idecm = ecmnote.idecm', 'left' );\n $this->db->where('ecmnote.project_id', $_SESSION['project_id']);\n\n if( $tag == 'E') //Retrieve PubMed Records Based on ECM Figure Input\n {\n $this->db->where( 'ecmnote',$key );\n }\n elseif($tag == 'mol_pub') //Retrieve PubMed Records Based on array of idecm.\n {\n $this->db->where_in( 'pubmed.idecm',$key );\n $this->db->distinct( 'pubmed.PMID' );\n $this->db->group_by( 'pubmed.PMID' );\n }\n else //Retrieve PubMed Records Based on Manual ECM Note Selection.\n {\n $this->db->where( 'ecmnote.idecm',$key );\n }\n \n $this->db->stop_cache();\n \n if( $this->model_utilities->pagination_enabled == TRUE )\n {\n $config = array();\n $config['total_rows'] = $this->db->count_all_results();\n $config['base_url'] = '/pubmed/search/'.$key.'/';\n $config['uri_segment'] = 4;\n $config['per_page'] = $this->pagination_per_page;\n $config['num_links'] = $this->pagination_num_links;\n\n $this->pagination->initialize($config);\n $this->pager = $this->pagination->create_links();\n \n $this->db->limit( $config['per_page'], $page );\n }\n \n $query = $this->db->get();\n \n /**\n * Retrieve Authors associated with the PubMed record(s) retrieved above.\n */\n\t\t$this->db->select( 'pubmed_id, ArticleTitle, LastName, Initials, pubauth.id AS pubauth_id');\n $this->db->from( 'ecmnote' );\n $this->db->join( 'pubmed', 'pubmed.idecm = ecmnote.idecm', 'left' );\n $this->db->join( 'pubauth', 'pubmed_id = pubmed.id','left');\n \n if( $tag == 'E') //Retrieve Author Records Based on ECM Figure Input\n {\n $this->db->where( 'ecmnote',$key );\n }\n elseif($tag == 'mol_pub')\n {\n \n }\n else //Retrieve Author Records Based on Manual ECM Note Selection.\n {\n $this->db->where( 'ecmnote.idecm',$key );\n }\n\t\t\n\t\t$auth_query = $this->db->get();\n\n\t\t$pub = array();\n\t\t$auth = array();\n $q = array();\n\n if ( $query->num_rows() > 0 )\n {\n \n /**\n * Get Authors into an array.\n */\n foreach ($auth_query->result_array() as $r)\n {\n $auth[] = array (\n 'pubmed_id'=> $r['pubmed_id'],\n 'LastName' => $r['LastName'],\n 'Initials' => $r['Initials']\n );\n }\n\n\n /**\n * Get main PubMed data into an array with the authors array.\n */\n\t\tforeach ( $query->result_array() as $row )\n\t\t{\n\t\t\t$pub[] = array(\n 'idecm' => $row['idecm'],\n 'ecmnote' => $row['ecmnote'],\n 'id' => $row[\"id\"],\n 'PMID' => $row[\"PMID\"],\n 'Volume' => $row['Volume'],\n 'Issue' => $row['Issue'],\n 'PubDate' => $row['PubDate'],\n 'Title' => $row['Title'],\n 'ArticleTitle' => $row['ArticleTitle'],\n 'MedlinePgn' => $row['MedlinePgn'],\n 'ELocationID' => $row['ELocationID'],\n 'authors' => $auth\n );\n\t\t}\n \n $this->db->flush_cache(); \n return $pub;\n }\n else\n {\n return array();\n }\n \n\t}",
"public function LoadRecords()\n {\n \t$this->SetCulture();\n \t$this->groupings_records = $this->GetGroupingsRecords();\n }",
"private function syncRecords(){\n $this->importRecordsToMycelium();\n $this->indexRelationships();\n $this->indexPortal();\n }",
"private function createRecords(){\r\n\t\t\r\n\t\t$fileNames = explode(',', $this->collection['images']);\r\n\t\t\r\n\t\tforeach($fileNames as $fileName){\r\n\t\t\t\t\r\n\t\t\tif(trim($fileName) && !isset($this->images[$fileName])){\r\n\t\t\t\t\r\n\t\t\t\t$newRecord = array(\r\n\t\t\t\t\t'pid' => $this->collection['pid'],\r\n\t\t\t\t\t'collection' => $this->collection['uid'],\r\n\t\t\t\t\t'crdate' => time(),\r\n\t\t\t\t\t'cruser_id' => $this->collection['cruser_id'],\r\n\t\t\t\t\t'image' => $fileName,\r\n\t\t\t\t\t'title' => $this->getTitleFromName($fileName)\r\n\t\t\t\t);\r\n\t\t\t\t$this->db->exec_INSERTquery('tx_gorillary_images', $newRecord);\r\n\t\t\t\t$newRecord['uid'] = $this->db->sql_insert_id();\r\n\t\t\t\t$this->images[$fileName] = $newRecord;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"public function getAllRecords() {\r\n\t\t$select = $this->makeSelect(1);\r\n\t\treturn $this->fetchAll($select);\r\n\t}",
"protected function _getRelatedRecords(){ }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Company Request by users | public function companyUsersRequest()
{
//Paginating products
$user_id = Auth::user()->id;
$company = Company::where('user_id',$user_id)->first();
$users = CompanyUsers::where('company_id',$company->id)->orderBy('id','desc')->paginate(15);
foreach($users as $user)
{
$userData = UserDetails::where('user_id',$user->user_id)->first();
$userObj = User::find($userData->user_id);
$user->name = $userData->first_name.' '.$userData->last_name;
$user->phone = $userData->phone;
$user->account_type = $userData->account_type;
$user->email = $userObj->email;
$user->userdetail_id = $userData->id;
}
$previousPageUrl = $users->previousPageUrl();//previous page url
$nextPageUrl = $users->nextPageUrl();//next page url
$lastPage = $users->lastPage(); //Gives last page number
$total = $users->total();
return view('company.users.request')->with(['users'=>$users,'previousPageUrl'=>$previousPageUrl,'nextPageUrl'=>$nextPageUrl,'lastPage'=>$lastPage,"total"=>$total]);
} | [
"public function get_company_of_user(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'user_id' => 'required',\n ]);\n if ($validator->fails()) {\n return AdapterHelper::sendResponse(false, 'Validator error', 400, $validator->errors()->first());\n }\n try {\n //code...\n $user = User::find($request->user_id);\n if (!$user) {\n return AdapterHelper::sendResponse(false, 'Not found', 404, 'User Not Found');\n }\n $data = $user->company()->get();\n } catch (\\Throwable $th) {\n //throw $th;\n AdapterHelper::write_log_error($th, \"Mobile\", $request->getRequestUri());\n return AdapterHelper::sendResponse(false, 'Undefined error', 500, $th->getMessage());\n }\n return AdapterHelper::sendResponse(true, $data, 200, 'success');\n }",
"public function getAllCompanyUsers(){\n $data = array();\n $entityType = $_GET[\"entityType\"];\n $companyList = $_GET[\"companyList\"];\n $user_name = $_GET[\"user_name\"];\n\n $users = $this->user->findCompanyUsers($entityType, $companyList, $user_name);\n\n foreach($users as $user){\n\n $entityTypeVal = $this->entityType->find($user[\"masterUserGroup\"][\"entity_type_id\"]);\n if($entityType != \"\"){\n if ($user[\"masterUserGroup\"][\"entity_type_id\"] == $entityType){\n $data[] = array(\n $user['name'],\n $user['email'],\n $user['masterUserGroup'][\"name\"],\n $user['company'][\"name\"],\n $entityTypeVal->name,\n );\n }\n }\n else{\n $data[] = array(\n $user['name'],\n $user['email'],\n $user['masterUserGroup']['name'],\n $user['company'][\"name\"],\n $entityTypeVal->name,\n );\n }\n }\n\n return response()->json([\"data\" => $data]);\n\n }",
"public function companyUsers(Request $request) {\n\n\t\t$data = ['msg' => 'please try again later.', 'success' => '0', 'data' => []];\n\n\t\tif ($request->ajax()) {\n\n\t\t\t$companyId = $request->input('company_id');\n\n\t\t\t$query = User::where('company_id', $companyId)->where('role_id', '!=', 1)->where('is_active', '1');\n\n\t\t\tif ($request->input('group_owner')) {\n\n\t\t\t\t$query = $query->where('id', '!=', $request->input('group_owner'));\n\n\t\t\t}\n\n\t\t\t$users = $query->get();\n\n\t\t\treturn Response::json(array(\n\n\t\t\t\t'success' => '1',\n\n\t\t\t\t'data' => $users,\n\n\t\t\t\t'msg' => 'Success',\n\n\t\t\t));\n\n\t\t}\n\n\t\treturn $data;\n\n\t}",
"public function requestCompanyToUnit(Request $request){\n try{\n // Collect all request based on company id\n $companyUser = $request->user();\n if(!$companyUser || !$companyUser->hasRole('company'))\n throw new Exception(\"Must be send by company\");\n\n $validator = Validator::make($request->all(), [\n 'condemnation_id'=>'required'\n ]);\n\n if( $validator->fails()){\n $validatorErrors = [];\n foreach($validator->messages()->getMessages() as $fieldName => $messages) {\n foreach( $messages as $message){\n $validatorErrors[$fieldName] = $message;\n }\n }\n throw new Exception(implode(' ',$validatorErrors));\n }\n\n $activeCondemnation = Condemnation::where(['id'=>$request->input('condemnation_id'),'status'=>0]);\n if(!$activeCondemnation)\n throw new Exception(\"Sorry condemnation not found!\");\n\n $company_term = TermRelation::where(['user_id'=>$companyUser->id,'role'=>4, 'term_type'=>0])->first();\n\n // Get all solder request that approve by company\n $allPendingRequest = SolderItemRequest::where([\n 'company_id'=>$company_term->company_id,\n 'status'=>2\n ])->get();\n\n if(count($allPendingRequest) === 0 )\n throw new Exception(\"Pending request not found!\");\n\n // Get company term\n\n $requestJsonData = array();\n $requestItems = 0;\n $collectedKitTypes = [];\n $mainCollection =[];\n foreach( $allPendingRequest as $key=>$pendingRequest ){\n // Get request item\n $kitItem = SolderKits::find($pendingRequest->solder_kit_id);\n\n // Collect item Ids\n if(isset($requestJsonData['kit_ids'])){\n $requestJsonData['kit_ids'] = $requestJsonData['kit_ids'].','.$kitItem->item_id;\n }else {\n $requestJsonData['kit_ids'] = (string)$kitItem->item_id;\n }\n // Get kit types\n $item_types = ItemType::find($kitItem->item_type_id);\n\n if(isset($collectedKitTypes[$item_types->type_name])){\n $collectedKitTypes[$item_types->type_name]['items'] +=1;\n }else {\n $collectedKitTypes[$item_types->type_name]['items'] = 1;\n $collectedKitTypes[$item_types->type_name]['type_id'] = $kitItem->item_type_id;\n }\n\n $requestItems += 1;\n $pendingRequest->status = 2;\n $pendingRequest->save();\n }\n\n if(count($collectedKitTypes)>0){\n foreach($collectedKitTypes as $type_name=>$kitType ){\n array_push($mainCollection, ['type_name'=>$type_name,'quantity'=>$kitType['items'], 'type_id'=>$kitType['type_id']]);\n }\n }\n\n $companyUnitUser = TermRelation::getCompanyUnitUser($company_term->unit_id);\n if( count($requestJsonData) > 0 ) {\n $requestJsonData = (object) $requestJsonData;\n $requestJsonData->kit_types = $mainCollection;\n // Check if it has already a request\n $unitRequest = KitItemRequest::where([\n 'condemnation_id'=>$request->input('condemnation_id'),\n 'company_user_id'=>$companyUser->id,\n 'stage'=>1,\n 'status'=> 1 // unit level\n ])->first();\n\n if(!$unitRequest )\n $unitRequest = new KitItemRequest();\n $unitRequest->stage = 1;\n $unitRequest->status = 1; // For unit\n $unitRequest->request_items = $requestItems;\n $unitRequest->kit_items = \\GuzzleHttp\\json_encode($requestJsonData);\n $unitRequest->unit_user_id = $companyUnitUser->user_id;\n $unitRequest->company_user_id = $companyUser->id;\n $unitRequest->condemnation_id = $request->input('condemnation_id');\n $unitRequest->save();\n\n //Send push notification to unit level\n\n }else {\n throw new Exception(\"Sorry request item not found!\");\n }\n\n return ['success'=>true, 'message'=>\"Request send to unit level!\", 'data'=>$company_term ];\n }catch (Exception $e){\n return ['success'=>false, 'message'=>$e->getMessage()];\n }\n }",
"public static function getRequestListToUser ()\n\t{\n\t\t$list = ContactList::model()->findAll('id_response=\"'.Yii::app()->user->id.'\" and status=0' );\n\t\tforeach ($list as $contact)\n\t\t{\n\t\t\t$request_list[] = $contact->id_request;\n\t\t}\n\t\treturn $request_list;\n\t}",
"private function getUserCompanies()\n {\n $userId = Auth::user()->id;\n return Company::where('user', $userId)->get();\n }",
"private function getRequestedCompanies()\n {\n $collection = $this->companyCollectionFactory->create();\n $collection = $this->filter->getCollection($collection);\n\n return $collection->getItems();\n }",
"public function getRequestsByUserYears( $user, $yearRangeStr, $requestTypeStr, $status=null ) {\n\n// $userSecUtil = $this->container->get('user_security_utility');\n// //academicYearStart\n// $academicYearStart = $userSecUtil->getSiteSettingParameter('academicYearStart','vacreq');\n// if( !$academicYearStart ) {\n// $academicYearStart = \\DateTime::createFromFormat('Y-m-d', date(\"Y\").\"-07-01\");\n// //throw new \\InvalidArgumentException('academicYearStart is not defined in Site Parameters.');\n// }\n// //academicYearEnd\n// $academicYearEnd = $userSecUtil->getSiteSettingParameter('academicYearEnd','vacreq');\n// if( !$academicYearEnd ) {\n// $academicYearEnd = \\DateTime::createFromFormat('Y-m-d', date(\"Y\").\"-06-30\");\n// //throw new \\InvalidArgumentException('academicYearEnd is not defined in Site Parameters.');\n// }\n $academicYearStart = $this->getAcademicYearStart();\n $academicYearEnd = $this->getAcademicYearEnd();\n\n //constract start and end date for DB select \"Y-m-d\"\n $academicYearStartStr = $academicYearStart->format('m-d');\n\n //years\n $yearRangeArr = $this->getYearsFromYearRangeStr($yearRangeStr);\n $previousYear = $yearRangeArr[0];\n $currentYear = $yearRangeArr[1];\n\n $academicYearStartStr = $previousYear.\"-\".$academicYearStartStr;\n //echo \"current academicYearStartStr=\".$academicYearStartStr.\"<br>\";\n //academicYearEnd\n $academicYearEndStr = $academicYearEnd->format('m-d');\n\n $academicYearEndStr = $currentYear.\"-\".$academicYearEndStr;\n //echo \"current academicYearEndStr=\".$academicYearEndStr.\"<br>\";\n\n $parameters = array();\n\n //process.py script: replaced namespace by ::class: ['AppVacReqBundle:VacReqRequest'] by [VacReqRequest::class]\n $repository = $this->em->getRepository(VacReqRequest::class);\n\n $dql = $repository->createQueryBuilder(\"request\");\n $dql->select('request');\n\n $dql->leftJoin(\"request.user\", \"user\");\n //$dql->leftJoin(\"request.requestType\", \"requestType\");\n\n if( $requestTypeStr == 'business' || $requestTypeStr == 'requestBusiness' ) {\n $dql->leftJoin(\"request.requestBusiness\", \"requestType\");\n }\n\n if( $requestTypeStr == 'vacation' || $requestTypeStr == 'requestVacation' ) {\n $dql->leftJoin(\"request.requestVacation\", \"requestType\");\n }\n\n $dql->andWhere(\"requestType.id IS NOT NULL\");\n\n //$dql->where(\"requestType.id IS NOT NULL AND user.id = :userId AND requestType.status = :status\");\n\n // |----|year|-----start-----end-----|year+1|----|\n // |----|2015-07-01|-----start-----end-----|2016-06-30|----|\n //echo \"range=\".$academicYearStartStr.\" > \".$academicYearEndStr.\"<br>\";\n $dql->andWhere(\"requestType.startDate >= '\" . $academicYearStartStr . \"'\" . \" AND requestType.endDate <= \" . \"'\" . $academicYearEndStr . \"'\");\n\n $dql->andWhere(\"user.id = :userId\");\n $parameters['userId'] = $user->getId();\n\n if( $status ) {\n $dql->andWhere(\"requestVacation.status = :status\");\n $parameters['status'] = $status;\n }\n\n $dql->orderBy('request.createDate', 'ASC');\n\n $query = $dql->getQuery(); //$query = $this->em->createQuery($dql);\n\n if( count($parameters) > 0 ) {\n $query->setParameters($parameters);\n }\n\n $requests = $query->getResult();\n //echo \"requests to analyze=\".count($requests).\"<br>\";\n\n return $requests;\n }",
"function getUsersOfSpecificCompany($companies_id){\n\n $company = DB::query(\"select * from b2b_users where company_id = '$companies_id'\");\n return $company;\n}",
"public static function getCompanyUserByEmail($request)\n {\n return self::find()\n ->from(self::tableName())\n ->where(['company.email' => $request])\n ->orderBy(['company.created_at' => SORT_DESC])\n ->all();\n }",
"public function testListFundingRequestsByCompany()\n {\n }",
"public function getRequestedWhitelistCompanies($request)\n { \n $requested_whitelisted_companies = WhitelistedCompany::where('candidate_id', $request->candidate_id)\n ->where('enabled', 0)\n ->where('requested', 1)\n ->with('companies')\n ->get();\n return $requested_whitelisted_companies;\n \n }",
"static function findVisibleCompanyIds($user) {\n \n // Admins, People & Financial managers can see everyone\n if($user->isAdministrator() || $user->isPeopleManager() || $user->isFinancialManager()) {\n $rows = DB::execute('SELECT id FROM ' . TABLE_PREFIX . 'companies ORDER BY name');\n \n $result = array();\n if($rows) {\n foreach($rows as $row) {\n $result[] = (integer) $row['id'];\n } // foreach\n } // if\n \n return $result;\n } // if\n \n $visible_user_ids = $user->visibleUserIds();\n \n if(is_foreachable($visible_user_ids)) {\n $users_table = TABLE_PREFIX . 'users';\n $companies_table = TABLE_PREFIX . 'companies';\n\n $result = array();\n \n $rows = DB::execute(\"SELECT DISTINCT(company_id) FROM $users_table, $companies_table WHERE $users_table.id IN (?) ORDER BY $companies_table.is_owner DESC, $companies_table.name\", $visible_user_ids);\n if($rows) {\n foreach($rows as $row) {\n $result[] = (integer) $row['company_id'];\n } // foreach\n } // if\n \n if(!in_array($user->getCompanyId(), $result)) {\n $result[] = $user->getCompanyId();\n } // if\n \n $projects_table = TABLE_PREFIX . 'projects';\n $project_users_table = TABLE_PREFIX . 'project_users';\n \n $rows = DB::execute(\"SELECT DISTINCT $projects_table.company_id AS 'company_id' FROM $projects_table, $project_users_table WHERE $projects_table.id = $project_users_table.project_id AND $project_users_table.user_id = ? AND $projects_table.state >= ? AND $projects_table.company_id > 0 AND $projects_table.company_id NOT IN (?)\", $user->getId(), STATE_TRASHED, $result);\n if($rows) {\n foreach($rows as $row) {\n $result[] = (integer) $row['company_id'];\n } // foreach\n } // if\n \n return $result;\n } else {\n return array($user->getCompanyId());\n } // if\n }",
"function listRequestByOwner($employeId)\n\t{\n\t\t\n\t}",
"function getAllUserRequest($headersObj, $options = null){\n\n $optionsArray = array('page', 'per_page', 'query', 'show_refresh_tokens', 'type', 'full_dehydrate');\n\n $request_headers = array();\n $request_headers[] = 'X-SP-GATEWAY:' . $headersObj->XSPGATEWAY;\n $request_headers[] = 'X-SP-USER-IP:' . $headersObj->XSPUSERIP;\n $request_headers[] = 'X-SP-USER:' . $headersObj->XSPUSER;\n $request_headers[] = 'Content-Type:' . $headersObj->ContentType;\n\n\n $base = \"https://uat-api.synapsefi.com/v3.1/users\";\n\n\n if (isset($options)){\n foreach ($options as $key => $value) {\n if (in_array($key, $optionsArray )){\n if ($key == 'query')\n $url = $base . '?query=' . $value;\n\n if ($key == 'page'){\n $url = $url . '&page=' . $value;\n }\n if ($key == 'per_page'){\n $url = $url . '&per_page=' . $value;\n }\n if ($key == 'show_refresh_tokens'){\n $url = $url . '&show_refresh_tokens=' . $value;\n }\n\n }//innerif\n }//foreach\n }//outerif\n else{$url = $base;}\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $request_headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $response_body = curl_exec($ch);\n $obj = json_decode($response_body);\n return $obj;\n }",
"public function getUserLimiter(empresa $company);",
"public function getCompanyUsers() {\n\n \t\t//parse inputs\n \t\t$resourcePath = \"/users/company\";\n \t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n \t\t$method = \"GET\";\n $queryParams = array();\n $headerParams = array();\n $headerParams['Accept'] = 'application/json';\n $headerParams['Content-Type'] = 'application/json';\n\n //make the API Call\n if (! isset($body)) {\n $body = null;\n }\n \t\t$response = $this->apiClient->callAPI($resourcePath, $method,\n \t\t $queryParams, $body,\n \t\t $headerParams);\n\n\n if(! $response){\n return null;\n }\n\n \t\t$responseObject = $this->apiClient->deserialize($response,\n \t\t 'array[UserDto]');\n \t\treturn $responseObject;\n\n }",
"public function getUserRequests() {\n\t\t$stmt = \"SELECT id, fname, lname, uname, email, pass_hash, dealerID, dealercode,\n\t\t\t\t dealername, admin, active, user_team_id, user_type_id, user_id,\n\t\t\t\t req_by_name, req_by_email\n\t\t\t\t FROM user_setup_request\";\n\n\t\t// Prepare and execute statement\n\t\tif(!($stmt = $this->dbo->prepare($stmt))) {\n\t\t\tsendErrorNew($dbo->errorInfo(), __LINE__, __FILE__);\n\t\t\t$result = false;\n\t\t}\n\n\t\tif(!($stmt->execute())) {\n\t\t\tsendErrorNew($stmt->errorInfo(), __LINE__, __FILE__);\n\t\t\t$result = false;\n\t\t} else {\n\t\t\t/* Save data as SESSION var so that user approval submit does not have to do another db call.\n\t\t \t * All info is already available here.\n\t\t \t * Use checkbox id of selected users to search through SESSION array and retreive data\n\t\t\t**/\n\t\t\t$result = $stmt->fetchAll();\n\t\t\t$_SESSION['user_requests'] = $result;\n\t\t\t//echo '$result: '.var_dump($result = $stmt->fetch(PDO::FETCH_ASSOC));\n\t\t}\n\t\treturn $result;\n\t}",
"function userRequestedBy() {\n \t\n \t$user_requested_by_request_url = sprintf($this->api_urls['user_requested_by'], $this->access_token);\n \t\n \treturn $this->__apiCall($user_requested_by_request_url);\n \t\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Populate attribute values from category Data loaded from EAV | protected static function loadAttributeValues(\Magento\Catalog\Model\Category $category)
{
foreach (self::$attributeCodes as $attributeCode) {
self::$attributeValues[$category->getId()][$attributeCode] = $category->getData($attributeCode);
}
} | [
"public static function initAttributeCategory($data)\n {\n \t$fields = array( 'category_id', 'attribute_id');\n\n $rs = array();\n \n foreach($fields as $field)\n {\n if(isset($data[$field]))\n {\n $rs[$field] = $data[$field];\n }\n }\n \n return $rs;\n }",
"public function addAttributeValues()\n\t{\n\t\t$helper = Mage::helper('zendmonk_urlcategories/defaultpath');\n\t\t$updateCategoryData = $helper->updateProducts();\n\t\t$helper->updateCategories($updateCategoryData, true);\n\t}",
"protected function _buildAttributeData()\n {\n $this->_attributeData = array();\n $collection = Mage::getResourceModel('gene_bluefoot/attribute_collection')\n ->addVisibleFilter();\n\n foreach($collection as $attr){\n $this->_attributeData[$attr->getAttributeCode()] = $this->_flattenAttributeData($attr);\n $this->_attributeCodes[$attr->getId()] = $attr->getAttributeCode();\n }\n $this->_initAttributeFlag = true;\n }",
"function CategoryToAttribute($argcatid) {\n $arrClms = array('fkCategoryID', 'fkAttributeID');\n $varWhere = \"fkCategoryid='\" . $argcatid . \"'\";\n $varOrderBy = 'fkAttributeID ASC';\n $varTable = TABLE_ATTRIBUTE_TO_CATEGORY;\n $arrRes = $this->select($varTable, $arrClms, $varWhere, $varOrderBy);\n $arrRows = array();\n foreach ($arrRes as $val) {\n $arrClms = array('pkAttributeID', 'AttributeCode', 'AttributeLabel', 'AttributeInputType');\n $varOrderBy = 'pkAttributeID DESC';\n $varWher = 'pkAttributeID = ' . $val['fkAttributeID'];\n $arrRow = $this->select(TABLE_ATTRIBUTE, $arrClms, $varWher, $varOrderBy);\n $arrRows[$val['fkAttributeID']]['pkAttributeID'] = $arrRow[0]['pkAttributeID'];\n $arrRows[$val['fkAttributeID']]['AttributeCode'] = $arrRow[0]['AttributeCode'];\n $arrRows[$val['fkAttributeID']]['AttributeLabel'] = $arrRow[0]['AttributeLabel'];\n $arrRows[$val['fkAttributeID']]['AttributeInputType'] = $arrRow[0]['AttributeInputType'];\n\n $arrClmsOpt = array('pkOptionID', 'OptionTitle', 'OptionImage');\n $varOrderByOpt = 'pkOptionID ASC';\n $varWherOpt = 'fkAttributeID = ' . $val['fkAttributeID'];\n $arrOpt = $this->select(TABLE_ATTRIBUTE_OPTION, $arrClmsOpt, $varWherOpt, $varOrderByOpt);\n $arrRows[$val['fkAttributeID']]['OptionsData'] = $arrOpt;\n $arrRows[$val['fkAttributeID']]['OptionsRows'] = count($arrOpt);\n }\n //pre($arrRows);\n return $arrRows;\n }",
"protected function buildEavAttributeValues() : void\n {\n $attributeSet = $this->_getAttributeSet();\n\n foreach (self::$eavRawAttributes[$attributeSet->getKey()] as $eavRawAttribute) {\n $eavRawAttribute->setForeignEavName($this->getForeign());\n $value = $eavRawAttribute->getValueInstance($this->id, $this->getForeign(), $this->_languageId);\n $this->attributes[$eavRawAttribute->code] = $value->value;\n $this->eavRawAttributeValues[$eavRawAttribute->code] = $value;\n }\n }",
"function categoryAttributes($category_id) {\n $sizeArr = (new \\yii\\db\\Query())\n ->select(['size'])\n ->from('product_size_variation')\n ->where(['category_id' => $category_id])\n ->orderBy(['order' => SORT_ASC])\n ->all();\n\n $attrArr = (new \\yii\\db\\Query())\n ->select(['attribute_name'])\n ->from('product_size_attributes')\n ->where(['category_id' => $category_id])\n ->all();\n\n $data = array(\n 'size' => array(),\n 'attributes' => array()\n );\n if (!empty($sizeArr)) {\n foreach ($sizeArr as $size) {\n array_push($data['size'], $size['size']);\n }\n }\n if (!empty($attrArr)) {\n foreach ($attrArr as $attr) {\n array_push($data['attributes'], $attr['attribute_name']);\n }\n }\n $this->getJson(array('status' => '1', 'data' => $data, 'message' => 'Success.'));\n }",
"private function ReadCategoryData(){\n\t\t\n\t\t$req = 'SELECT * from blog_cat_article order by nom_cat';\n\t\t$aResult = SPDO::getInstance()->query($req);\n\t\t$aListCat = $aResult->fetchAll(PDO::FETCH_ASSOC);\t\n\t\tforeach ($aListCat as $key => $aCat) {\n\t\t\t$this->_aCatData[$key]['id_cat'] = $aCat['id_cat'];\n\t\t\t$this->_aCatData[$key]['nom_cat'] = $aCat['nom_cat'];\n\t\t}\n\t\t\n\t}",
"function fill_product_category(){\n\t\t$data = array();\n\t\t$i = 0;\n\t\tforeach($this->product_categories as $cat){\n\t\t\t$i++;\n\t\t\t$row = array();\n\t\t\t$row['id'] = $i;\n\t\t\t$row['name'] = $cat;\n\t\t\t$row['slug'] = strtolower($cat);\n\t\t\t$row['parent_id'] = 0;\n\t\t\t$row['created_at'] = $this->mysql_time_now();\n\t\t\t$data[] = $row;\n\t\t}\n\t\t$this->pcm->add_batch($data);\n\t}",
"protected function prepareAttributes()\n {\n\n // laod the callbacks for the actual attribute code\n $callbacks = $this->getCallbacksByType($this->attributeCode);\n\n // invoke the pre-cast callbacks\n foreach ($callbacks as $callback) {\n $this->attributeValue = $callback->handle($this);\n }\n\n // load the ID of the product that has been created recently\n $lastEntityId = $this->getPrimaryKey();\n\n // cast the value based on the backend type\n $castedValue = $this->castValueByBackendType($this->backendType, $this->attributeValue);\n\n // prepare the attribute values\n return $this->initializeEntity(\n array(\n $this->getPrimaryKeyMemberName() => $lastEntityId,\n MemberNames::ATTRIBUTE_ID => $this->attributeId,\n MemberNames::VALUE => $castedValue\n )\n );\n }",
"private function getCategoryData()\n\t{\n\t\treturn $this->findByIndex($this->category);\n\t}",
"protected function prepareAssignCatActionData()\n {\n foreach ($this->_data as $key => $value) {\n switch ($key) {\n case 'urlPath':\n $this->_urlPath = $value;\n break;\n case 'paramName':\n $this->_paramName = $value;\n break;\n default:\n $this->_additionalData[$key] = $value;\n break;\n }\n }\n }",
"public function getAttributes() {\r\n $select = $this->select()->order(array('display_order'));\r\n return($this->findDependentRowset('Application_Model_DbTable_CategoryAttributes', 'Categories', $select));\r\n }",
"protected function _importAttributes()\n {\n $productAttributes = Mage::getModel('eav/entity_type')->loadByCode($this->getEntityTypeCode())\n ->getAttributeCollection()\n ->addFieldToFilter('frontend_input', array('select', 'multiselect'))\n ->addFieldToFilter('is_user_defined', true);\n\n foreach ($productAttributes as $attribute) {\n $attributeCode = $attribute->getAttributeCode();\n $sourceOptions = $attribute->getSource()->getAllOptions(false);\n\n $options = array();\n foreach ($this->_dataSourceModel->getEntities() as $rowData) {\n if (isset($rowData[$attributeCode]) && strlen(trim($rowData[$attributeCode]))) {\n $optionExists = false;\n foreach ($sourceOptions as $sourceOption) {\n if ($rowData[$attributeCode] == $sourceOption['label']) {\n $optionExists = true;\n break;\n }\n }\n if (!$optionExists) {\n $options['value']['option_' . $rowData[$attributeCode]][0] = $rowData[$attributeCode];\n }\n }\n }\n if (!empty($options)) {\n $attribute->setOption($options)->save();\n }\n }\n $this->_dataSourceModel->getIterator()->rewind();\n\n return $this;\n }",
"protected static function loadAttributeCodes()\n {\n /** @var \\Magento\\Catalog\\Model\\Config $catalogConfig */\n $catalogConfig = \\Magento\\TestFramework\\Helper\\Bootstrap::getObjectManager()->create(\n \\Magento\\Catalog\\Model\\Config::class\n );\n $attributeCodes = $catalogConfig->getEntityAttributeCodes(\\Magento\\Catalog\\Model\\Category::ENTITY);\n\n foreach ($attributeCodes as $attributeCode) {\n if (in_array($attributeCode, self::$attributesToExclude)) {\n continue;\n }\n self::$attributeCodes[] = $attributeCode;\n }\n }",
"public function getAttributes( $aRawData )\n\t{\n\t if( !$this->isValidCategory( isset($this->aAttributeLookupCol['ValidCategory']) ? $aRawData[$this->aAttributeLookupCol['ValidCategory']] : $aRawData['advertisercategory'] ) ) {\n\t return false;\n\t }\t \n\n\t //$sRawData = $sRawData . ' ' . $aData['basicData']['advertisercategory']; \n\t \n\t $aData = array();\n\t $iLevel2Parent = 0;\n\t foreach($this->aMapping as $aTypeKey => $aTypeValue) {\n\t if( $aTypeKey == 'brand' ) {\n\t continue;\n\t }\n\t foreach($aTypeValue as $aAttributeKey => $aAttributeValue ) {\n\t \n// \t if( $aAttributeKey == 'Brand' ) {\n// \t continue;\n// \t }\t \n\t \n\t if( $aAttributeKey == 'categories' ) {\n\t $a = '';\n\t }\n\t \n\t $sRawData = '';\n\t $aColArr = isset($this->aAttributeLookupCol[$aAttributeKey]) ? $this->aAttributeLookupCol[$aAttributeKey] : $this->aAttributeLookupCol['Default']; \n\t foreach( $aColArr as $col) {\n\t $sRawData .= $aRawData[$col] . ' ';\n\t }\n\n\t \t \n\t foreach($aAttributeValue as $key => $valArray ) {\n\t \n\t // Already have find a catagory so ignore others\n\t if( $iLevel2Parent > 0 && $aAttributeKey == 'categories' ) {\n\t break;\n\t }\n\t \t \n\t foreach($valArray as $val ) {\n \n\t if( strstr($key, 'Underwear') ) {\n\t $a = '';\n\t }\n\t \t \n //if( $this->contains_all(array('rawData'=>$sRawData, 'advCat'=>$aData['basicData']['advertisercategory']), $key, $aAttributeKey) ) {\n if( $this->contains_all($sRawData, $key, $aAttributeKey) ) {\n \n if( $aAttributeKey=='categories' && $val['depth']==2 ) {\n $iLevel2Parent = $val['attributeParentId'];\n }\n \n $aData[$aTypeKey][$aAttributeKey][] = $val;\n if( !in_array($aAttributeKey, array('categories', 'Feature', 'Season', 'Wash', 'Washing Instructions')) ) {\n break 2;\n } \n }\n\t }\n\t }\n\t }\n\t }\n \n if( @is_array($aData['attributes']['categories']) && @count($aData['attributes']['categories']) ) { \n \n if( $iLevel2Parent > 0 ) {\n foreach($aData['attributes'] as $key => &$values) {\n foreach($values as &$val) {\n if( isset($this->aAdditinalMapping[$key][$iLevel2Parent][$val['value']]) ) {\n $val['attributeId'] = $this->aAdditinalMapping[$key][$iLevel2Parent][$val['value']]['attributeId'];\n $val['attributeParentId'] = $this->aAdditinalMapping[$key][$iLevel2Parent][$val['value']]['attributeParentId'];\n }\n }\n }\n }\n \n\t\t\treturn $aData;\n\t\t}\n\t\telse {\n\t\t\treturn array(); \n\t\t}\n\n\t}",
"public function createAttributes()\n {\n /** @var \\Shopware\\Components\\Model\\ModelManager $em */\n $em = $this->get('models');\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'link',\n 'int(11)',\n true,\n null\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'show_by_default',\n 'int(1)',\n true,\n 0\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'deleted_position',\n 'int(11)',\n true,\n null\n );\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'base_sort',\n 'int(11)',\n true,\n null\n );\n\n $em->generateAttributeModels(['s_categories_attributes']);\n }",
"protected function addAttributes()\n {\n $arrData = &$GLOBALS['TL_DCA'][Product::getTable()];\n $arrData['attributes'] = array();\n\n // Write attributes from database to DCA\n /** @var Attribute[] $objAttributes */\n if (($objAttributes = Attribute::findValid()) !== null) {\n foreach ($objAttributes as $objAttribute) {\n\n if (null !== $objAttribute) {\n $objAttribute->saveToDCA($arrData);\n $arrData['attributes'][$objAttribute->field_name] = $objAttribute;\n }\n }\n }\n\n // Create temporary models for non-database attributes\n foreach (array_diff_key($arrData['fields'], $arrData['attributes']) as $strName => $arrConfig) {\n if (\\is_array($arrConfig['attributes'] ?? null)) {\n if (!empty($arrConfig['attributes']['type'])) {\n $strClass = $arrConfig['attributes']['type'];\n } else {\n $strClass = Attribute::getClassForModelType($arrConfig['inputType'] ?? '');\n }\n\n if ($strClass != '') {\n\n /** @var Attribute $objAttribute */\n $objAttribute = new $strClass();\n $objAttribute->loadFromDCA($arrData, $strName);\n $arrData['attributes'][$strName] = $objAttribute;\n }\n }\n }\n }",
"private function getAttributeData(){\n\n\t\t// Se precargan valores de los atributos de productos usados en Update\n\t\t$attributes = array (\n\t\t\t\t\t\t\t\t'name',\t\t\n\t\t\t\t\t\t\t\t'description',\t\n\t\t\t\t\t\t\t\t'url_key',\t\t\n\t\t\t\t\t\t\t\t'product_sku',\n\t\t\t\t\t\t\t\t'upc',\t\t\n\t\t\t\t\t\t\t\t'manufacturer',\n\t\t\t\t\t\t\t\t'manufacturer_sku',\n\t\t\t\t\t\t\t\t'price',\t\t\n\t\t\t\t\t\t\t\t'special_price',\t\t\n\t\t\t\t\t\t\t\t'seller_id',\n\t\t\t\t\t\t\t\t'seller_name',\t\t\n\t\t\t\t\t\t\t\t'category_origin',\n\t\t\t\t\t\t\t\t'shipping_cost',\n\t\t\t\t\t\t\t\t'buy_url',\n\t\t\t\t\t\t\t\t'image_external_url',\n\t\t\t\t\t\t\t\t'status',\t\t\t\t\n\t\t\t\t\t\t\t\t'visibility',\n\t\t\t\t\t\t\t\t'quantity_and_stock_status',\n\t\t\t\t\t\t\t\t'tax_class_id',\n\t\t\t\t\t\t\t\t'meta_keyword',\n\t\t\t\t\t\t\t\t'meta_title',\n\t\t\t\t\t\t\t\t'meta_description',\n\t\t\t\t\t\t\t\t'options_container',\n\t\t\t\t\t\t\t\t'gift_message_available',\n\t\t\t\t\t\t\t\t'special_from_date'\n\t\t\t\t\t\t\t);\n\n\t\tforeach ($attributes as $attribute) {\n\t\t\t$details = $this->_attributeRepository->get($attribute);\n\n\t\t\t$this->_attributeInfo[$attribute] = array(\n\t\t\t\t\t'attribute_id' \t\t=> $details->getData('attribute_id'),\n\t\t\t\t\t'suffix'\t \t\t=> $details->getData('backend_type'),\n\t\t\t\t\t'frontend_label' \t=> $details->getData('frontend_label')\n\t\t\t\t); \n\t\t}\n\n\t}",
"public function parsePostData() {\r\n\t\t$Categories = ConfigCategory::getAllCategories();\r\n\r\n\t\tforeach ($Categories as $Category)\r\n\t\t\t$Category->parseAllValues();\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get item details of the transaction | public function getItemDetails()
{
return $this->items;
} | [
"public function getItemDetails(){\n \n if(isset($_GET['id'])){\n $item = $this->inventoryModel->GetItem($_GET['id'], $_GET['userFlag']);\n echo $item->ToJson();\n }else{\n echo \"{}\";\n }\n }",
"public function getItemTransactionID()\n {\n return $this->itemTransactionID;\n }",
"public function item_details($item_id)\n {\n $url = preg_replace('/set/i', 'item:' . $item_id, $this->public_url);\n return $this->curl($url)->item;\n }",
"public function getTransaction()\n {\n\n\n $transactionId = static::TRID;\n\n\n try {\n $transaction = $this->api->get($transactionId);\n print_r($transaction);\n } catch (\\tpay\\TException $e) {\n var_dump($e);\n }\n\n }",
"public function getTransactionDetail()\n {\n return $this->transactionDetail;\n }",
"public function getTxn();",
"public function getTransactionInfo()\n {\n return $this->transaction_info;\n }",
"public function getSaleItem();",
"public function getTransactionDetail()\n {\n return $this->TransactionDetail;\n }",
"public function details()\n {\n return $this->join('item_detail', 'items.id', '=', 'item_detail.item_id')->where('')->get();\n }",
"function getPurchaseInfo()\n\t{\n\t\treturn $this->PurchaseInfo;\n\t}",
"public function getItem()\n {\n return parent::getValue('item');\n }",
"public function getItemDetails()\n {\n $item_id = \\Request::input('item_id');\n\t\t\n\t\t$item = new Item();\n\t\t$item_details = $item->itemDetails($item_id);\n\t\t\n\t\treturn view('itemDetails')\n\t\t\t->with('item_details', $item_details);\n }",
"public function item_transaction()\n {\n\n return $this->belongsTo(ItemTransaction::class);\n \n }",
"public function getItem()\n {\n return $this->item;\n }",
"public function getPurchaseInfo() {\n $info = \"\";\n $productPrice = \"Item: \" . $this->getType() . \" Price: \" . $this->price . \"\\n\"; \n $info .= $productPrice;\n foreach($this->extraItems as $extraItem) {\n $extraPrice = \"- Extra item: \" . $extraItem->getType() . \" Price: \" . $extraItem->getPrice() . \"\\n\";\n $info .= $extraPrice;\n }\n return $info;\n }",
"public function getItemsDetail()\n\t{\n\t\treturn $this->items_detail;\n\t}",
"public function getTransactionData();",
"public function getStItemInfo()\n {\n return $this->get(self::STITEMINFO);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Gets an array of the address book contact groups with a specified name. | public static function getAddressBookGroupIdByName($name)
{
$abGroups = self::getAddressBookGroups(['offset'=>0,'limit'=>100]);
$abGroupId = [];
foreach ($abGroups as $abg) {
if (isset($abg['group_name'])) {
if ($abg['group_name']==$name) {
$abGroupId[] = $abg['group_id'];
}
}
}
return $abGroupId;
} | [
"public function getPhonebookGroups ()\n\t{\n\t\t$this->operation = 'get_contact_group';\n\t\t$this->_Fetch();\n\t\t\n\t\treturn $this->_Populate();\n\t}",
"public function getAllContactGroups() {\n $data = [];\n\n $query = \"SELECT * FROM \" . TABLE_CONTACT_GROUP . \" ORDER BY contact_group_name\";\n\n $result = $this->db->conn->query($query);\n\n if ($result->num_rows > 0) {\n $data = $result->fetch_all(MYSQLI_ASSOC);\n }\n\n return $data;;\n }",
"function getGroupsForAddress($address) {\n\t\t\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(\n\t\t\t'tx_addressgroups_group.uid, tx_addressgroups_group.pid, \n\t\t\t tx_addressgroups_group.title, tx_addressgroups_group.sys_language_uid',\t\t\t\n\t\t\t'tt_address',\n\t\t\t'tt_address_tx_addressgroups_group_mm',\n\t\t\t'tx_addressgroups_group',\n\t\t\t'AND tt_address.uid = '.intval($address['uid']).' '.\n\t\t\t\t$this->cObj->enableFields('tt_address'),\n\t\t\t'',\n\t\t\t'tt_address_tx_addressgroups_group_mm.sorting'\n\t\t);\n\t\t\n\t\twhile($group = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t\n\t\t\t// localization handling\n\t\t\tif($GLOBALS['TSFE']->sys_language_content) {\n\t\t\t\t$group = $GLOBALS['TSFE']->sys_page->getRecordOverlay(\n\t\t\t\t\t'tx_addressgroups_group',\n\t\t\t\t\t$group,\n\t\t\t\t\t$GLOBALS['TSFE']->sys_language_content\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\t$address['groups'][] = $group;\n\t\t\tunset($group);\n\t\t}\t\t\n\t\t\n\t\treturn $address;\n\t}",
"function listgroup()\n\t{\n\t\tglobal $atmail;\n\n\t $h = array();\n\n\t $abookGroup = Filter::cleanSqlFieldNames($this->db->AbookGroup);\n\n\t // users from addressbooks for current account\n\t $users = $this->db->sqlarray(\"SELECT id\n\t FROM $abookGroup\n\t WHERE Account = $this->Account_Escape AND GroupEmail != ''\");\n\n\t foreach ($users as $user)\n\t {\n\t $user = $this->db->quote($user);\n\t $v = $this->db->getvalue(\"SELECT GroupName\n\t FROM $abookGroup\n\t WHERE id = $user\");\n\n\t $h[$v] .= $this->db->getvalue(\"SELECT GroupEmail\n\t FROM $abookGroup\n\t WHERE id = $user\") . \", \";\n\t }\n\n\t return $h;\n\t}",
"function _og_mailinglist_extract_group_names($addresses) {\n // Regex borrowed from valid_email_address().\n // Case insensitivity is needed because in domain names case does not matter.\n $server = og_mailinglist_server();\n $regex = \"/([a-z0-9_\\-\\.\\+\\^!#\\$%&*+\\/\\=\\?\\`\\|\\{\\}~\\']+)@\" . $server . \"/i\";\n\n $out = array();\n foreach ($addresses as $email => $name) {\n // Parse the group name from the email.\n if (preg_match($regex, $email, $matches)) {\n $out[$matches[1]] = $email;\n }\n }\n return $out;\n}",
"function getFriendsGroups() {\n return json_decode($this->request('https://www.google.com/reader/api/0/friend/groups?output=json'));\n }",
"public function fetchAllContactGroups() {\n $data = $this->contactGroupModel->getAllContactGroups();\n\n return $data;\n }",
"public function search($name)\n {\n $groups = array();\n foreach ($this->_groups as $gid => $group) {\n if (strpos($group['name'], $name) !== false) {\n $groups[$gid] = $group['name'];\n }\n }\n asort($groups);\n return $groups;\n }",
"public function getContactGroupList() {\n return $this->find('all');\n }",
"function get_record_groups($id)\n {\n if (melanie2_logs::is(melanie2_logs::TRACE)) melanie2_logs::get_instance()->log(melanie2_logs::TRACE, \"melanie2_addressbook::get_record_groups($id)\");\n try {\n // Chargement du groupe depuis le cache\n $cache = \\melanie2::InitM2Cache();\n if (isset($cache['contacts'])\n && isset($cache['contacts'][$this->addressbook->id])\n && isset($cache['contacts'][$this->addressbook->id]['groups'])) {\n foreach($cache['contacts'][$this->addressbook->id]['groups'] as $group) {\n $group = unserialize($group);\n $members = unserialize($group->members);\n if (is_array($members)\n && in_array($id, $members)) $result[$group->id] = $group->lastname;\n }\n } else {\n $result = array();\n $_group = new Melanie2\\Contact($this->user, $this->addressbook);\n $_group->type = Melanie2\\Contact::TYPE_LIST;\n foreach($_group->getList() as $group) {\n $members = unserialize($group->members);\n if (is_array($members)\n && in_array($id, $members)) $result[$group->id] = $group->lastname;\n }\n }\n return $result;\n }\n catch (LibMelanie\\Exceptions\\Melanie2DatabaseException $ex) {\n melanie2_logs::get_instance()->log(melanie2_logs::ERROR, \"[calendar] melanie2_addressbook::get_record_groups() Melanie2DatabaseException\");\n return false;\n }\n catch (\\Exception $ex) {\n return false;\n }\n return false;\n }",
"public function getContactGroups() {\n return $this->getParameter('contact_groups');\n }",
"public static function getAllGroupsByGroupName($name)\n {\n $groups = DB::table('groups')->where('name', '=', $name)->first();\n return $groups;\n }",
"function getAllGroups() {\r\n $db = getDatabase();\r\n $stmt = $db->prepare(\"SELECT * FROM address_groups\");\r\n $results = array();\r\n if ($stmt->execute() && $stmt->rowCount() > 0) {\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n return $results;\r\n}",
"public function search($name)\n {\n $attr = $this->_params['gid'];\n try {\n $result = $this->_ldap->search(\n $this->_params['basedn'],\n Horde_Ldap_Filter::create($attr, 'contains', $name),\n array($attr));\n } catch (Horde_Ldap_Exception $e) {\n throw new Horde_Group_Exception($e);\n }\n $entries = array();\n foreach ($result->sortedAsArray(array($attr)) as $entry) {\n $entries[$entry['dn']] = $entry[$attr][0];\n }\n return $entries;\n }",
"public function listaddressgroupings() {\n\n $args = $this->args;\n $args[ \"method\" ] = __FUNCTION__;\n\n $res = $this->call($args);\n if ($res)\n return $res[ \"result\" ];\n }",
"protected function _search($name)\n {\n $this->_log();\n $groups = array();\n foreach ($this->_groups as $gid => $group) {\n if (strpos($group['name'], $name) !== false) {\n $groups[$gid] = $group['name'];\n }\n }\n asort($groups);\n return $groups;\n }",
"public static function getGroups();",
"public function getCustomerGroups();",
"function GRP_listClientGroups($clientName)\n{\n\tCHECK_FW(CC_clientname, $clientName);\n\t$cid = CLIENT_getId($clientName);\n\n\t$sql=\"SELECT groups.groupname FROM clientgroups, groups WHERE clientgroups.clientid=\\\"$cid\\\" AND clientgroups.groupid=groups.id ORDER BY groups.groupname\";\n\n\t$res = db_query($sql); //FW ok\n\n\t$i=0;\n\n\twhile ($line = mysql_fetch_row($res))\n\t\t{\n\t\t\t$arr[$i]=$line[0];\n\t\t\t$i++;\n\t\t};\n\n\treturn($arr);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the card has been just added to the session. | public function isCardNew($card)
{
return is_null($card->progress->reviewed_at);
} | [
"private function _isCardSaved() {\n\t $tokenId = (int) $this->getInfoInstance()->getAdditionalInformation('token_id');\n\t return (boolean)($this->getInfoInstance()->getAdditionalInformation('create_token') === 'true') &&\n\t !($tokenId && ($tokenId > 0));\n\t}",
"private function areThereAnyNewCardsInBoxToLearn()\n {\n $sessionCardsIDs = $this->session->cards->pluck('id');\n \n return $this->session->box->cards()\n ->whereNotIn('id', $sessionCardsIDs)\n ->exists();\n }",
"public function checkAddToCardButton()\n {\n return $this->_rootElement->find($this->addToCard, Locator::SELECTOR_CSS)->isVisible();\n }",
"public function hasCardOwner(): bool\n {\n return isset($this->cardOwner);\n }",
"public function canSaveCard() {\n return $this->order &&\n (!$this->order->getCustomerIsGuest()) &&\n $this->saveCard &&\n ($this->cardToken || $this.cardNumber) &&\n $this->last4;\n }",
"private function checkIfCardIsInSession()\n {\n if (! $this->session->hasCard($this->card)) {\n abort(422, 'The card is not present in the session!');\n }\n\n return $this;\n }",
"public function hasCardOwner() : bool\n {\n return isset($this->cardOwner);\n }",
"public function canAddCard(Card $card)\n\t{\n\t\tif ((!self::ALLOW_EMPTY && !count($this)) || count($this) >= $this->maxCards)\n\t\t\treturn false;\n\n\t\t$topCard = $this->getTop();\n\n\t\treturn $card->isPreviousRankOf($topCard)\n\t\t\t&& $card->getSuit() != $topCard->getSuit();\n\t}",
"public function canSaveCard()\n {\n $methodRegister = Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER;\n if (Mage::getModel('highrisk/paymentMethod')->getConfigData('use_vault')\n && (Mage::getSingleton('customer/session')->isLoggedIn()\n || Mage::getSingleton('checkout/type_onepage')->getCheckoutMethod() == $methodRegister)\n ) {\n return true;\n }\n return false;\n }",
"public function canAddCard($cardCount){\r\n if($cardCount < $this->getMaxSavedCards()){\r\n return true;\r\n }\r\n return false;\r\n }",
"public function hasExistingData()\r\n {\r\n if ( isset( $this->existing_twitter_cards[$this->url_key] ) ) {\r\n return true;\r\n }\r\n \r\n return false;\r\n }",
"public function hasCardNumber(): bool\n {\n return isset($this->cardNumber);\n }",
"function isNew()\n {\n\t $counter = $this->get( 'session.counter' );\n\t\tif( $counter === 1 ) {\n\t\t\treturn true;\n\t\t}\n return false;\n }",
"public function HasCart() {\n\tif ($this->IsNew()) {\n\t return FALSE;\n\t} else {\n\t return (!is_null($this->GetCartID()));\n\t}\n }",
"protected function hasSession()\n {\n return !empty($this->container->get('session')->sOrderVariables['sUserData']['additional']['user']['customernumber']);\n }",
"function isNew() {\n\t\treturn !isset($_SESSION['__UserSession_Info']) || $_SESSION['__UserSession_Info'] == UserSession_STARTED;\n\t}",
"public function hasSession() {}",
"public static function cartExists()\n {\n $cart = self::where('user_id', Auth::user()->id)->first();\n if ($cart) {\n return true;\n } else {\n return false;\n }\n }",
"public function hasCardType(): bool\n {\n return isset($this->cardType);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Registers the needed JavaScript. | public function registerClientScript()
{
$id = $this->options['id'];
$options = Json::encode([
'push' => $this->enablePushState,
'replace' => $this->enableReplaceState,
]);
$linkSelector = Json::encode($this->linkSelector !== null ? $this->linkSelector : '#' . $id . ' a');
$view = $this->getView();
PjaxAsset::register($view);
$js = "jQuery(document).pjax($linkSelector, \"#$id\", $options);";
$view->registerJs($js);
} | [
"public function addJS()\n {\n // $this->addToVar('jsCode', $this->addResource('/components/jquery/jquery.min', 'js'));\n // $this->addToVar('jsCode', $this->addResource('/twbs/bootstrap/dist/js/bootstrap.min', 'js'));\n // $this->addToVar('jsCode', $this->addResource('/js/alxarafe', 'js'));\n }",
"public function registerClientScript()\n\t{\n\t\t$view = $this->getView();\n\t\tSimpleLoadingAsset::register($view);\n\t}",
"function addSettingsJavascript() {\n\n\t\t$this->loadModules('javascript');\n\t}",
"public function register_scripts(){}",
"public function registerJs() {\r\n Yii::app()->getClientScript()->registerScriptFile(Yii::app()->request->baseUrl . \"/libs/jquerymobile/js/jquery.mobile-1.4.5.min.js\", CClientScript::POS_HEAD);\r\n Yii::app()->getClientScript()->registerScriptFile(Yii::app()->request->baseUrl . \"/libs/raty/jquery.raty.js\", CClientScript::POS_HEAD);\r\n Yii::app()->getClientScript()->registerScriptFile(Yii::app()->request->baseUrl . \"/libs/owl-carousel/owl.carousel.min.js\", CClientScript::POS_HEAD);\r\n Yii::app()->getClientScript()->registerScriptFile(Yii::app()->request->baseUrl . \"/libs/jquerymobile-windows/jqm-windows.mdialog.js\", CClientScript::POS_HEAD);\r\n Yii::app()->getClientScript()->registerScriptFile(Yii::app()->request->baseUrl . \"/js/common.min.js\", CClientScript::POS_HEAD);\r\n Yii::app()->getClientScript()->registerScriptFile(Yii::app()->request->baseUrl . \"/js/vendedor.js\", CClientScript::POS_HEAD);\r\n\r\n //Yii::app()->getClientScript()->registerScriptFile(Yii::app()->request->baseUrl . \"/js/mobile.min.js\", CClientScript::POS_HEAD);\r\n }",
"protected function loadJavascript() {}",
"protected function client_side_register()\r\n\t{\r\n\treturn '\r\n\t<script language=\"javascript\" type=\"text/javascript\">\r\n\t\tEvent.observe(window,\\'load\\','.$this->client_id().'_init);\r\n\t</script>'.spchr::endl;\r\n\t}",
"public function registerClientScript() {\n\t}",
"protected function registerClientScript()\n {\n $id = $this->getId();\n $options = Json::encode($this->ajaxOptions);\n $this->getView()->registerJs(/** @lang JavaScript */\"\n $('.{$id}').on('change.updateChart', function (event) {\n var defaultOptions = {\n url: $(this).attr('action'),\n data: $(this).serializeArray(),\n type: 'post',\n success: function (html) {\n $('.{$id}-chart-wrapper').closest('.box').find('.box-body').html(html);\n }\n };\n event.preventDefault();\n var options = $.extend(defaultOptions, $options, true)\n $.ajax(options);\n });\n \");\n }",
"public function registerClientScript()\n {\n UploadAsset::register($this->getView());\n $options = Json::encode($this->clientOptions);\n if ($this->sortable) {\n JuiAsset::register($this->getView());\n }\n $this->getView()->registerJs(\"jQuery('#{$this->getId()}').yiiUploadKit({$options});\");\n }",
"protected function addJavascriptToBackend() {\n\t\t$this->backendReference->addJavascriptFile(t3lib_extMgm::extRelPath($this->extkey) . 'mod_role/newspaper_role.js');\n\t}",
"public function registerScripts() {\n $loc = __CLASS__ . '::' . __FUNCTION__;\n $this->log->error_log( $loc );\n\n $jsurl = TE()->getPluginUrl() . 'js/signup.js';\n wp_register_script( 'manage_signup', $jsurl, array('jquery','jquery-ui-draggable','jquery-ui-droppable', 'jquery-ui-sortable'), TennisEvents::VERSION, true );\n \n $cssurl = TE()->getPluginUrl() . 'css/tennisevents.css';\n wp_enqueue_style( 'tennis_css', $cssurl );\n }",
"protected function addJavascriptToBackend() {\n\t\t$this->backendReference->addJavascriptFile(\n\t\t\tt3lib_extMgm::extRelPath($this->extkey) . 'Resources/Public/JavaScript/fluidinfo_toolbar.js');\n\t}",
"abstract protected function registerClientScript();",
"public function set_js()\n {\n $is_assets_installed = array_key_exists('assets', ee()->addons->get_installed()) ? 'y' : 'n';\n\n ee()->javascript->set_global('publisher.is_assets_installed', $is_assets_installed);\n\n ee()->javascript->set_global('publisher.ajax_get_category',\n $this->mod_link('ajax_get_category', array('type' => 'category')));\n\n ee()->javascript->set_global('publisher.ajax_save_category',\n $this->mod_link('ajax_save_category', array('type' => 'category')));\n\n ee()->javascript->set_global('publisher.ajax_get_phrase',\n $this->mod_link('ajax_get_phrase', array('type' => 'phrase')));\n\n ee()->javascript->set_global('publisher.ajax_save_phrase',\n $this->mod_link('ajax_save_phrase', array('type' => 'phrase')));\n\n ee()->javascript->set_global('publisher.ajax_deny_approval',\n $this->mod_link('ajax_deny_approval'));\n\n ee()->javascript->set_global('publisher.ajax_get_translation_status',\n $this->mod_link('ajax_get_translation_status'));\n\n ee()->javascript->set_global('publisher.ajax_get_entry_status',\n $this->mod_link('ajax_get_entry_status'));\n\n // ee()->javascript->set_global('publisher.ajax_get_approval_status',\n // $this->mod_link('ajax_get_approval_status'));\n }",
"function RegisterScripts($customJs = '')\n\t{\n\t\tglobal $modx;\n\t\t\n\t\t$jQuery = $modx->config['site_url'].'assets/snippets/webloginpe/js/jquery.packed.js';\n\t\t$jQueryForm = $modx->config['site_url'].'assets/snippets/webloginpe/js/jquery.form.js';\n\t\t$jQueryTaconite = $modx->config['site_url'].'assets/snippets/webloginpe/js/jquery.taconite.js';\n\t\t$modx->regClientStartupScript($jQuery);\n\t\t$modx->regClientStartupScript($jQueryForm);\n\t\t$modx->regClientStartupScript($jQueryTaconite);\n\t\t//$modx->regClientStartupScript($customJs);\n\t\tif (isset($customJs))\n\t\t{\n\t\t\t$modx->regClientStartupScript($customJs);\n\t\t}\n\t}",
"public function setJavascriptToInclude()\n {\n $jsFolder = api_get_path(WEB_LIBRARY_JS_PATH);\n $this->template->addResource($jsFolder.'tinymce/tinymce.min.js', 'js');\n }",
"public function ps_add_JS() {\r\n\t\twp_enqueue_script( 'jquery' );\r\n\t\t// load custom JSes and put them in footer\r\n\t\twp_register_script( 'samplescript', plugins_url( '/js/samplescript.js' , __FILE__ ), array('jquery'), '1.0', true );\r\n\t\twp_enqueue_script( 'samplescript' );\r\n\t}",
"private function registerAssets()\n {\n if ($this->jsNotifier && Yii::$app instanceof \\yii\\web\\Application) {\n RavenAsset::register(Yii::$app->getView());\n Yii::$app->getView()->registerJs('Raven.config(' . Json::encode($this->publicDsn) . ', ' . Json::encode($this->jsOptions) . ').install();', View::POS_HEAD);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dado un array, comprobar si hay elementos duplicados. | function duplicados($array)
{
if (count($array) > count(array_unique($array))) {
echo "En este array existen elementos repetidos!!";
} else {
echo "En este array no existen elementos repetidos!!";
}
} | [
"function duplicados($array) {\r\n if (count($array) > count(array_unique($array))) {\r\n echo \"En este array existen elementos repetidos!!\";\r\n } else {\r\n echo \"En este array no existen elementos repetidos!!\";\r\n }\r\n}",
"function osa_array_remove_duplicate($array) {\n\tif ( !is_array($array) && count($array) <=0 ) {\n\t\treturn FALSE;\n\t}\n\t$ret = array();\n\tforeach($array as $value) {\n\t\t$ret[$value] = $value;\n\t}\n\treturn $ret;\n}",
"function returndup($array)\r\n{\r\n $results = array();\r\n $duplicates = array();\r\n foreach ($array as $item)\r\n {\r\n if (in_array($item, $results))\r\n {\r\n $duplicates[] = $item;\r\n }\r\n\r\n $results[] = $item;\r\n }\r\n\r\n return $duplicates;\r\n}",
"function _drupal_sync_get_duplicates_values($array) {\n return array_diff_assoc($array, array_unique($array));\n}",
"function array_remove_duplicates($array){\n\n\t\t\t/*\n\t\t\t//Flip once to remove duplicates\n\t\t\t$array = array_flip($array);\n\n\t\t\t//Flip back to get desired result\n\t\t\t$array = array_flip($array);\n\n\t\t\treturn $array;\n\n\t\t\t*/\n\n\t\t\tif(!is_array($array)) return array($array);\n\t\t\telseif(empty($array)) return array();\n\n\t\t\t$tmp = array();\n\n\t\t\tforeach($array as $item){\n\n\t\t\t\tif(!@in_array($item, $tmp))\n\t\t\t\t\t$tmp[] = $item;\n\t\t\t}\n\n\t\t\treturn $tmp;\n\n\t\t}",
"public static function array_duplicate_values ($array)\r\n\t{\r\n\t\t$checkKeysUniqueComparison = create_function ('$value', 'if ($value > 1) return true;');\r\n\t\t$result = array_keys (array_filter (array_count_values ($array), $checkKeysUniqueComparison));\r\n\t\treturn $result;\r\n\t}",
"public static function arrayUnique($array)\n {\n }",
"function array_duplicates($a=array())\n{\n\t$unique = array_unique($a);\n\tforeach($unique as $k => $v)\n\t\tunset($a[$k]);\n\treturn array_unique($a);\n}",
"function get_duplicates( $array ) {\r\n return array_unique( array_diff_assoc( $array, array_unique( $array ) ) );\r\n}",
"private function array_not_unique($raw_array) {\n\n$dupes = array();\nnatcasesort($raw_array);\nreset($raw_array);\n\n$old_key = NULL;\n$old_value = NULL;\n\nforeach ($raw_array as $key => $value) {\n\nif ($value === NULL) {\ncontinue;\n}\n\nif (strcasecmp($old_value, $value) === 0) {\n$dupes[$old_key] = $old_value;\n$dupes[$key] = $value;\n}\n$old_value = $value;\n$old_key = $key;\n}\n\nreturn $dupes;\t\n\n}",
"function contains_duplicates(array $array) : bool\n {\n return (count(array_unique($array)) < count($array));\n }",
"public static function getDuplicates(array $array) {\n return array_unique(array_diff_assoc($array, array_unique($array)));\n }",
"function check_unique_array($array) {\n return array_unique($array) == $array;\n}",
"function duplication(Array $array) {\n if (empty($array)) {\n return FALSE;\n }\n $tmp = $array;\n foreach ($array as $key => $val) {\n unset($tmp[ $key ]);\n if (in_array($val, $tmp)) {\n return $val;\n }\n }\n\n return 'no duplicate numbers.';\n}",
"public function testGetArrayDuplicateValues()\n {\n $arr[] = 1;\n $arr[] = 'barca bianca';\n $arr[] = 'barca';\n $arr[] = 2;\n $arr[] = 1;\n $arr[] = 'barca bianca';\n $arr[] = true;\n $arr[] = 'barca';\n $arr[] = 'cipolla';\n $arr[] = 'gatto';\n\n\n $this->assertEquals('1 barca bianca barca', self::$utArr->getArrayDuplicateValues($arr));\n }",
"public static function unique (&$arr)\n {\n //first step make sure all the elements are unique\n $new = array();\n \n foreach ($arr as $current)\n {\n if (\n //if the new array is empty\n //just put the element in the array\n empty($new) || \n (\n //if it is not an instance of a DOMNode\n //no need to check for isSameNode\n !($current instanceof DOMNode) && \n !in_array($current, $new)\n ) || \n //do DOMNode test on array\n self::inArray($current, $new) < 0\n )\n {\n $new[] = $current;\n }\n }\n \n return $new;\n }",
"public function hasDuplicates($array)\n {\n return count($array) !== count(array_unique($array));\n }",
"public function noDuplicates();",
"public function unique() {\n\t\treturn LINQ::Arr(array_unique($this->array));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is the given name is use by a page? If the `multilang` option is used, it checks if the page name exists in any language. IF the `language` option is used, it only checks that particular language (regardless of `multilang` option). pwgroupinformational | public function pageNameExists($name, array $options = array()) {
$defaults = array(
'page' => null,
'parent' => null,
'language' => null,
'multilang' => false,
);
$options = array_merge($defaults, $options);
$languages = $options['multilang'] || $options['language'] ? $this->wire('languages') : null;
if($languages && !$this->wire('modules')->isInstalled('LanguageSupportPageNames')) $languages = null;
if($this->wire('config')->pageNameCharset == 'UTF8') {
$name = $this->wire('sanitizer')->pageName($name, Sanitizer::toAscii);
}
$wheres = array();
$binds = array();
$parentID = $options['parent'] === null ? null : (int) "$options[parent]";
$pageID = $options['page'] === null ? null : (int) "$options[page]";
if($languages) {
foreach($languages as $language) {
if($options['language'] && "$options[language]" !== "$language") continue;
$property = $language->isDefault() ? "name" : "name" . (int) $language->id;
$wheres[] = "$property=:$property";
$binds[":$property"] = $name;
}
$wheres = array('(' . implode(' OR ', $wheres) . ')');
} else {
$wheres[] = 'name=:name';
$binds[':name'] = $name;
}
if($parentID) {
$wheres[] = 'parent_id=:parent_id';
$binds[':parent_id'] = $parentID;
}
if($pageID) {
$wheres[] = 'id!=:id';
$binds[':id'] = $pageID;
}
$sql = 'SELECT COUNT(*) FROM pages WHERE ' . implode(' AND ', $wheres);
$query = $this->wire('database')->prepare($sql);
foreach($binds as $key => $value) {
$query->bindValue($key, $value);
}
$query->execute();
$qty = (int) $query->fetchColumn();
$query->closeCursor();
return $qty;
} | [
"function language_name_exist($language_name){\n\t\t\t\n\t\t\t$sql = 'SELECT count(*) FROM tams_languages WHERE language_name = \"'.$language_name.'\";';\n\t\t\t//echo $sql;\n\t\t\t$language_name_exists = DB::queryFirstField($sql);\n\t\t\t\n\t\t\t\tif ($language_name_exists > 0){\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t}",
"private function isLanguageNameValid($name)\n {\n return array_key_exists($name, $this->getLanguages());\n }",
"public function chkPageName($page_name_input){\n if($page_name_input == 'assets' || $page_name_input == 'cszcms' ||\n $page_name_input == 'install' || $page_name_input == 'photo' ||\n $page_name_input == 'system' || $page_name_input == 'templates' || \n $page_name_input == 'search' || $page_name_input == 'admin' || \n $page_name_input == 'ci_session' || $page_name_input == 'member' || \n $page_name_input == 'plugin' || $page_name_input == 'link' || $page_name_input == 'banner') {\n return 'pages_'.$page_name_input;\n } else{\n return $page_name_input;\n }\n }",
"function CPT_text_name_exists( $p_name, $p_project_id = ALL_PROJECTS ) {\n\t$t_all = plugin_config_get( 'CPT_texts', array(), ALL_USERS, $p_project_id );\n\treturn isset( $t_all[$p_name] );\n}",
"public function is_page($name = '') {\r\n global $pagenow;\r\n $page = array();\r\n //make sure we are on the backend\r\n if (is_admin() && $name <> '') {\r\n if ($name == 'edit') {\r\n $page = array('post.php', 'post-new.php');\r\n } else {\r\n array_push($page, $name . '.php');\r\n }\r\n\r\n return in_array($pagenow, $page);\r\n }\r\n\r\n return false;\r\n }",
"abstract protected function imageTranslationExists($imageName, $language);",
"public static function check($_name)\n\t{\n\t\tif(array_key_exists($_name, self::$country))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function hasLanguage() : bool;",
"function get_page_info($name) {\n\tif(isset(extra()->page[$name])) {\n\t\treturn extra()->page[$name];\n\t} else { return false; }\n}",
"public function hasLanguage(): bool;",
"function lang_exist(string $name = '', bool $system = false): bool\n {\n return file_exists(lang_path($name, $system));\n }",
"public function isNameAvailable($title) { \n\t\tif ($this->_id === null)\n\t\t\t \t\n\t\t$result = DataBase::query(\n\t\t\t\"SELECT language.id \".\n\t\t\t\"FROM \".DataBase::formTableName('Premanager', 'Languages').\" AS language \".\n\t\t\t\"WHERE language.name = '\".DataBase::escape(Strings::unitize($name).\"' \").\n\t\t\t\t\"AND language.id != '$this->_id'\");\n\t\treturn !$result->next();\n\t}",
"function unique_name($name_to_check) {\n \t\t\tglobal $db;\n \t\t\t$sql = \"SELECT page_id\n \t\t\t\t\tFROM \" . CUSTOM_PAGES_TABLE . \"\n \t\t\t\t\tWHERE page_name = '$name_to_check'\";\n \t\t\t$result = $db->sql_query($sql);\n \t\t\t$row = $db->sql_fetchrow($result);\n \t\t\tif ( intval($row['page_id']) > 0 ) {\n \t\t\t\treturn false;\n \t\t\t} else {\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\treturn false;\n\t}",
"public function isMultiLanguage();",
"public static function _isPageTranslation()\n {\n return (strtolower($_GET['cmdClass'] == 'ilobjlanguageextgui') and $_GET['view_mode'] == \"translate\");\n }",
"function wck_cfc_check_group_name_exists( $name ){\n\n\t$wck_meta_boxes_ids = get_option( 'wck_meta_boxes_ids', array() );\n\n\tif( !empty( $wck_meta_boxes_ids ) ){\n\t\tforeach( $wck_meta_boxes_ids as $wck_meta_boxes_id ){\n\t\t\t$wck_cfc_args = get_post_meta( $wck_meta_boxes_id, 'wck_cfc_args', true );\n\t\t\tif( !empty( $wck_cfc_args ) ){\n\t\t\t\t/* make sure we compare them as slugs */\n\t\t\t\tif( Wordpress_Creation_Kit::wck_generate_slug( $wck_cfc_args[0]['meta-name'] ) == Wordpress_Creation_Kit::wck_generate_slug( $name ) ){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}",
"function language_exists($language)\r\n\t{\r\n\t\t$language = preg_replace(\"#[^a-z0-9\\-_]#i\", \"\", $language);\r\n\t\tif(file_exists($this->path.\"/\".$language.\".php\"))\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"function check_site_text_custom($page,$name)\n\t{\n\t\n\t$check=sql_query (\"select custom from site_text where page='$page' and name='$name'\");\n\tif (isset($check[0][\"custom\"])){return $check[0][\"custom\"];}\n\t}",
"public static function staticIsNameAvailable($name) { \t\n\t\treturn DataBaseHelper::isNameAvailable('Blog_Articles', 'articleID',\n\t\t\t(string) $name);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a DelegateEntity instance. | public function createObject(array $data = null)
{
return new DelegateEntity($data);
} | [
"public static function createEntity();",
"public function createEntity();",
"protected function create()\n {\n return new $this->entityClass();\n }",
"public function newEntityInstance();",
"public function create() {\n $entity = new stdClass();\n $entity->tid = 0; // Transaction-ID\n $entity->rid = 0; // Recipient-ID\n $entity->sid = 0; // Sender-ID\n $entity->iid = 0; // Initiator-ID\n $entity->amount = 0; // Amount... d'uh\n $entity->tstamp = 0; // Timestamp \n $entity->txt = null; // Transaction-Text\n $entity->ttype = 0; // Transaction-Type (taxonomy reference)\n $entity->signature = null; // The transaction-checksum\n $entity->balance = 0; // The recipient's balance after a successful transaction\n\n $entity->counter = TRUE; // Whether we need a counter-transaction (false = adjustment)\n $entity->signature_ok = FALSE; // I'm not a very trusting soul...\n return $entity;\n }",
"public function createDoctrineObject()\n {\n $config = new Configuration();\n $config->setEntityNamespaces(array('Entities' => 'App\\Entity'));\n $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver(array(),false));\n $config->setQueryCacheImpl(new ArrayCache());\n $config->setMetadataCacheImpl(new ArrayCache());\n $config->setProxyDir(\"data/proxy\");\n $config->setProxyNamespace(\"App\\Data\\Proxy\");\n $connectionParams = array(\n 'url' => getenv('DATABASE_URL')\n );\n\n return EntityManager::create($connectionParams,$config);\n }",
"public function newEntity(): Entity\n {\n $entity = new $this->entityClass();\n $entity->setEntitySet($this);\n\n return $entity;\n }",
"public function createEntity(): Entity\n {\n return new Entity(\n $this->team->id,\n $this->create()\n );\n }",
"public static function create(AssociativeArray $config)\n {\n // Start of user code EntityMapping.create\n if(!$config->has('entity')) {\n throw new \\InvalidArgumentException('No Entity specified');\n }\n $entityName = $config->get('entity');\n if(!class_exists($entityName)) {\n throw new \\InvalidArgumentException(\n sprintf('The Entity \"%s\" doesn\\'t exist', $entityName)\n );\n } \n \n if(!$config->has('datasource')) {\n throw new \\InvalidArgumentException('No DataSource specified');\n }\n \n $dataSource = $config->get('datasource');\n \n if(!isset($dataSource['name'])) {\n throw new \\InvalidArgumentException('No DataSource specified');\n }\n \n if(!DataSourcesRegistry::hasDataSource($dataSource['name'])) {\n throw new \\InvalidArgumentException(\n sprintf('The DataSource \"%s\" doesn\\'t exist', $dataSource['name'])\n );\n }\n \n if(!$config->has('attributes')) {\n throw new \\InvalidArgumentException('At least one attribute must be set');\n } \n \n $entityMapping = new self;\n $entityMapping->setEntityName($entityName);\n $entityMapping->setDataSourceName($dataSource['name']);\n\n $dataSourceClassName = get_class(\n DataSourcesRegistry::getDataSource($dataSource['name'])\n );\n \n $dataSourceEntityMappingConfigurationClassName \n = $dataSourceClassName::getEntityMappingConfigurationClassName()\n ; \n \n $entityMapping->setDataSourceEntityConfiguration( \n $dataSourceEntityMappingConfigurationClassName::create(\n AssociativeArray::createFromNativeArray(null, $dataSource)\n )\n );\n \n $dataSourceAttributeMappingConfigurationClassName\n = $dataSourceClassName::getAttributeMappingConfigurationClassName()\n ; \n \n foreach($config->get('attributes') as $attributeName => $attributeConf) {\n \n if(!isset($attributeConf['type'])) {\n throw new \\InvalidArgumentException(\n sprintf('No type set for attribute \\'%s\\'', $attributeName)\n );\n }\n \n if(isset($attributeConf['isIdentifier'])) {\n $isIdentifier = $attributeConf['isIdentifier'];\n unset($attributeConf['isIdentifier']);\n }\n else {\n $isIdentifier = false;\n }\n \n $attributeType = $attributeConf['type'];\n unset($attributeConf['type']);\n\n $attributeValidationRules = array();\n if (isset($attributeConf['validationRules'])) {\n foreach ($attributeConf['validationRules'] as $validationRuleConf) {\n array_push(\n $attributeValidationRules, \n ValidationRule::create(\n AssociativeArray::createFromNativeArray(\n null, \n $validationRuleConf\n )\n )\n );\n }\n unset($attributeConf['validationRules']);\n } \n \n $attributeMapping = AttributeMapping::create(\n AssociativeArray::createFromNativeArray(\n null, \n array(\n 'name' => $attributeName,\n 'type' => AssociativeArray::createFromNativeArray(\n null, \n $attributeType\n ), \n 'isIdentifier' => $isIdentifier, \n 'dataSourceAttributeMappingConfiguration' \n => $dataSourceAttributeMappingConfigurationClassName::create(\n AssociativeArray::createFromNativeArray(\n null, \n $attributeConf\n )\n ) \n ,\n 'validationRules' => $attributeValidationRules\n )\n )\n );\n \n $entityMapping\n ->getAttributeMappings()\n ->set($attributeName, $attributeMapping)\n ;\n }\n // End of user code\n \n return $entityMapping;\n }",
"abstract function create(EntityInterface $entity);",
"public static function get_entity_factory() : entity_factory {\n return new entity_factory();\n }",
"public function createEvent()\n {\n $entityClass = 'MU\\\\YourCityModule\\\\Entity\\\\EventEntity';\n\n $entity = new $entityClass();\n\n $this->entityInitialiser->initEvent($entity);\n\n return $entity;\n }",
"protected function getNewEntity()\n {\n $datatable = $this->getDatatable();\n $entity = $this->getMetadata($datatable->getEntity())->getName();\n\n return new $entity;\n }",
"public function create()\n {\n $classNamespace = $this->getEntityNamespace();\n $state = new $classNamespace();\n\n return $state;\n }",
"public function getEntity() {\n $name = $this->_getEntityName();\n return new $name(null, $this->getConnection());\n }",
"public static function create(){\n\t\t$isDevMode = true;\n\t\t$metadata = Setup::createAnnotationMetadataConfiguration([\n\t\t\t__DIR__ . '/../Entity'], $isDevMode);\n\n\t\t$dbParams = [\n\t\t\t'driver' => 'pdo_mysql',\n\t\t\t'host' => 'localhost',\n\t\t\t'user' => 'jurgen',\n\t\t\t'password' => 'qwerty',\n\t\t\t'dbname' => 'doctrineorm',\n\t\t\t'charset' => 'utf8'\n\t\t];\n\n\t\treturn EntityManager::create($dbParams, $metadata);\n\t}",
"public function create(): DomainRecordInterface;",
"public function createEntity($entity): AbstractNLUEntity\n {\n return new LuisEntity($entity, $this->getQuery());\n }",
"public function make()\n {\n $fullyQualifedClassName = __NAMESPACE__ . '\\\\' . $this->domainObjectClass;\n\n return new $fullyQualifedClassName;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Install the MageBridge component | protected function installMageBridge()
{
if(!is_dir(JPATH_BASE.'/components/com_magebridge')) {
$this->feedback('Downloading MageBridge component');
$file = 'com_magebridge_j25.zip';
$url = 'http://api.yireo.com/key,'.mbSupportKey.'/domain,'.mbSupportDomain.'/resource,download/request,'.$file;
$this->downloadFile($url, JPATH_BASE.'/tmp/com_magebridge.zip');
jimport('joomla.application.component.model');
jimport('joomla.installer.installer');
jimport('joomla.installer.helper');
$this->feedback('Unpacking MageBridge component');
$package = JInstallerHelper::unpack(JPATH_BASE.'/tmp/com_magebridge.zip');
$this->feedback('Installing MageBridge component');
$installer = JInstaller::getInstance();
$installer->install($package['dir']);
@JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
}
if(!is_dir(JPATH_BASE.'/components/com_magebridge')) {
die('No components/com_magebridge after installing');
}
} | [
"function install () {\n\n }",
"public function install() {}",
"abstract public function install($bundle);",
"function suppliesnetwork_install($db)\n{\n global $vendor_product_fields;\n\n require_once 'catalogconfig-common.php';\n require_once '../admin/office-common.php';\n\n if (! add_catalog_fields($db,'products','specs',$vendor_product_fields))\n return;\n}",
"function install( $parent )\n\t{\n\t\techo '\n\t\t<div class=\"alert alert-success\" style=\"margin:8px 0px 8px 0px;\">'\n\t\t\t. JText::_('COM_FLEXICONTENT_INSTALLING') . ' '\n\t\t\t//. JText::_('COM_FLEXICONTENT_VERSION')\n\t\t\t. ' <span class=\"badge bg-success badge-success\">'.$this->release.'</span>\n\t\t</div>';\n\n\t\tif ( ! $this->do_extra( $parent ) ) return false; // Abort installation\n\n\t\t// You can have the backend jump directly to the newly installed component configuration page\n\t\t// $parent->getParent()->setRedirectURL('index.php?option=com_flexicontent');\n\t}",
"function com_install() {\n\tglobal $mosConfig_absolute_path;\n\t@mkdir($mosConfig_absolute_path . '/mambots/ajax');\n}",
"protected function configMageBridge()\n {\n // Configuring MageBridge values\n $this->feedback('Configuring MageBridge component');\n $this->mbConfigure('supportkey', mbSupportKey);\n $this->mbConfigure('host', mbApiHost);\n $this->mbConfigure('basedir', mbApiBasedir);\n $this->mbConfigure('api_user', mbApiUsername);\n $this->mbConfigure('api_key', mbApiPassword);\n $this->mbConfigure('website', 1);\n if(mbTemplatePatch == 1) {\n $this->mbConfigure('disable_css_all', 1);\n $this->mbConfigure('disable_default_css', 0);\n }\n }",
"public function install_module_register()\n {\n $this->EE->db->insert('modules', array(\n 'has_cp_backend' => 'y',\n 'has_publish_fields' => 'n',\n 'module_name' => ucfirst($this->get_package_name()),\n 'module_version' => $this->get_package_version()\n ));\n }",
"public function distro_install()\n {\n JRequest::checkToken('post') or jexit(JText::_('JINVALID_TOKEN'));\n \n $model = $this->getModel('install');\n \n echo json_encode($model->distro_install());\n \n JFactory::getApplication()->close();\n }",
"function orderly_install()\n{\n}",
"public function ___install() {\n $url = \"https://github.com/BernhardBaumrock/AdminThemeUikit/archive/master.zip\";\n\n require_once($this->config->paths->modules . \"Process/ProcessModule/ProcessModuleInstall.php\");\n $install = $this->wire(new ProcessModuleInstall());\n $install->downloadModule($url);\n $this->modules->install(\"AdminThemeUikit\");\n $this->modules->duplicates()->setUseDuplicate(\"AdminThemeUikit\", \"/site/modules/AdminThemeUikit/AdminThemeUikit.module\");\n $this->modules->refresh();\n\n // copy theme to assets folder\n $path = $this->config->paths->assets . $this->className;\n $this->files->copy(__DIR__ . \"/assets\", $path);\n\n $module = $this->modules->get(\"AdminThemeUikit\");\n $config = $this->modules->getModuleConfigData($module);\n $config['cssURL'] = \"/site/assets/RockSkinUikit/theme.less\";\n $config['logoURL'] = \"/site/assets/RockSkinUikit/processwire.svg\";\n $this->modules->saveConfig($module, $config);\n }",
"public function install() {\n $installed = $this->_model->getInstalled();\n $rewrite = $this->_model->getRewrite();\n\n if (!$installed || $rewrite) {\n $this->_createExtensionMainFolder();\n $this->_createExtensionBaseFolders();\n $this->_createModulesConfigFile();\n $this->_createExtensionBaseFiles();\n }\n }",
"public function install()\n {\n $this->trigger(self::EVENT_MODULE_INSTALLED);\n }",
"public function install() {\n\t\t$pkg = parent::install();\n\n\t\t/**\n\t\t * Install Block Types\n\t\t */\n\t\t$block_type = BlockType::getByHandle('area_from_another_mother');\n\t\tif(!is_object($block_type)) {\n\t\t\tBlockType::installBlockTypeFromPackage(\n\t\t\t\t'area_from_another_mother',\n\t\t\t\t$pkg\n\t\t\t);\n\t\t}\n\t}",
"public function install_and_activate_addons()\n {\n }",
"abstract public function onInstall();",
"protected function otherInstall() {\r\n }",
"public static function install()\n {\n if (!file_exists(self::getConfigName())) {\n\n $defaultConfig = new \\Zend_Config_Xml(PIMCORE_PLUGINS_PATH . self::SAMPLE_CONFIG_XML);\n $configWriter = new \\Zend_Config_Writer_Xml();\n $configWriter->setConfig($defaultConfig);\n $configWriter->write(self::getConfigName());\n }\n\n $config = new \\Zend_Config_Xml(self::getConfigName(), null, array('allowModifications' => true));\n $config->librato->installed = 1;\n\n $configWriter = new \\Zend_Config_Writer_Xml();\n $configWriter->setConfig($config);\n $configWriter->write(self::getConfigName());\n\n if (self::isInstalled()) {\n return \"Successfully installed.\";\n } else {\n return \"Could not be installed\";\n }\n }",
"public function install()\n\t{\n\t\t$EE =& get_instance();\n\t\t$data = array(\n\t\t\t'module_name' => ucfirst($this->addon_id),\n\t\t\t'module_version' => $this->version,\n\t\t\t'has_cp_backend' => ($this->has_cp_backend) ? \"y\" : \"n\",\n\t\t\t'has_publish_fields' => ($this->has_publish_fields) ? \"y\" : \"n\"\n\t\t);\n\n\t\t$EE->db->insert('modules', $data);\n\n\t\tif(isset($this->actions) && is_array($this->actions))\n\t\t{\n\t\t\tforeach ($this->actions as $action)\n\t\t\t{\n\t\t\t\t$parts = explode(\"::\", $action);\n\t\t\t\t$EE->db->insert('actions', array(\n\t\t\t\t\t\"class\" => $parts[0],\n\t\t\t\t\t\"method\" => $parts[1]\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\tif($this->has_publish_fields) {\n\t\t\t$EE->load->library('layout');\n\t\t\t$EE->layout->add_layout_tabs($this->tabs(), strtolower($data['module_name']));\n\t\t}\n\t\treturn TRUE;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end createXML() Load DOM from html | private function _loadDOM()
{
$this->dom = new DOMDocument();
@$this->dom->loadHTML($this->html);
$this->xpath = new DOMXPath($this->dom);
} | [
"abstract protected function consumeDom();",
"private function parse_dom()\r\n\t{\r\n\t\t$contents = $this->acquire_contents($this->url_target);\t//get file contents\r\n\t\t$this->dom = new DOMDocument();\r\n\t\t@$this->dom->loadHTML($contents);\t//nothing display\r\n\t}",
"private function carregarHtml()\n {\n $this->html = file_get_contents($this->url);\n\n libxml_use_internal_errors(true);\n\n //transforma o html em objeto\n $this->dom->loadHTML($this->html);\n libxml_clear_errors();\n }",
"protected function loadDomDocument()\n {\n $this->doc = new DomDocument();\n $this->doc->formatOutput = true;\n $this->doc->loadHtml(\n mb_convert_encoding($this->html, 'HTML-ENTITIES', 'UTF-8'),\n LIBXML_HTML_NODEFDTD\n );\n }",
"private function parse_dom()\n\t{\n\t\t$contents = $this->acquire_contents($this->url_target);\t//get file contents\n\t\t$this->dom = new DOMDocument();\n\t\t@$this->dom->loadHTML($contents);\t//nothing display\n\t\treturn $this->dom;\n\t}",
"public function loadHTML();",
"abstract protected function createDOMDocument(string $html, $libXMLExtraOptions = null): \\DOMDocument;",
"public function loadHtml()\n\t {\n\t\t$http = new HTTPclient($this->link, [], $this->headers);\n\t\tif ($this->proxy === true)\n\t\t {\n\t\t\t$this->html = $http->getWithProxy();\n\t\t }\n\t\telse\n\t\t {\n\t\t\t$this->html = $http->get();\n\t\t } //end if\n\n\t\tif ($this->gzdecode === true)\n\t\t {\n\t\t\t$this->html = gzdecode($this->html);\n\t\t } //end if\n\n\t\t$this->_xml->newElement(\"html\", base64_encode($this->html));\n\t\t$this->doc = $this->_xml->getDoc();\n\t }",
"public function createDOM($url){\n if(!is_null($this->dom)) { \n $this->dom->clear();\n unset($this->dom); \n }\n \n $this->url = $url;\n $this->dom = new simple_html_dom();\n \n // Using cURL\n $html_source = get_html($url);\n $this->dom->load($html_source);\n }",
"function parse_dom($html) { \n return get_dom_tree($html); //domparser.php\n}",
"abstract public function getDomObject();",
"protected function _domFromBody()\r\n\t{\r\n\t\t$this->_dom = Art_DOM::loadDOMFromString($this->_body);\r\n\t}",
"static function loadDOMFromString( $dom )\n\t{\n\t\t$document = new Art_Model_DOMDocument();\n\t\tlibxml_use_internal_errors(true);\n\t\t@$document->loadHTML($dom);\n\t\tlibxml_use_internal_errors(false);\n\n\t\treturn $document;\n\t}",
"abstract protected function loadDom(\\DOMElement $dom, array $options = []);",
"private function createDOMDocument($html)\n {\n if (strpos($html, '<') === false) {\n $this->isDOMDocumentCreatedWithoutHtml = true;\n }\n\n if (strpos($html, '<html') === false) {\n $this->isDOMDocumentCreatedWithoutHtmlWrapper = true;\n }\n\n // set error level\n $internalErrors = libxml_use_internal_errors(true);\n $disableEntityLoader = libxml_disable_entity_loader(true);\n\n $sxe = simplexml_load_string($html);\n if (count(libxml_get_errors()) === 0) {\n $this->document = dom_import_simplexml($sxe)->ownerDocument;\n } else {\n $this->document->loadHTML('<?xml encoding=\"' . $this->getEncoding() . '\">' . $html);\n\n // remove the \"xml-encoding\" hack\n foreach ($this->document->childNodes as $child) {\n if ($child->nodeType == XML_PI_NODE) {\n $this->document->removeChild($child);\n }\n }\n\n libxml_clear_errors();\n }\n\n // set encoding\n $this->document->encoding = $this->getEncoding();\n\n // restore lib-xml settings\n libxml_use_internal_errors($internalErrors);\n libxml_disable_entity_loader($disableEntityLoader);\n\n return $this->document;\n }",
"public function parseHtmlDom( simple_html_dom $html ) {\n \n }",
"public static function getDom($html = '') {\n $p = self::getInstance();\n $dom = new \\DOMDocument('1.0', 'UTF-8');\n $dom->validateOnParse = true;\n $dom->resolveExternals = true;\n $dom->preserveWhiteSpace = false;\n // Turn off XML errors.. if only it was that easy right?\n $dom->strictErrorChecking = FALSE;\n $xml_error_setting = libxml_use_internal_errors(true);\n\n // Because PJax isn't a full document, it kinda breaks DOMDocument\n // Which expects a full document! (You know with a DOCTYPE, <HTML> <BODY> etc.. )\n if (self::isPjax() &&\n (strpos($html, '<!DOCTYPE') !== 0 || strpos($html, '<html') !== 0)) {\n // Prefix the non-doctyped html snippet with an xml prefix\n // This tricks DOMDocument into loading the HTML snippet\n $xml_prefix = '<?xml encoding=\"UTF-8\" />';\n $html = $xml_prefix . $html;\n }\n\n // Convert the HTML into a DOMDocument, however, don't imply it's HTML, and don't insert a default Document Type Template\n // Note, we can't use the Options parameter until PHP 5.4 http://php.net/manual/en/domdocument.loadhtml.php\n if (! ($loaded = $dom->loadHTML($html))) {\n $p->debug_log(\"There was a problem loading the DOM.\");\n }\n else {\n $p->debug_log(\"%d chars of HTML was inserted into a DOM\", strlen($html));\n }\n libxml_use_internal_errors($xml_error_setting); // restore xml parser error handlers\n $p->debug_log('DOM Loaded.');\n return $dom;\n }",
"private function _parseHTML()\r\n {\r\n $this->_tidyHTML();\r\n $this->_domHTML = new \\DOMDocument();\r\n $this->_domHTML->preserveWhiteSpace = false;\r\n //the following option tries to recover poorly formed documents\r\n $this->_domHTML->recover = true;\r\n $this->_domHTML->preserveWhiteSpace = true;\r\n $this->_domHTML->formatOutput = false;\r\n $this->_domHTML->loadXML($this->_html);\r\n //if titles are to be in uppercase we have to preparse the HTML string\r\n if ($this->_titles == 'uppercase') {\r\n $this->_str = $this->_titlesToUppercase();\r\n }\r\n $root = $this->_domHTML->documentElement;\r\n $this->_parseHTMLNode($root);\r\n }",
"static function create()\n {\n include_once \"classes/DOMElement.php\";\n header(\"Content-type: text/html;charset=utf-8\");\n $domimpl=new DOMImplementation();\n $doctype=$domimpl->createDocumentType(\"html\");\n $dom=$domimpl->createDocument(\n \"http://www.w3.org/1999/xhtml\", \"html\", $doctype\n );\n $dom->registerNodeClass(\"DOMElement\", \"NewDOMElement\");\n $dom->html=$dom->documentElement;\n $dom->head=$dom->createElement(\"head\");\n $dom->body=$dom->createElement(\"body\");\n $dom->html->appendChild($dom->head);\n $dom->html->appendChild($dom->body);\n return $dom;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ generaCadenaURL Combina datos para entregar URL de Registro | public function generaCadenaURL(LbUsuarios $usuario)
{
//Cantidad de caracteres del mail
$caracEmail = strlen($usuario->getTxusuemail());
//Arreglo de caractéres email
if ($caracEmail > 99) {
$arCarMail[0] = floor($caracEmail / 100);
} else {
$arCarMail[0] = 0;
}
if ($caracEmail > 99) {
$arCarMail[1] = floor(($caracEmail-($arCarMail[0] * 100)) / 10);
} else {
$arCarMail[1] = floor($caracEmail / 10);
}
if ($caracEmail > 9) {
$arCarMail[2] = floor($caracEmail-(($arCarMail[0].$arCarMail[1])*10));
} else {
$arCarMail[2] = $caracEmail;
}
//echo "\nCaracteres Mail: ".$caracEmail;
//echo "\nCar Mail 0: ".$arCarMail[0];
//echo "\nCar Mail 1: ".$arCarMail[1];
//echo "\nCar Mail 2: ".$arCarMail[2];
//email
$email = $usuario->getTxusuemail();
//Inicializa la cadena
$cadena = $usuario->gettxusuvalidacion();
//echo 'arreglo: '.$arCarMail[0].'-'.$arCarMail[1].'-'.$arCarMail[2].'carac email: '.$caracEmail.' - valida: '.$cadena;
//Obtener el patron de ocurrencia de datos
$patron[0] = rand(1, 3);
//echo "\nP1: ".$patron[0];
$patron[1] = rand(1, 2);
//echo "\nP2: ".$patron[1];
$patron[2] = rand(1, 3);
//echo "\nP3: ".$patron[2];
$cadena = substr($cadena, 0, self::pos1mail).$arCarMail[0].$patron[0].$arCarMail[1].$patron[1]
.$arCarMail[2].$patron[2].substr($cadena,2);
//echo "\ncon patron: ".$cadena;
/*for ($n=0;$n<$caracEmail;$n++) {
$posClave[] = $patron[$pat]+7;
}*/
$pat = 0;
for ($n=0;$n<$caracEmail;$n++) {
if ($n==0) {
$posClave[$n] = $patron[$pat]+8;
} else {
$posClave[$n] = $posClave[$n-1]+$patron[$pat];
}
//echo 'posicion: '.$posClave[$n];
if ($pat==2) { $pat = 0; } else { $pat++; }
}
for($i=0;$i<$caracEmail;$i++) {
$complem = substr($cadena, $posClave[$i]);
//echo " \n ".$complem;
$cadena = substr($cadena, 0, $posClave[$i]).substr($email,$i,1).$complem;
//echo " \n ".$cadena;
}
//echo "\n cadena_def: ".$cadena;
return $cadena;
} | [
"function _interia_prepare_url() {\n\t\tglobal $mdbd;\n\t\tglobal $config;\n\t\t\n\t\t$data=$mdbd->select(\"partner_id,name\",\"partners\",\"name=?\",array($this->_partner_name=>\"string\"));\t\n $partner_id=$data['partner_id'];\n\t\t$code=md5(\"partner_id.$partner_id.$config->salt\"); // wygenerowanie kodu kontrolnego\n $link=\"&partner_id=\".$partner_id.\"&code=\".$code; // budowanie linku\n\t\t$this->soap->chars_to_xml($link); \n return $link;\n\t}",
"public function createUrl();",
"public function generateRegisterUrl();",
"function generateUrl($nomefile){\n return 'http://'.$_SERVER['HTTP_HOST'].'/foto/'.$nomefile;\n}",
"public function getUrlCielo(){\n if($this->getErro()){\n return null;\n } else {\n return 'https://comercio.locaweb.com.br/comercio.comp';\n }\n }",
"public function getURLPageConnexion () {\n return Routeur::creerURL(\"connexion\");\n }",
"private function _calculateUrl()\n {\n $urlParts = array(\n $this->Marca->nome,\n $this->modelo,\n $this->placa,\n );\n\n $url = App_String::arrayToUrl($urlParts);\n $url = trim($url, '/');\n $this->_set('url', $url);\n }",
"function generate_detail_hotel_url($nCou, $nCity, $nData, $nTab = \"\")\n{\n global $con_mod_rewrite;\n $nCou = replace_rewrite_url($nCou, \"_\");\n $nCity = replace_rewrite_url($nCity, \"_\");\n $nData = replace_rewrite_url($nData, \"-\");\n $nTab = replace_rewrite_url($nTab, \"-\");\n\n $link = lang_path();\n if ($con_mod_rewrite == 0) {\n $link .= \"detail_hotel.php?nData=\" . $nData;\n if ($nTab != \"\") $link .= \"&nTab=\" . $nTab;\n } else {\n if ($nTab != \"\") $link .= $nCou . \"/\" . $nCity . \"/\" . $nData . \"/\" . $nTab . \".hhtml\";\n else $link .= $nCou . \"/\" . $nCity . \"/\" . $nData . \".hhtml\";\n }\n return $link;\n}",
"public function generate_url()\n {\n }",
"private function createUrl(): string\n {\n return $this->url . $this->options;\n }",
"function acaoGetDeletar() {\n deletaRegistro($_GET[CODIGO]);\n alteraUrl();\n}",
"function get_request_url() {\n $endpoint = $this->get_endpoint();\n\n $razon_may = mb_strtoupper($_GET['razon'], 'UTF-8');\n $urlcuit = strlen($_GET['cuit']) >= 11 ? '?cuit='. str_replace(' ', '+', $_GET['cuit']) : ' ';\n $urlrazon_social = strlen($razon_may) >= 3 ? '?razon_social='. $razon_may : ' ';\n $urlconsulta = strlen($_GET['razon']) == 0 ? $endpoint . $urlcuit : $endpoint . $urlrazon_social ;\n\n return $urlconsulta;\n\n }",
"abstract public function getRegisterUrl();",
"function elaborar_url($URL)\r\n\t{\t\r\n\t\t$service_params = \"\";\r\n\t\t$query_params = \"\";\r\n\t\t\r\n\t\tif ($this->site != \"\") \t\t\t\t\t\t\t\t\t//TODO: validar url\r\n\t\t{\r\n\t\t\t$query_params .= \" site:\".$this->site;\t\t\t\r\n\t\t}\r\n\t\tif ($this->intitle != \"\") \r\n\t\t{\r\n\t\t\t$query_params .= \" intitle:\".$this->intitle;\t\t\t\r\n\t\t}\r\n\t\tif ($this->inurl != \"\") \r\n\t\t{\r\n\t\t\t$query_params .= \" inurl:\".$this->inurl;\t\t\t\t\r\n\t\t}\r\n\t\tif ($this->filetype != \"\") \r\n\t\t{\r\n\t\t\t$query_params .= \" filetype:\".$this->filetype;\r\n\t\t}\r\n\t\tif ($this->excluidos != \"\") \r\n\t\t{\r\n\t\t\t$query_params .= \" -\".$this->excluidos;\t\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$service_params .= \"?i=\".$this->resultado_inicial.\"&n=\".$this->resultados_por_pagina;\r\n\t\t\r\n\t\t$out = $URL.urlencode($this->query.$query_params).$service_params;\r\n\t\t\r\n\t\t\r\n\t\treturn $out;\r\n\t}",
"public function textoUrl($cadena) {\n\t\t$limitePalabras = 50;\n\t\t// Elimina espacios al princio y al final\n\t\t$cadena = trim($cadena);\n\t\t// Elimina tags\n\t\t$cadena = strip_tags($cadena);\n\t\t// Pasar a minusculas\n\t\t$cadena = mb_strtolower($cadena);\n\t\t// Elimina caracteres extraños\n\t\t$eliminar = array('!','¡','?','¿','‘','’','“','”','\"','$','(',')','.',':',',',';','_','-','\\'','/','\\\\','$','%','@','#','*','«', '»','[',']','{','}','<','>','+','|','~','&','`','^','=');\n\t\t$cadena = str_replace($eliminar,'',$cadena);\n\t\t// Reemplazar acentos y ñ\n\t\t$acentos = array('á','é','í','ó','ú','Á','É','Í','Ó','Ú','ñ','Ñ','ü','à','è','ì','ò','ù','À','È','Ì','Ò','Ù');\n\t\t$reemplazo = array('a','e','i','o','u','a','e','i','o','u','n','n','u','a','e','i','o','u','A','E','I','O','U');\n\t\t$cadena = str_replace($acentos, $reemplazo, $cadena);\n\t\t// Reemplazar articulos, preposiciones y conjunciones\n\t\t$palabras = array(\n\t\t\t\t\t\t// Preposiciones\n\t\t\t\t\t\t' a ',' ante ',' bajo ',' con ',' de ',' desde ',' durante ',' en ',' entre ',' excepto ',' hacia ',' hasta ',' mediante ',' para ',' por ',' salvo ',' según ',' sin ',' sobre ',' tras ',\n\t\t\t\t\t\t// Articulos\n\t\t\t\t\t\t' un ',' unos ',' una ',' unas ',' el ',' la ',' las ',' lo ',' los ',\n\t\t\t\t\t\t// Conjunciones\n\t\t\t\t\t\t' y ',' e ',' ni ',' o ',' u ',' ya ',' pero ',' mas ',' sino ',' bien ',' ya ',' pero ',' mas ',' sino ',' luego ',' conque ',' asi ',' porque ',' pues ',' si ',' que ',' como ',' aunque ',' aun ',' que ',' no '\n\t\t\t\t\t\t);\n\t\t$cadena = str_replace($palabras, ' ', $cadena);\n\t\t// Reemplazar espacios dobles por simples\n\t\t$cadena = $this->espacios($cadena);\n\t\t// Crear un extracto si excede\n\t\tif( $this->contarPalabras($cadena) > $limitePalabras ) $cadena = $this->extracto($cadena,$limitePalabras);\n\t\t// Reemplazar espacios por guiones\n\t\t$cadena = str_replace(' ','-',$cadena);\n\t\treturn $cadena;\n\t}",
"public static function obterCaminhoWebCompleto(string $reqRelativa = '', bool $utilizarPrefixoHttp = true, bool $utilizarHost = true) : string {\n\t\treturn (($utilizarPrefixoHttp) ? 'http://' : '').(($utilizarHost) ? WEB_HOST : '').WEB_BASE.$reqRelativa;\n\t}",
"function crearEnlaceComentario($datosEspacio) {\r\n $pagina=$this->configuracion[\"host\"].$this->configuracion[\"site\"].\"/index.php?\";\r\n $variables=\"pagina=registroAgregarComentarioEspacioCoordinador\";\r\n $variables.=\"&opcion=verComentarios\";\r\n $variables.=\"&codEspacio=\".$datosEspacio[0];\r\n $variables.=\"&planEstudio=\".$this->datosPlan[12];\r\n $variables.=\"&codProyecto=\".$this->datosPlan[12];\r\n $variables.=\"&nivel=\".$this->datosPlan[2];\r\n $variables.=\"&nroCreditos=\".$datosEspacio[3];\r\n $variables.=\"&htd=\".$datosEspacio[4];\r\n $variables.=\"&htc=\".$datosEspacio[5];\r\n $variables.=\"&hta=\".$datosEspacio[6];\r\n $variables.=\"&clasificacion=\".$datosEspacio[8];\r\n $variables.=\"&nombreEspacio=\".$datosEspacio[1];\r\n $variables.=\"&nombreProyecto=\".$this->datosPlan['NOMBRE_PROYECTO_PLAN_ESTUDIO'];\r\n\r\n include_once($this->configuracion[\"raiz_documento\"].$this->configuracion[\"clases\"].\"/encriptar.class.php\");\r\n $this->cripto=new encriptar();\r\n $variables=$this->cripto->codificar_url($variables,$this->configuracion);\r\n return $pagina.$variables;\r\n\r\n }",
"function url($req, $ruta, $parametros = ''){\n if (!is_request($req))\n throw new Exception(\"Se requiere un request en url().\");\n\n $app_url = cfg($req, 'app_url');\n\n if (!empty($parametros))\n $p = \"&$parametros\";\n else\n $p = '';\n\n return \"$app_url$ruta$p\";\n}",
"public function getUrl()\n {\n return $this->empresa->urlPadrao . '/produto/' . $this->slug;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set the session error for the next refresh | function setError( $msg )
{
$this->session['error'] = $msg;
} | [
"function set_error($err)\n{\n\t$_SESSION['error'] = $err;\n}",
"function report_session_error() {\n global $CFG, $FULLME;\n\n if (empty($CFG->lang)) {\n $CFG->lang = \"en\";\n }\n // Set up default theme and locale\n theme_setup();\n moodle_setlocale();\n\n //clear session cookies\n setcookie('MoodleSession'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, $CFG->sessioncookiedomain, $CFG->cookiesecure, $CFG->cookiehttponly);\n setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, $CFG->sessioncookiedomain, $CFG->cookiesecure, $CFG->cookiehttponly);\n\n //increment database error counters\n if (isset($CFG->session_error_counter)) {\n set_config('session_error_counter', 1 + $CFG->session_error_counter);\n } else {\n set_config('session_error_counter', 1);\n }\n redirect($FULLME, get_string('sessionerroruser2', 'error'), 5);\n }",
"public function setVerifySessionFail(){\n $_SESSION[self::$VerifySessionID] = EnumStatus::$failVerification;\n }",
"function setError($error_message){\n\t$_SESSION[\"error\"] = $error_message;\n}",
"private function getSavedError() {\r\n $this->error = $this->getSaved(self::SESSION_KEY_ERROR);\r\n }",
"public function setSessionExceptionMessage()\n {\n $_SESSION[self::$message] = self::$sessionExceptionMessage;\n }",
"public function setError($message){\n\t\t$_SESSION['flash']['error'] = $message;\n\t}",
"public static function setMsgError($msg) {\n $_SESSION[self::SESSION_ERROR] = $msg;\n }",
"function setSessionMessageDatabaseError()\r\n{\r\n setSessionMsg(\"שגיאה במסד הנתונים\", 1) ;\r\n}",
"function setSessionFailedMessage($message){\n\t\t$this->session->set_userdata('failed', $message);\n\t}",
"function real_set_error($err_code) {\n//\tglobal $_err_code;\n//\t$_err_code = $err_code;\n $_SESSION['err_code'] = $err_code;\n}",
"protected function errorLogin()\n {\n $this->addModelErrorsToSession();\n $this->redirect($this->base_address.'/login'.($this->next_url?'/next/'.$this->next_url:''));\n }",
"public function set_flash_message_Error()\n {\n $_SESSION['flash_message']['error'] = $this->Message;\n header('Location: ' . $this->Location);\n }",
"function show_and_reset_error()\n{\n\techo \"<div class='error'>\";\n\techo $_SESSION['error'];\n\techo \"</div>\";\n\t\n\tunset($_SESSION['error']);\n}",
"private function _Set_object_for_session_expired(){\n $this->_response_data[\"result\"] = FALSE;\n $this->_response_data[\"redirectUrl\"] = \"./?sess_expired=true\";\n }",
"function set_error($error){\n\tdeclare_registration_errors_arr();\n\tarray_push($_SESSION['registration_errors[]'], $error);\n}",
"public function setScrapingError(): void;",
"function session_errors(){\n\t\tif(isset($_SESSION[\"errors\"])){\n\t\t\t$errors = $_SESSION[\"errors\"];\n\t\t\t$_SESSION[\"errors\"] = null;\n\t\t\treturn $errors;\n\t\t}\n\t}",
"public function testSetSessionException() {\n\t\tShopCurrencyLib::setSession('gb');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compute cofactor matrix from this one, return a new matrix instance. | public function cofactor()
{
$cofactorArray = [];
for ($c = 0; $c < $this->_cols; $c++) {
$cofactorArray[$c] = [];
for ($r = 0; $r < $this->_rows; $r++) {
if ($this->_cols == 2) {
$cofactorArray[$c][$r] = pow(-1, $c + $r) * $this->subMatrix($c, $r)[0][0];
} else {
$cofactorArray[$c][$r] = pow(-1, $c + $r) * $this->subMatrix($c, $r)->determinant();
}
}
}
return new self($cofactorArray);
} | [
"public function getCofactors(): Matrix\n {\n $this->validateDimensions($this, self::SQUARE);\n\n return $this->map(function ($cell, $x, $y) {\n return pow(-1, $x + $y) * $this->getMinors($x, $y)->determinant();\n });\n }",
"public function getAdjugate(): Matrix\n {\n return $this->getCofactors()->transpose();\n }",
"protected function cofactor($j)\r\n\t{\r\n\t $l = count($j);\r\n\t for($row=1;$row<=$l;$row++)\r\n\t {\r\n\t for($col=1;$col<=$l;$col++)\r\n\t {\r\n\t $M = $this->minor($j,$row,$col,0);\r\n\t $Det = $this->determinant($M);\r\n\t $cell = (float)($this->signcell($row+$col))*$Det;\r\n\t $ans[$row][$col]=$cell;\r\n\t }\r\n\t }\r\n\t return($ans);\r\n\t}",
"public function mCofactor($a)\n {\n $n = count($a);\n \n if ($n != count($a[1])) {\n throw new KashiException('CoFactor matrix can be calculated only for squared matrix');\n }\n\n for ($i=1; $i<=$n; $i++) {\n for ($j=1; $j<=$n; $j++) {\n if (($i+$j) % 2 == 1) {\n $b[$i][$j] = -1;\n } else {\n $b[$i][$j] = 1;\n }\n \n $c = array();\n for ($x=1; $x<=$n; $x++) {\n if ($x == $i) {\n continue;\n }\n for ($y=1; $y<=$n; $y++) {\n if ($y == $j) {\n continue;\n }\n \n if ($x < $i) {\n if ($y < $j) {\n $c[$x][$y] = $a[$x][$y];\n } else {\n $c[$x][$y-1] = $a[$x][$y];\n }\n } else {\n if ($y < $j) {\n $c[$x-1][$y] = $a[$x][$y];\n } else {\n $c[$x-1][$y-1] = $a[$x][$y];\n }\n }\n }\n }\n \n $b[$i][$j] *= $this->mDeterminant($c);\n }\n }\n \n return $b;\n }",
"public function get_matrix()\n {\n return $this->_matrix;\n }",
"public function getMatrix() { }",
"public function cholesky() : Cholesky\n {\n return Cholesky::decompose($this);\n }",
"public static function accumMatrix($src)\r\n {\r\n return matrix::accumulate($src);\r\n }",
"public function getMatrix()\n {\n\n return $this->matrix;\n\n }",
"public function conjugate()\n {\n return new Complex($this->real, -$this->imaginary);\n }",
"public function getConfusionMatrix()\n {\n return $this->confusion_matrix;\n }",
"public function getMatrix()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('matrix');\n }",
"public function conjugate()\n {\n return new self($this->float_r, -1 * $this->float_i);\n }",
"public function asColumnMatrix() : Matrix\n {\n $b = [];\n\n foreach ($this->a as $value) {\n $b[] = [$value];\n }\n\n return Matrix::quick($b);\n }",
"public function getCollegamentiMappa() {\n $fMappa = USingleton::getInstance('FMappa');\n return $fMappa->cercaCollegamentiMappa($this->getNomeMappa());\n }",
"public function covariance() : self\n {\n $b = $this->subtract($this->mean());\n\n return $b->matmul($b->transpose())\n ->divide($this->m);\n }",
"public function toCMY(){\n $cyan = ($this->cyan * (1 - $this->key) + $this->key);\n $magenta = ($this->magenta * (1 - $this->key) + $this->key);\n $yellow = ($this->yellow * (1 - $this->key) + $this->key);\n return new CMY($cyan, $magenta, $yellow);\n }",
"public function getC(int $i):Number{\n\t\t$y = $this->getY($i+1);\n\t\t$d = $this->getD($i);\n\t\t$h = $this->getH($i);\n\t\t$number =$y->add($d->negate())->mul($h->reciprocal()); //(y_(i+1) - d_i)/h_i\n\t\treturn $number->add($this->getH($i)->mul(new RationalNumber(1, 6))->mul($this->getM($i+1))->negate()); // - h_i/6 (M_(i+1)\n\n\t}",
"public function getCoef()\n {\n return $this->_coef;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the id_profile column Example usage: $query>filterByIdProfile(1234); // WHERE id_profile = 1234 $query>filterByIdProfile(array(12, 34)); // WHERE id_profile IN (12, 34) $query>filterByIdProfile(array('min' => 12)); // WHERE id_profile > 12 | public function filterByIdProfile($idProfile = null, $comparison = null)
{
if (is_array($idProfile)) {
$useMinMax = false;
if (isset($idProfile['min'])) {
$this->addUsingAlias(Oops_Db_EmployeePeer::ID_PROFILE, $idProfile['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($idProfile['max'])) {
$this->addUsingAlias(Oops_Db_EmployeePeer::ID_PROFILE, $idProfile['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(Oops_Db_EmployeePeer::ID_PROFILE, $idProfile, $comparison);
} | [
"public function filterByProfileId($profileId = null, $comparison = null)\n {\n if (is_array($profileId)) {\n $useMinMax = false;\n if (isset($profileId['min'])) {\n $this->addUsingAlias(GiveTableMap::COL_PROFILE_ID, $profileId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($profileId['max'])) {\n $this->addUsingAlias(GiveTableMap::COL_PROFILE_ID, $profileId['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(GiveTableMap::COL_PROFILE_ID, $profileId, $comparison);\n }",
"protected function _addProfileFilters($profile)\n {\n $filters = array();\n // Table prefix\n $tablePrefix = 'main_table.';\n if (Mage::helper('xtcore/utils')->mageVersionCompare(Mage::getVersion(), '1.4.0.1', '<=')) {\n $tablePrefix = '';\n }\n // Filters\n $profileFilterStoreIds = explode(\",\", $profile->getStoreIds());\n if (!empty($profileFilterStoreIds)) {\n $storeIds = array();\n foreach ($profileFilterStoreIds as $storeId) {\n if ($storeId != '0' && $storeId != '') {\n array_push($storeIds, $storeId);\n }\n }\n if (!empty($storeIds)) {\n if ($profile->getEntity() == Xtento_OrderExport_Model_Export::ENTITY_CUSTOMER) {\n $websiteIds = array();\n foreach ($storeIds as $storeId) {\n array_push($websiteIds, Mage::getModel('core/store')->load($storeId)->getWebsiteId());\n }\n $filters[] = array('website_id' => array('in' => $websiteIds));\n } else {\n $filters[] = array($tablePrefix . 'store_id' => array('in' => $storeIds));\n }\n }\n }\n $profileFilterStatus = explode(\",\", $profile->getExportFilterStatus());\n if (!empty($profileFilterStatus)) {\n $statuses = array();\n foreach ($profileFilterStatus as $status) {\n if ($status !== '') {\n array_push($statuses, $status);\n }\n }\n if (!empty($statuses)) {\n if ($profile->getEntity() == Xtento_OrderExport_Model_Export::ENTITY_ORDER) {\n $filters[] = array($tablePrefix . 'status' => array('in' => $statuses));\n } else {\n $filters[] = array($tablePrefix . 'state' => array('in' => $statuses));\n }\n }\n }\n $dateRangeFilter = array();\n $profileFilterDatefrom = $profile->getExportFilterDatefrom();\n if (!empty($profileFilterDatefrom)) {\n $dateRangeFilter['datetime'] = true;\n #$dateRangeFilter['from'] = sprintf('%s 00:00:00', $profileFilterDatefrom);\n $dateRangeFilter['from'] = Mage::helper('xtento_orderexport/date')->convertDate($profileFilterDatefrom)->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);\n #$dateRangeFilter['to']->add(1, Zend_Date::HOUR);\n }\n $profileFilterDateto = $profile->getExportFilterDateto();\n if (!empty($profileFilterDateto)) {\n $dateRangeFilter['datetime'] = true;\n #$dateRangeFilter['to'] = sprintf('%s 23:59:59', $profileFilterDateto);\n #$dateRangeFilter['to'] = Mage::helper('xtento_orderexport/date')->convertDate($profileFilterDateto, false, true);\n $dateRangeFilter['to'] = Mage::helper('xtento_orderexport/date')->convertDate($profileFilterDateto /*, false, true*/);\n $dateRangeFilter['to']->add('1', Zend_Date::DAY);\n $dateRangeFilter['to'] = $dateRangeFilter['to']->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);\n }\n $profileFilterCreatedLastXDays = $profile->getData('export_filter_last_x_days');\n if (!empty($profileFilterCreatedLastXDays) || $profileFilterCreatedLastXDays == '0') {\n $profileFilterCreatedLastXDays = intval(preg_replace('/[^0-9]/', '', $profileFilterCreatedLastXDays));\n if ($profileFilterCreatedLastXDays >= 0) {\n /*$dateToday = Mage::app()->getLocale()->date();\n $dateToday->sub($profileFilterCreatedLastXDays, Zend_Date::DAY);\n $dateRangeFilter['date'] = true;\n $dateRangeFilter['from'] = $dateToday->toString('yyyy-MM-dd 00:00:00');*/\n $dateToday = Zend_Date::now();\n $dateToday->sub($profileFilterCreatedLastXDays, Zend_Date::DAY);\n $dateToday->setHour(00);\n $dateToday->setSecond(00);\n $dateToday->setMinute(00);\n $dateToday->setLocale(Mage::getStoreConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_LOCALE));\n $dateToday->setTimezone(Mage::getStoreConfig(Mage_Core_Model_Locale::DEFAULT_TIMEZONE)); // Dates are stored in UTC\n $dateRangeFilter['datetime'] = true;\n $dateRangeFilter['from'] = $dateToday->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);\n }\n }\n $profileFilterOlderThanXMinutes = $profile->getData('export_filter_older_x_minutes');\n if (!empty($profileFilterOlderThanXMinutes)) {\n $profileFilterOlderThanXMinutes = intval(preg_replace('/[^0-9]/', '', $profileFilterOlderThanXMinutes));\n if ($profileFilterOlderThanXMinutes > 0) {\n $dateToday = Zend_Date::now();\n $dateToday->sub($profileFilterOlderThanXMinutes, Zend_Date::MINUTE);\n $dateToday->setLocale(Mage::getStoreConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_LOCALE));\n $dateToday->setTimezone(Mage::getStoreConfig(Mage_Core_Model_Locale::DEFAULT_TIMEZONE)); // Dates are stored in UTC\n $dateRangeFilter['datetime'] = true;\n $dateRangeFilter['to'] = $dateToday->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);\n }\n }\n if (!empty($dateRangeFilter)) {\n if ($profile->getEntity() == Xtento_OrderExport_Model_Export::ENTITY_CUSTOMER) {\n $filters[] = array('created_at' => $dateRangeFilter);\n } else {\n $filters[] = array($tablePrefix . 'created_at' => $dateRangeFilter);\n }\n }\n return $filters;\n }",
"public function testFilterById()\n {\n // find by single id\n $book = PropelQuery::from('Book b')\n ->where('b.Title like ?', 'Don%')\n ->orderBy('b.ISBN', 'desc')\n ->findOne();\n\n $c = BookQuery::create()->filterById($book->getId());\n\n $book2 = $c->findOne();\n\n $this->assertTrue($book2 instanceof Book);\n $this->assertEquals('Don Juan', $book2->getTitle());\n\n //find range\n $booksAll = PropelQuery::from('Book b')\n ->orderBy('b.ID', 'asc')\n ->find();\n\n $booksIn = BookQuery::create()\n ->filterById(array($booksAll[1]->getId(), $booksAll[2]->getId()))\n ->find();\n\n $this->assertTrue($booksIn[0] == $booksAll[1]);\n $this->assertTrue($booksIn[1] == $booksAll[2]);\n\n // filter by min value with greater equal\n $booksIn = null;\n\n $booksIn = BookQuery::create()\n ->filterById(\n array('min' => $booksAll[2]->getId()))\n ->find();\n\n $this->assertTrue($booksIn[1] == $booksAll[3]);\n\n // filter by max value with less equal\n $booksIn = null;\n\n $booksIn = BookQuery::create()\n ->filterById(\n array('max' => $booksAll[1]->getId()) )\n ->find();\n\n $this->assertTrue($booksIn[1] == $booksAll[1]);\n\n // check backwards compatibility:\n // SELECT FROM `book` WHERE book.id IN (:p1,:p2)\n // must be the same as\n // SELECT FROM `book` WHERE (book.id>=:p1 AND book.id<=:p2)\n\n $minMax = BookQuery::create()\n ->filterById(\n array('min' => $booksAll[1]->getId(),\n 'max' => $booksAll[2]->getId())\n )\n ->find();\n\n $In = BookQuery::create()\n ->filterById(\n array($booksAll[1]->getId(),\n $booksAll[2]->getId())\n )\n ->find();\n\n $this->assertTrue($minMax[0] === $In[0]);\n $this->assertTrue(count($minMax->getData()) === count($In->getData()));\n }",
"public function getFilter($id);",
"public function filterUser(int|UniqueId $id): self;",
"static function getUserProfiles($user_ID, $sqlfilter = []) {\n global $DB;\n\n $profiles = [];\n\n $where = ['users_id' => $user_ID];\n if (count($sqlfilter) > 0) {\n $where = $where + $sqlfilter;\n }\n\n $iterator = $DB->request([\n 'SELECT' => 'profiles_id',\n 'DISTINCT' => true,\n 'FROM' => 'glpi_profiles_users',\n 'WHERE' => $where\n ]);\n\n while ($data = $iterator->next()) {\n $profiles[$data['profiles_id']] = $data['profiles_id'];\n }\n\n return $profiles;\n }",
"function filterInt($field, $value) {\n if (($value = ltrim($value, '=')) !== '') {\n switch ($value[0]) {\n case '>': $this->where($field, '>', (int) substr($value, 1)); break;\n case '<': $this->where($field, '<', (int) substr($value, 1)); break;\n case '!': $this->where($field, '<>', (int) substr($value, 1)); break;\n default: $this->where($field, '=', (int) $value); break;\n }\n }\n }",
"function SqlKeyFilter() {\r\n\t\treturn \"`id_profile` = @id_profile@ AND `stat_date` = '@stat_date@'\";\r\n\t}",
"public function findItemByProfileAndId(Profile $profile, $id)\n\t{\n\t\treturn $this->itemRepo->findBy(array('profile_id' => $profile->id, 'id' => $id));\n\t}",
"function clients_getFilter($id) {\n\tglobal $Auth;\n\n\t## multiclient\n\t$client_id = $Auth->auth[\"client_id\"];\n\t\n\t## prepare the db-object\n\t$db = new DB_Sql();\n\n\t## then get the correct values\n\t$query = \"SELECT * FROM \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\"_filters WHERE id='$id'\";\n\n\t$result = $db->query($query);\t\n\t$counter = 0;\n\t$return_value = array();\n\tif($db->next_record(MYSQL_ASSOC)) {\n\t\t$return_value = $db->Record;\n\t}\n\treturn $return_value;\t\n}",
"public function userIdFiltering(&$filter)\n {\n // Enter your code here\n }",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function UserID_Filtering(&$filter) {\r\n\r\n\t\t// Enter your code here\r\n\t}",
"private function filterProfilesApi($query)\n {\n $name = request('name');\n $attn_name = request('attn_name');\n $attn_phone_number = request('attn_phone_number');\n $domain_name = request('domain_name');\n $sortkey = request('sortkey');\n $reverse = request('reverse');\n\n if($name) {\n $query = $query->where('profiles.name', 'LIKE', '%'.$name.'%');\n }\n if($attn_name) {\n $query = $query->where('profiles.attn_name', 'LIKE', '%'.$attn_name.'%');\n }\n if($attn_phone_number) {\n $query = $query->where('profiles.attn_phone_number', 'LIKE', '%'.$attn_phone_number.'%');\n }\n if($domain_name) {\n $query = $query->where('profiles.domain_name', 'LIKE', '%'.$domain_name.'%');\n }\n if($sortkey) {\n $query = $query->orderBy($sortkey, $reverse == 'true' ? 'asc' : 'desc');\n }else{\n $query = $query->orderBy('profiles.name');\n }\n\n return $query;\n }",
"public function fetchFilterDetails($profileId,$whrStr=\"\",$selectStr=\"*\")\n\t{\n\t\ttry\n\t\t{\n\t\t\t$res=null;\n\t\t\tif($profileId)\n\t\t\t{\n\t\t\t\t$sql=\"select $selectStr from newjs.FILTERS where PROFILEID=:profileId \".$whrStr;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$prep=$this->db->prepare($sql);\n\t\t\t\t$prep->bindValue(\":profileId\",$profileId,PDO::PARAM_INT);\n\t\t\t\t\n\t\t\t\t$prep->execute();\n\t\t\t\tif($result = $prep->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$res=$result;\n\t\t\t\t\treturn $res;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new jsException(\"error in filter class either no profileid or no updStr\");\n\t\t\t\n\t\t\t\t\n\t\t}\n\t\tcatch(PDOException $e)\n\t\t{\n\t\t\t/*** echo the sql statement and error message ***/\n\t\t\tthrow new jsException($e);\n\t\t}\n\t}",
"function where_search_User_profile_has_qualification_profile_id($value)\n {\n\n $this->db->where('user_profile_iduser_profile', $value);\n $query = $this->db->get('user_profile_has_qualification');\n\n if ($query->result()) {\n return $query->result();\n } else {\n return false;\n }\n\n\n }",
"public function getUsersDetails($filter_params = [], $start = 0, $limit = 0);",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(CanvassDataTableMap::COL_CAN_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(CanvassDataTableMap::COL_CAN_ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CanvassDataTableMap::COL_CAN_ID, $id, $comparison);\n }",
"function filter_users( $type, $limit = null, $page = 1, $user_id = false, $search_terms = false, $populate_extras = true ) {\r\n\t\t\t\tglobal $wpdb, $bp;\r\n\r\n\t\t\t\tif ( !function_exists('xprofile_install') )\r\n\t\t\t\t\twp_die( 'This requires BuddyPress Extended Profiles to be turned on', 'bp-memberfilter' );\r\n\r\n\t\t\t\t$sql = array();\r\n\r\n\t\t\t\t$sql['select_main'] = \"SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.display_name, u.user_email\";\r\n\r\n\t\t\t\tif ( 'active' == $type || 'online' == $type )\r\n\t\t\t\t\t$sql['select_active'] = \", um.meta_value as last_activity\";\r\n\r\n\t\t\t\tif ( 'popular' == $type )\r\n\t\t\t\t\t$sql['select_popular'] = \", um.meta_value as total_friend_count\";\r\n\r\n\t\t\t\tif ( 'alphabetical' == $type )\r\n\t\t\t\t\t$sql['select_alpha'] = \", pd.value as fullname\";\r\n\r\n\t\t\t\t$sql['from'] = \"FROM \" . CUSTOM_USER_TABLE . \" u LEFT JOIN \" . CUSTOM_USER_META_TABLE . \" um ON um.user_id = u.ID\";\r\n\r\n\t\t\t\t// XProfile field prefix\r\n\t\t\t\t$field = \"field_\";\r\n\r\n\t\t\t\t// Construct pieces based on filter criteria\r\n\t\t\t\tforeach ( $_REQUEST as $key => $value ) {\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t\tif ( strstr( $key, $field ) && !empty( $value ) ) {\r\n\r\n\t\t\t\t\t\t// Get ID of field to filter\r\n\t\t\t\t\t\t$field_id = substr( $key, 6, strlen( $key ) - 6 );\r\n\t\t\t\t\t\t$field_value = $value;\r\n\r\n\t\t\t\t\t\t$sql['join_profiledata'] .= \"LEFT JOIN {$bp->profile->table_name_data} pd$i ON u.ID = pd$i.user_id \";\r\n\r\n\t\t\t\t\t\tif ( !$sql['where'] )\r\n\t\t\t\t\t\t\t$sql['where'] = 'WHERE ' . bp_core_get_status_sql( 'u.' );\r\n\r\n\t\t\t\t\t\t$sql['where_profiledata'] .= \"AND pd$i.field_id = {$field_id} AND pd$i.value LIKE '%%$field_value%%' \";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( 'active' == $type || 'online' == $type )\r\n\t\t\t\t\t$sql['where_active'] = \"AND um.meta_key = 'last_activity'\";\r\n\r\n\t\t\t\tif ( 'popular' == $type )\r\n\t\t\t\t\t$sql['where_popular'] = \"AND um.meta_key = 'total_friend_count'\";\r\n\r\n\t\t\t\tif ( 'online' == $type )\r\n\t\t\t\t\t$sql['where_online'] = \"AND DATE_ADD( FROM_UNIXTIME(um.meta_value), INTERVAL 5 MINUTE ) >= NOW()\";\r\n\r\n\t\t\t\tif ( 'alphabetical' == $type )\r\n\t\t\t\t\t$sql['where_alpha'] = \"AND pd.field_id = 1\";\r\n\r\n\t\t\t\tif ( $user_id && function_exists( 'friends_install' ) ) {\r\n\t\t\t\t\t$friend_ids = friends_get_friend_user_ids( $user_id );\r\n\t\t\t\t\t$friend_ids = $wpdb->escape( implode( ',', (array)$friend_ids ) );\r\n\r\n\t\t\t\t\t$sql['where_friends'] = \"AND u.ID IN ({$friend_ids})\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( $search_terms && function_exists( 'xprofile_install' ) ) {\r\n\t\t\t\t\t$search_terms = like_escape( $wpdb->escape( $search_terms ) );\r\n\t\t\t\t\t$sql['where_searchterms'] = \"AND pd.value LIKE '%%$search_terms%%'\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tswitch ( $type ) {\r\n\t\t\t\t\tcase 'active': case 'online': default:\r\n\t\t\t\t\t\t$sql[] = \"ORDER BY FROM_UNIXTIME(um.meta_value) DESC\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'newest':\r\n\t\t\t\t\t\t$sql[] = \"ORDER BY u.user_registered DESC\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'alphabetical':\r\n\t\t\t\t\t\t$sql[] = \"ORDER BY pd.value ASC\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'random':\r\n\t\t\t\t\t\t$sql[] = \"ORDER BY rand()\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'popular':\r\n\t\t\t\t\t\t$sql[] = \"ORDER BY CONVERT(um.meta_value, SIGNED) DESC\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( $limit && $page )\r\n\t\t\t\t\t$sql['pagination'] = $wpdb->prepare( \"LIMIT %d, %d\", intval( ( $page - 1 ) * $limit), intval( $limit ) );\r\n\r\n\t\t\t\t// Get paginated results\r\n\t\t\t\t$paged_users = $wpdb->get_results( $wpdb->prepare( join( ' ', (array)$sql ) ) );\r\n\r\n\t\t\t\t// Re-jig the SQL so we can get the total user count\r\n\t\t\t\tunset( $sql['select_main'] );\r\n\r\n\t\t\t\tif ( !empty( $sql['select_active'] ) )\r\n\t\t\t\t\tunset( $sql['select_active'] );\r\n\r\n\t\t\t\tif ( !empty( $sql['select_popular'] ) )\r\n\t\t\t\t\tunset( $sql['select_popular'] );\r\n\r\n\t\t\t\tif ( !empty( $sql['select_alpha'] ) )\r\n\t\t\t\t\tunset( $sql['select_alpha'] );\r\n\r\n\t\t\t\tif ( !empty( $sql['pagination'] ) )\r\n\t\t\t\t\tunset( $sql['pagination'] );\r\n\r\n\t\t\t\tarray_unshift( $sql, \"SELECT COUNT(DISTINCT u.ID)\" );\r\n\r\n\t\t\t\t// Get total user results\r\n\t\t\t\t$total_users = $wpdb->get_var( $wpdb->prepare( join( ' ', (array)$sql ) ) );\r\n\r\n\t\t\t\t// Lets fetch some other useful data in a separate queries\r\n\t\t\t\t// This will be faster than querying the data for every user in a list.\r\n\t\t\t\t// We can't add these to the main query above since only users who have\r\n\t\t\t\t// this information will be returned (since the much of the data is in\r\n\t\t\t\t// usermeta and won't support any type of directional join)\r\n\t\t\t\tif ( is_array( $paged_users ) )\r\n\t\t\t\t\tforeach ( $paged_users as $user )\r\n\t\t\t\t\t\t$user_ids[] = $user->id;\r\n\r\n\t\t\t\t$user_ids = $wpdb->escape( join( ',', (array)$user_ids ) );\r\n\r\n\t\t\t\t// Add additional data to the returned results\r\n\t\t\t\tif ( $populate_extras )\r\n\t\t\t\t\t$paged_users = BP_Core_User::get_user_extras( &$paged_users, &$user_ids );\r\n\r\n\t\t\t\t// Return to lair\r\n\t\t\t\treturn array( 'users' => $paged_users, 'total' => $total_users );\r\n\t\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the number of identifier parts in the parsed identifier name | public function getNumParts()
{
return count($this->identifierParts);
} | [
"function maxIdentifierLength()\n {\n return 30;\n }",
"public function numericIdentifier();",
"protected function getPartsNumber()\n {\n return count($this->explodeParts($this->get()));\n }",
"public function parts()\n {\n return $this->identifierParts;\n }",
"public function maxIdentifierLength()\n {\n return 64;\n }",
"protected function _getIdentifier() {\n\t\t$this->_mhtmlLocationIndex++;\n\t\treturn $this->_indexToChars($this->_mhtmlLocationIndex);\n\t}",
"function countName() {\n \t$num = safe_row(\"COUNT(\".$this->field.\")\" , 'textpattern' , $this->where);\n \t\treturn $num[\"COUNT(\".$this->field.\")\"];\n }",
"public function getIdlength() {\n\t\treturn 20;\n\t}",
"function count_names($s) // {{{\n{\n if (empty($s))\n return 0;\n $n_matches = preg_match_all(\"/,/\", $s, $matches);\n return $n_matches + 1;\n}",
"public function identifier(){\n try {\n // runtime/Php/test/Antlr/Tests/grammers/t021hoist.g\n $alt2=2;\n $LA2_0 = $this->input->LA(1);\n\n if ( ($LA2_0==$this->getToken('ID')) ) {\n $alt2=1;\n }\n else if ( ($LA2_0==$this->getToken('7')) ) {\n $alt2=2;\n }\n else {\n $nvae = new NoViableAltException(\"\", 2, 0, $this->input);\n\n throw $nvae;\n }\n switch ($alt2) {\n case 1 :\n // runtime/Php/test/Antlr/Tests/grammers/t021hoist.g\n {\n $this->match($this->input,$this->getToken('ID'),self::$FOLLOW_ID_in_identifier74); \n\n }\n break;\n case 2 :\n // runtime/Php/test/Antlr/Tests/grammers/t021hoist.g\n {\n $this->pushFollow(self::$FOLLOW_enumAsID_in_identifier82);\n $this->enumAsID();\n\n $this->state->_fsp--;\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n\n return ;\n }",
"function parseIdentifier($identifier) {\n\t\tif (preg_match('/^([\\w]+)\\.(.*)$/', $identifier, $matches)) {\n\t\t\treturn array(\n\t\t\t\t'model' => $matches[1],\n\t\t\t\t'foreign_key' => $matches[2],\n\t\t\t);\n\t\t}\n\t\treturn $identifier;\n\t}",
"public static function obtainIdentifierFieldName();",
"public function lenLiteralSeparate() { return $this->_m_lenLiteralSeparate; }",
"public function getJsonExtractIdentifier()\n {\n return '$.'.$this->getIdentifierPath('.', false);\n }",
"function CRON_getNextIdentifierNr($identifier)\n{\n\t$fp = fopen(\"/etc/crontab\",\"r\");\n\t$nr = 0;\n\t$found = false;\n\n\t//Run thru the crontab lines\n\twhile ($line = fgets($fp))\n\t{\n\t\t//Check if the identifier could be found in the current line\n\t\tif (strpos($line,$identifier) !== false)\n\t\t{\n\t\t\t//Split the parameters from the identifier\n\t\t\t$paramsIdent = explode(';#',$line);\n\t\t\t//Store the complete identifier (with number)\n\t\t\t$idents[$nr++] = $paramsIdent[1];\n\t\t\t$found = true;\n\t\t}\n\t}\n\n\t//Check if there were found identifier lines\n\tif ($nr > 0)\n\t\t{\n\t\t\t//Sort the found identifierts to make the identifier line with the highest number the last\n\t\t\tsort($idents);\n\t\t\t//Get the identifier with the highest number\n\t\t\t$last = end($idents);\n\t\t\t//Split identifiert and number\n\t\t\t$tmp = explode(\"--\",$last);\n\t\t\t$nr = $tmp[1]+1;\n\t\t\t//Create incremented number\n\t\t\t$nr = sprintf(\"%04.0d\",$nr);\n\t\t}\n\telse\n\t//No line was found so start with 0\n\t\t$nr = \"0000\";\n\n\tfclose($fp);\n\n\treturn(\"$identifier--$nr\");\n}",
"function _extractNumber()\n {\n $fragment = \"\";\n\n while ($this->_canLookAhead() && !$this->_isNotNeeded()) {\n $fragment .= strtolower($this->text[$this->position++]);\n }\n\n\n $result = $this->_identifyNumber($fragment);\n return $result == false ? 0 : $result;\n }",
"public function getNamesCount()\n {\n //build URI to merge Docs\n $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/names';\n //sign URI\n $signedURI = Utils::sign($strURI);\n $responseStream = Utils::processCommand($signedURI, 'GET', '', '');\n $json = json_decode($responseStream);\n return $json->Names->Count;\n\n }",
"public function nameAndNumber($name, $delimiter = '') {\n\t\tif(empty($delimiter)) $delimiter = $this->delimiter;\n\t\t$fail = array($name, 0);\n\t\tif(strpos($name, $delimiter) === false) return $fail;\n\t\t$parts = explode($delimiter, $name);\n\t\t$suffix = array_pop($parts);\n\t\tif(!ctype_digit($suffix)) return $fail;\n\t\t$suffix = ltrim($suffix, '0');\n\t\treturn array(implode($delimiter, $parts), (int) $suffix); \n\t}",
"public function getIdlen()\n {\n return $this->idlen;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.