query stringlengths 10 8.11k | document stringlengths 17 398k | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
The facet count must be a number. | public function testInvalidFacetCountError()
{
set_option('solr_search_facet_limit', '25');
// Invalid facet limit.
$this->request->setMethod('POST')->setPost(array(
'solr_search_facet_limit' => 'invalid'
));
$this->dispatch('solr-search/results');
// ... | [
"public function testNoFacetCountError()\n {\n\n set_option('solr_search_facet_limit', '25');\n\n // Missing facet length.\n $this->request->setMethod('POST')->setPost(array(\n 'solr_search_facet_limit' => ''\n ));\n\n $this->dispatch('solr-search/results');\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wrap any object with a route match, and return that. | private function createRouteMatchForObject(\stdClass $object) {
$route_match = $this->prophesize(RouteMatchInterface::class);
$route_match->getRawParameters()->willReturn(new ParameterBag(['entity_type' => 'node', 'var_name' => 1]));
$route_match->getParameters()->willReturn(new ParameterBag(['entity_type' ... | [
"public function objectRouteClass();",
"function route($patern, $location, $options =array() )\n{\n return new Route($patern, $location, $options);\n}",
"public function getMatchRouteStrategy(): RouteMatcherInterface;",
"public function getRouteObject()\n {\n return new Route($this->url, $this->p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the user's shop_id and model's shop_id is same | private function merchantAuth()
{
return isset($this->model->shop_id) && $this->model->shop_id == $this->user->merchantId();
} | [
"public function checkSellerExists($shop_id, $user_id) {\n $this->__createLog('Entering into class [UserManager\\Sonata\\UserBundle\\Services\\SellerUser] and function [checkSellerExists]', array());\n $em = $this->em;\n $seller_user = $em->getRepository('UserManagerSonataUserBundle:SellerUser'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the getPage and getArchives call to display listings of posts on the container. | public function setPostListingCall(){
$where = array('class_key' => 'MyArticle');
//@TODO : This will be the settings for myjournal later
$settings = array();
$articlesPlaceholder = $this->xpdo->getOption('articles_placeholder', $settings, 'articles');
//@TODO allow user... | [
"public function postsList()\n\t{\n\t\t$postManager = new PostManager();\n\t\t$pagesCount = $postManager->countPages($this->postsPerPage);\n\n\t\tif ($this->pageNumber > $pagesCount) {\n\t\t\t$this->pageNumber = $pagesCount;\n\t\t}\n\n\t\t$firstIndex = ($this->pageNumber - 1) * $this->postsPerPage;\n\n\t\t$resp;\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns album manager service | private function getAlbumManager()
{
return $this->getModuleService('albumManager');
} | [
"public static function buildAlbumService() {\n\t\t$albumService = new AlbumService(self::$apiKey, self::$secretKey);\n\t\treturn $albumService;\n\n\t}",
"public function getApiAlbum()\n {\n $factory = new ApiNodeFactory($this);\n\n return $factory->makeApiAlbum();\n }",
"private function ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tokenize string and return getted parameters | public function tokenize()
{
$parameters = array();
$parameterName = '';
while($this->next()) {
if($this->isWhiteSpace()) {
continue;
} else if($this->char()!='=') {
$parameterName .= $this->char();
} else {
... | [
"private function tokenize($string)\n {\n $params = array();\n\n // tokenize the first set\n $param = strtok($string, '-');\n\n // loopedyloop\n while ($param !== false) {\n if (strlen($param) > 1) {\n // The name of each parameter should be the first\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funtion to load entity | public function load($id)
{
$this->entity = $this->entity->find($id);
} | [
"public function postLoad($entity);",
"public function load(IKL_Domain_Abstract $entity)\n {\n \n }",
"protected function loadRelated($entity)\n {\n }",
"public function getRawEntityLoader();",
"protected function onSingleEntityLoad($entity)\n {\n }",
"public function getEntityById($id);"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setblockcount for node status Timed task | public function SetBlockCount()
{
header("Access-Control-Allow-Origin:*");
header("Access-Control-Allow-Methods:GET,POST");
$curlOperate = new CurlOperate();
$redis = new RedisOperate();
$response = $curlOperate->GetBlockCount();
$blockCount = json_decode($response,... | [
"public function setTasksCount()\n {\n $this->tasksCount = $this->sourceTables->count() + $this->import->countImportTasks();\n $this->bar = $this->output->createProgressBar($this->tasksCount);\n }",
"public function setTasksCount($count)\n {\n $this->_tasksCount = (int) $count;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the user_id from a given email. | function user_id_from_email($email) {
$email = sanitize($email);
return mysqli_fetch_array(mysqli_query(connection(), "select User_Id from users where email = '$email'"));
} | [
"function getUserIDFromEmail($email){\n $user = getUserFromEmail($email);\n return $user['userID'];\n }",
"function authSupportGetUserIdFromEmail($email)\n {\n }",
"private function getUserId($email) {\n\t\t\n\t\t\t// Get a reference to the database\n\t\t\t$db = JFactory::getDbo();\n\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests whether the essential `leave_review` service is returned correctly. | public function testLeaveReviewService()
{
$container = wprss_wp_container();
$subject = $container->get(sprintf('%1$sleave_review', \WPRSS_SERVICE_ID_PREFIX));
$this->assertTrue($subject instanceof \Aventura\Wprss\Core\Plugin\ComponentInterface, 'Not a valid component');
$this->asse... | [
"public static function is_leave(){\n $userid = \\Fuel\\Core\\Session::get(\"username\");\n // the date today\n // to be check against the leave db\n // if user is on leave\n $today = strftime(\"%Y-%m-%d\", time());\n\n // get last number of the string\n $str = explo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end get_basic_query Loop through query and echo music items | protected function the_music( $query ){
$results = array();
if ( $query->have_posts() ){
while ( $query->have_posts() ){
$query->the_post();
if ( ! array_key_exists( $query->post->ID , $results ) ) {
$music = new WOVAX_MM_Music();
$music->set_settings( $query->post... | [
"function getOGMusicMusicians();",
"public function get() {\n\n\t\t/* Get the Current Playlist */\n\t\t$list = $this->_httpq->get_tracks();\n\n\t\t$songs = explode(\"::\",$list);\n\n\t\tforeach ($songs as $key=>$entry) {\n\t\t\t$data = array();\n\n\t\t\t/* Required Elements */\n\t\t\t$data['id'] \t= $key;\n\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Category/term Archive Link | function get_cat_link($term_field = '') {
global $post;
$post_type = get_post_type_object(get_post_type());
$post_type_name = $post_type->name;
if ($term_field) {
$archive_link = get_term_link($term_field->slug, 'category');
}
else {
$archive_link = jumpoff_get_page_url('news');
}
return $arc... | [
"function get_archive_link( $format = 'absolute' ) {\n\n\treturn utils\\get_taxonomy_archive_link( 'actor', $format );\n}",
"public function category_archive() {\n\n\t\t\t// Get queried object.\n\t\t\t$term = get_queried_object();\n\n\t\t\t// Queried term description.\n\t\t\tif ( ! empty( $term->description ) ) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to set the value of field Follow_result | public function setFollowResult($Follow_result)
{
$this->follow_result = $Follow_result;
return $this;
} | [
"public function getFollowResult()\n {\n return $this->follow_result;\n }",
"public function set_result($result){\n $this->result = $result;\n }",
"public function set_result($result) {\n\t\t$this->_result = \"$result\";\n\t}",
"public function setResult($result)\n\t{\n\t\t// Allow only... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens a FileStream on the specified path with write access | public function openWrite()
{
return new FileStream($this->filePath, FileStream::WRITE);
} | [
"public static function fileStream_open ($path = '', $mode = 'write', $ensurePathExistence = true)\r\n\t\t{\r\n\t\t\t$mode = XXX_Default::toOption($mode, array('read', 'write', 'writeAppend'), 'write');\r\n\t\t\t\r\n\t\t\tif (($mode == 'write' || $mode == 'writeAppend') && $ensurePathExistence)\r\n\t\t\t{\r\n\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor method for FindMeetingTimesSearchConstraints | public function __construct(\Ews\ArrayType\EwsArrayOfTimeSlot $searchWindows = null, $meetingDurationInMinutes = null, $activityDomain = null)
{
$this
->setSearchWindows($searchWindows)
->setMeetingDurationInMinutes($meetingDurationInMinutes)
->setActivityDomain($activity... | [
"public function __construct(?\\ArrayType\\EwsArrayOfTimeSlot $searchWindows = null, ?int $meetingDurationInMinutes = null, ?string $activityDomain = null)\n {\n $this\n ->setSearchWindows($searchWindows)\n ->setMeetingDurationInMinutes($meetingDurationInMinutes)\n ->setAc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Route notifications for the Slack channel. | public function routeNotificationForSlack($notification)
{
return env('WEBHOOK_URL');
} | [
"public function routeNotificationForSlack() {\n return 'https://hooks.slack.com/services/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';\n }",
"public function routeNotificationForSlack()\n {\n return \"https://hooks.slack.com/services/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\";\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
global scope variable can only be accessed outside of a function | function myTest()
{
// this function does not have access to global scope variables
echo isset($gx) ? "gx is set" : "gx is not set";
} | [
"function access(){\n global $x;\n echo $x;\n }",
"function test() {\n\tglobal $foo;\n\treturn $foo;\n}",
"function getNum3() {\n echo $GLOBALS['globalna3']; // drugi sposob\n}",
"function globalExample()\n {\n global $globalVar;\n echo \"This is ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test post workout throws exception when JSON response error field is not null. | public function testPostWorkoutThrowsExceptionWhenJSONResponseErrorFieldIsNotNull()
{
$strava = $this->getStravaAPIMock(array(__DIR__ . '/Fixtures/testPostWorkoutThrowsExceptionWhenJSONResponseErrorFieldIsNotNull.txt'));
$workout = new Workout();
$this->setExpectedException('RuntimeExcepti... | [
"public function testPostWithError()\n {\n $response = $this->handlePostData(\n [\n 'description' => 'some description',\n 'license' => 'MIT'\n ]\n );\n\n $result = json_decode($response->getContent(), true);\n\n $this->assertEmp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to get local_id to Acronym. | public function getLocalIDToAcronym($acronym) {
$local = $this->db->selectObj('SELECT local_id FROM local '
. 'WHERE acronym = :acronym', array(':acronym' => $acronym), "Local");
return $local;
} | [
"public function GetAcronym() {\n\t\t$user = self::GetUserProfile();\n\t\treturn $user['akronym'];\n\t}",
"public function getAcronymCode()\n {\n return $this->acronymCode;\n }",
"public function getAcronym() {\n $this->loadDataFromDegree();\n return $this->data->acronym;\n }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ You'll note that I used php's array pointer functions in the _postProcess function. In fact it looks like I made a foreach overly complicated in the 'open' case of the switch statement. However this is not the case. By using the array pointer functions, each time you go another call deeper (or shallower) in the recur... | function _postProcess() {
$item = current($this->_struct);
$ret = array('_name'=>$item['tag'], '_attributes'=>array(), '_value'=>null);
if (isset($item['attributes']) && count($item['attributes'])>0) {
foreach ($item['attributes'] as $key => $data) {
if (!is_null($data)) {
... | [
"function traverse(&$response, &$level, &$values, &$line, &$used, $uncheck, &$lastkey, &$aggregate) {\n static $reverseSource, $reverseValues = array();\n\n\n foreach($level as $source => $attributes) {\n\n if (is_array($attributes)) {\n $attr = $attributes[0];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
isActiveByTitle Test if an active page exist return null if no pages | public function setIsActiveByTitle($title)
{
$object = $this->findOneByTitle($title);
$state = is_object($object) ? ($object->getIsActive() ? true : false) : null;
return $state;
} | [
"function _get_active($page_name, $id = 0) {\n if(_page($id) == $page_name) {\n return 'active';\n }\n \n return '';\n}",
"protected function isPageActive()\n {\n if($this->url->getTarget()->id == Page::id()) return true;\n return false;\n }",
"function culturefeed_pages_has_active_pa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the form for creating new Process. | public function create()
{
if (!Gate::allows('process_create')) {
return abort(401);
}
return view('admin.processes.create');
} | [
"public function create()\n {\n return view('processes.create');\n }",
"public function newAction()\n {\n $entity = new SelectionProcess();\n \n $em = $this->getDoctrine()->getManager();\n \n $definitionTestList = $em->getRepository('DefinitionTestBundle:Definiti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the first word of a phrase | function firstWord($phrase) {
$words = explode(' ', trim($phrase));
return strtolower($words[0]);
} | [
"function get_first_word($sentence)\n {\n $wordArr = explode(' ', $sentence);\n $first_word = trim($wordArr[0]);\n runDebug(__FILE__, __FUNCTION__, __LINE__, \"Sentence: $sentence. First word:$first_word\", 4);\n return $first_word;\n }",
"function get_first_word($sentance){\n\t$wordArr = explode(' ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method: get_string_from_phpexec() Executes the included php (or html) file and returns the output as a string. Parameters: $file (string, required) name of the file | function get_string_from_phpexec($file) {
if (file_exists($file)) {
ob_start();
include($file);
$content = ob_get_contents();
ob_end_clean();
return $content;
}
} | [
"private function eval_get_file($file) {\n ob_clean();\n ob_start(); // start buffering\n is_readable($file) && include($file);\n $str = ob_get_contents();\n ob_end_clean();\n\n return $str;\n }",
"function execute_and_output_template($file,$dir=null) {\n if ($dir == null) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write the code for an Inputfield Param: $component The $component that calls the visitor $tab The tabulation offset | public function VisitInput( ART_Input &$component, $tab = "" )
{
// Create a label if it's defined
$id = $component->GetId();
if( $component->GetLabel() <> "" )
{
echo $tab . "<label class=\"ART_Label\"";
if ( $id <> "" )
echo " for=\"" . $id;
echo "\">" . ... | [
"function tabparamfields($edit, $options, $data, $paramgroup)\n{\n global $dispfields;\n \n //\n // calculate pagebreak rows if needed\n //\n // Note: pagebreak rows may not be the same and $cnt because used==FALSE rows shouldn't be counted\n //\n if ( isset ($options[\"pagebreak\"]))\t\t// if set\n {\n\t// se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test if the correct mapping is created with without specifying a delimiter (the delimiter should be ). And with a different delimiter (!). | function testDefaultDelimiter1() {
$config = 'etc/mapsicle.default.delimiter.xml';
$sqlmap =& MapsicleFactory::buildMapsicle($config);
if (PEAR::isError($sqlmap)) {
$this->fail($sqlmap->getMessage());
}
$mapping =& $sqlmap->mappings['Customer.findById#'];
... | [
"private function hasCustomDelimiter(): bool {\n return $this->getStringToProcess()[0] == \"/\" && $this->getStringToProcess()[1] == \"/\";\n }",
"public function testGetDelimiter()\n {\n $this->assertNotEmpty($this->codegenerator->getDelimiter());\n }",
"public function testGetSetRulesSe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Initialisation of the _latest list depending on the reversed list of dependencies Deprecated, latest mad it usless | private function ini_latest(){
for($i = 0; $i < $this->_nb_keys; ++$i){
if(empty($this->_rev_dep[$i])){
$this->_latest[$i] = $this->_sprint_time;
}
}
} | [
"public function getDeprecatedReleases()\n\t{\n\t\t$releases = (array) $this->getReleases();\n\t\t$maxReleases = $this->app['config']->get('rocketeer::remote.keep_releases');\n\n\t\treturn array_slice($releases, $maxReleases);\n\t}",
"private function classifyDependencies()\n {\n $required = $this->g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
pass the link for which you want the ItemId. | function getitemid($link)
{
$itemid = 0;
global $mainframe;
$mainframe = JFactory::getApplication();
if($mainframe->isAdmin()){
$db=JFactory::getDBO();
$query = "SELECT id FROM #__menu WHERE link LIKE '%".$link."%' AND published = 1 LIMIT 1";
$db->setQuery($query);
$itemid = $db->loadResult();
}
... | [
"function getitemid($link)\n\t{\n\t\t$itemid = 0;\n\t\t\n\t\tglobal $mainframe;\n\t\t$mainframe = JFactory::getApplication();\n\t\tif($mainframe->isAdmin()){\n\t\t\t$db=JFactory::getDBO();\n\t\t\t$query = \"SELECT id FROM #__menu WHERE link LIKE '%\".$link.\"%' AND published = 1 LIMIT 1\";\n\t\t\t$db->setQuery($que... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GetOwner Gets the project's owner | public function GetOwner()
{
if (empty($this->owner) && !$this->readOwner) {
$exe = new GitPHP_GitExe($this);
$args = array();
//$args[] = 'gitweb.owner';
$args[] = 'user.name';
$this->owner = $exe->Execute(GIT_CONFIG, $args);
unset($exe);
if (empty($this->owner) && function_exists('posix_g... | [
"public function getOwner()\r\n {\r\n return $this->owner;\r\n }",
"public function getOwner()\n {\n return $this->owner;\n }",
"public function get_owner()\n {\n return $this->_owner;\n }",
"public function getOwner()\n {\n return isset($this->Owner) ? $th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the callOptions Contains the optional features for the call. | public function setCallOptions($val)
{
$this->_propDict["callOptions"] = $val;
return $this;
} | [
"public function setSoapHeaderCallOptions(ChargentCallOptions $callOptions, $nameSpace = 'http://soap.sforce.com/schemas/class/ChargentSFA/T', $mustUnderstand = false, $actor = null)\n {\n return $this->setSoapHeader($nameSpace, 'CallOptions', $callOptions, $mustUnderstand, $actor);\n }",
"public fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set Total Day In Month | function setTotalDayInMonth($value) {
$this->totalDayInMonth = $value;
} | [
"function setTotalDayInMonth($value) {\n $this->totalDayInMonth = $value;\n return $this;\n }",
"function getTotalDayInMonth() {\n return $this->totalDayInMonth;\n }",
"private function _setMonthDay()\n {\n if ($this->isMonthDay()) {\n $monthDays = explode(',', $t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return an instance with the specified status code and, optionally, reason phrase. | public function withStatus(int $code, string $reasonPhrase = ''): self
{
$new = clone $this;
$new->code = $code;
$new->reason = $reasonPhrase;
return $new;
} | [
"public function withStatus($code, $reasonPhrase = \"\"): Response\n {\n $newInstance = clone $this;\n\n $newInstance->processCode($code, $reasonPhrase);\n\n return $newInstance;\n }",
"public function withStatus(int $code, string $reason_phrase = ''): ResponseInterface\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The android version of function that gets the friend request of the user | function androidGetFriendRequest()
{
$userId = Slim::getInstance()->request()->post('id');
$sql = "SELECT UserId, FriendId FROM FriendRequest WHERE FriendId = :userId";
try {
$db = getConnection();
$stmt = $db->prepare($sql);
$stmt->bindParam("userId", $userId);
$stmt->exec... | [
"function vibe_friends_get_friendId_request_ids_for_user($request){\n\n \t\t$args = json_decode($request->get_body(),true);\n\n \t $initiator_friendship_ids=$this->vibe_friends_get_friendship_ids_for_user($this->user->id,$args['page'],$args['requester'],$args['sort']);\n \t $user_details = array();\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executes the restarted command then deletes the tmp ini. | private function restart($command)
{
$exitCode = 1;
passthru($command, $exitCode);
if (!empty($this->tmpIni)) {
@unlink($this->tmpIni);
}
exit($exitCode);
} | [
"function restart()\n {\n $this->cli->quietly('launchctl unload '.$this->daemonPath);\n\n $this->cli->quietly('launchctl load '.$this->daemonPath);\n }",
"public static function tearDownAfterClass()\n {\n unlink('/tmp/sample.ini');\t\n }",
"public function __destruct()\n {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function which will specify whether the mass edit option is disabled. | public function isMassEditOptionDisabled()
{
if (0 == $this->get('masseditable') || 1 != $this->get('displaytype') || 3 == $this->get('masseditable')) {
return true;
}
return false;
} | [
"public function disableEditing(){\n \t$this->_editable = false;\n }",
"public function isEditOnlyMode();",
"public function disableEditRecord() {\n $this->allow_edit_record = false;\n }",
"public function isDisabled () {}",
"public function setDisabled(): self;",
"public function isDisa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cookie duration can be set(in hours) by administrator. It converts it from hours to seconds and add it to current time. | public function getCookieEndTime()
{
return time()+(3600*((int)$this->getCookieDuration()));
} | [
"public function set_expiration_variant_time() {\n\n\t\treturn ( ! empty( $this->exp_option ) ? ( intval( $this->exp_option ) - 3600 ) : 30 * 60 * 23 );\n\t}",
"function cookie_duration( $duration, $user_id, $remember ) {\n\t\t$dur = $this->getService()->getDuration( true );\n\t\tif ( $dur < 2 ) {\n\t\t\t//durati... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return list of action types | public function getActionTypes() {
return self::$actionTypes;
} | [
"public function getActionTypes() {\n return array_map('ucfirst', array_combine(array_keys($this->actions), array_keys($this->actions)));\n }",
"public function getActionTypes(): array;",
"public function actionsTypes()\n {\n }",
"public function getGenericActions();",
"public function getAc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch campaign fundraisers from API | public function campaignFundraisers($campaignId, $count = 5)
{
$cacheKey = ClassyOrg::CACHE_KEY_PREFIX . '_CAMPAIGN_FUNDRAISERS_' . $campaignId;
$result = get_transient($cacheKey);
if ($result === false)
{
$params = array(
'aggregates' => 'true',
... | [
"private function fetchCampaigns() {\n $hash = $this->uri->segment(2);\n\n if( !$hash ) {\n show_error('Unknown campaign id');\n return;\n }\n\n $campaign = $this->Campaign_model\n ->where('campaigns.campaign_token', $hash)\n ->find();\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all SettingsShperndarjaPunimitTokes entities. | public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$settingsShperndarjaPunimitTokes = $em->getRepository('AiadBundle:SettingsShperndarjaPunimitTokes')->findAll();
return $this->render('settingsshperndarjapunimittokes/index.html.twig', array(
'settingsShpe... | [
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $settingsModeliPleherimits = $em->getRepository('AiadBundle:SettingsModeliPleherimit')->findAll();\n\n return $this->render('settingsmodelipleherimit/index.html.twig', array(\n 'settingsModeliPleher... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks that entered SSN is properly formated 000000000 | function isSSN($str){
$SSN=trim($str);
if(ereg("^[0-9]{3}-[0-9]{2}-[0-9]{4}$", $SSN)) //looks for formated SSN string
return TRUE; //good SSN
else
return FALSE; //bad SSN
} | [
"public function testSsn() {\n $this->assertTrue(Validate::ssn('666-10-1337'));\n $this->assertTrue(Validate::ssn('384-29-3481'));\n\n $this->assertFalse(Validate::ssn('66-10-1337'));\n $this->assertFalse(Validate::ssn('384-29-341'));\n $this->assertFalse(Validate::ssn('666.10.133... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the method to refresh. | public function setRefreshMethod()
{
return $this->setCalendar('method', Calendar::METHOD_REFRESH);
} | [
"public function request_refresh();",
"public function refresh( $abstract, $target, $method );",
"public function setMethod( $method );",
"public function refresh()\n\t{\n\t\t//use retrieve to implement it.\n\t\t\t\n\t}",
"public function reload() {\n\t\t$this->invoke(\"reload\");\n\t}",
"public function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create ACF fields for press posts | public function create_press_acf_fields() {
if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array (
'key' => 'press',
'title' => 'Press',
'fields' => array (
array (
'key' => 'source',
'label' => 'Source',
'name' => 's... | [
"function today_add_post_custom_fields() {\n\tif ( function_exists( 'acf_add_local_field_group' ) ) {\n\n\t\t// Create the array to add the fields to\n\t\t$fields = array();\n\n\t\t// Adds Header Content tab\n\t\t$fields[] = array(\n\t\t\t'key' => 'field_5c813914b0cd8',\n\t\t\t'label' => '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: normalizer should not throw an error better return value as is. Returns closure for normalizing property | public function getNormalizer(Schema $propertySchema, string $propertyName, bool $isRequired): \Closure; | [
"public function normalize() {\n }",
"public static function normalizeProperty($property)\n {\n //Remove an underscore, so you can do get_date()\n if(substr($property,0,1) == '_')\n {\n $property = substr($property, 1);\n }\n\n $property = lcfirst($property);\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retorna la id_categoria a la que pertenece la pregunta | static public function get_id_nueva_categ_ganada($id_pregunta)
{
$query = "SELECT cat.id_categoria AS 'id_categoria' FROM categoria AS cat, pregunta AS pre WHERE cat.id_categoria = pre.id_categoria AND pre.id_pregunta = ".self::$conexion->safeText(utf8_encode($id_pregunta))." LIMIT 1";
$result = self::$conexi... | [
"public function getIdcategoria()\n {\n return $this->idcategoria;\n }",
"public function getId_categoria()\n {\n return $this->id_categoria;\n }",
"public function getIdCategoria()\r\n {\r\n return $this->id_categoria;\r\n }",
"public function getCategoriaId... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
loadBalancers Pointer to the \LoadBalancers class | public function loadBalancers(): LoadBalancers
{
$lb = new LoadBalancers($this);
return $lb;
} | [
"public function listLoadBalancers()\n {\n return $this->api->makeAPICall('GET', $this->api::LOAD_BALANCERS_URL);\n }",
"public function loadBalancerList() {\n\t\t$url = \"/loadbalancers\";\n\n\t\t$response = $this->makeLbApiCall($url);\n\t\tif (isset($response['loadBalancers'])) {\n\t\t\treturn $res... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Identifies the missing information in the property lease data entry flow. | public function getMissingInformation($enquiryId) {
$referenceManager = new Manager_Referencing_Reference();
$enquiry = $referenceManager->getReference($enquiryId);
$propertyLease = $enquiry->propertyLease;
$missingInfo = array();
//Check the address details.
... | [
"public function getMissingInformation($enquiryId) {\n \n\t\t$referenceManager = new Manager_Referencing_Reference();\n\t\t$enquiry = $referenceManager->getReference($enquiryId);\n $prospectiveLandlord = $enquiry->propertyLease->prospectiveLandlord;\n \n $missingInfo = array();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate an memcached ID for the object given an object ID | public static function _getMemcachedID ($id)
{
return get_called_class () . '-' . $id;
} | [
"function generate_object_id(bool $counted = true): string\n{\n return Generator::generateObjectId($counted);\n}",
"public function getMemcacheId() {\n $lInvoker = $this->getInvoker();\n\n return strtolower(get_class($lInvoker)) . \"-\" . $lInvoker->getId();\n }",
"public function unique_id ($obj)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns list of properties which can be edited | public static function getEditableProperties() {
return ['title_ua', 'title_ru', 'title_en','for_whom_ua',
'what_you_learn_ua','what_you_get_ua','for_whom_ru',
'what_you_learn_ru','what_you_get_ru','for_whom_en',
'what_you_learn_en','what_you_get_en','level'];
} | [
"public function editableProperties();",
"public function editableProperties()\n\t{\n\t\treturn array(\"category\",\"name\");\n\t}",
"public function getVisibleProperties();",
"public function getAllProperties();",
"public function getAllowedProperties()\n {\n return $this->allowedProperties;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensures the path of the specified key exists, and creates all required parents if necessary. It does NOT create the key itself. | protected function ensurePath($key)
{
$parent=self::getParentName($key);
if (in_array($key, self::$known_paths))
return true;
if (self::$zk_h->exists($parent))
return true;
if (!$this->ensurePath($parent))
return false; // We should never execute this
if (self::$zk_h->create($parent, 1, $this->defau... | [
"protected function createNewKey($key, $must_exist = false)\n {\n if ($must_exist === true) {\n return false;\n }\n\n $results = $this->getKeyNamespace($key);\n\n if ($results === false) {\n return $key;\n }\n\n $key = $results;\n\n return $k... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executed when an order is marked as processing (from the cart), allowing order shipment types to process actions. IMPORTANT: this method may be executed during a visitor request. Don't execute slow processes synchronously in this method, considering scheduling those asynchronously. | public function onOrderStateProcessing()
{
$data = $this->getShipmentData();
// Add "from" address to shipment
$this->setProperty('packlink', $data);
// Add services admin link
$this->setProperty('services_link', $this->adapter->makeAdminUrl('deliveryOptions/deliveries', ['i... | [
"public function onProcess(OrderEntity $order){}",
"public function processOrders()\r\n {\r\n $orderCollection = Mage::getResourceModel('sales/order_collection');\r\n\r\n $orderCollection\r\n ->addFieldToFilter('status', Touch_TouchPayment_Model_Sales_Order::STATUS_TOUCH_PENDING)\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the help action word. | function GetHelpAction()
{
return "Help";
} | [
"function bm_help($action) {\r\n if (array_key_exists('bookmarklet', $action) && array_key_exists('help', $action['bookmarklet']))\r\n return $action['bookmarklet']['help'];\r\n return ucfirst(str_replace('$NAME', 'someone', $action['help'])).'.';\r\n}",
"protected function getAction(): string\n\t{\n\t\tretu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the annotation for relation | protected function getAnnotation()
{
if (null == $this->annotation) {
$this->annotation = new \Slick\Orm\Annotations\HasAndBelongsToMany(
'HasAndBelongsToMany',
[
Tag::class => true,
]
);
}
return $th... | [
"public function get_annotation()\n {\n return $this->annotation;\n }",
"public function getAnnotationLink()\n {\n return $this->getLink(self::ANNOTATION_LINK_REL);\n }",
"public function getAnnotationField();",
"function getAnnotation($annotation, $attribute = NULL);",
"public fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the cosine of the specified angle. | public function cos($angle)
{
return ( (float) cos($angle) );
} | [
"public function cos($angle)\n {\n return $this->expressionEngine->cos($angle);\n }",
"public function cos($angle)\n {\n return $this->runExpressionFunction('cos', $angle);\n }",
"public function cos($angle)\n\t{\n\t\treturn ( (float) $this->executionEngine->cos($angle) );\n\t}",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Serialize a message as a string. | public static function serializeMessage($message)
{
return json_encode($message);
} | [
"public function serialize(Message $message);",
"public function toString() : string\n {\n return $this->message->toString();\n }",
"public function __toString() {\n return $this->message;\n }",
"public function testMessageStringRepresentation()\n {\n $conn = new Connection();... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attach the given page(s) to the model. | public function setPagesAttribute($pages): void
{
static::saved(function (self $model) use ($pages) {
$model->syncPages($pages);
});
} | [
"public function addPages($pages);",
"abstract public function addPage(Page $page);",
"private function savePages()\n\t{\n\t\tif ( $this->validates() ){\n\t\t\t$this->data['new_pages'] = $this->factory->createChildPosts($this->data);\n\t\t\t$this->setResponse();\n\t\t\treturn;\n\t\t}\n\t\t$this->sendErrorRespon... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$process = new Process(['node C:/xampp/htdocs/fms/printtopdf.js | public function test()
{
$process = Process::fromShellCommandline('node print-to-pdf.js');
$process->setTimeout(30);
$process->setOptions(['create_new_console' => true]);
$process->setWorkingDirectory('C:/xampp/htdocs/fms');
try {
$process->mustRun();
... | [
"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/Sc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disallow username as a part of the password. Generated from protobuf field .google.protobuf.BoolValue disallow_username_substring = 4; | public function setDisallowUsernameSubstring($var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class);
$this->disallow_username_substring = $var;
return $this;
} | [
"public function getDisallowUsernameSubstring()\n {\n return $this->disallow_username_substring;\n }",
"public function authenticationWithValidAlphaCharClassPassword() {}",
"function passwordDisallowed($password) {\n $platitude = true;\n for ($i = 1; $i < strlen($password); ++$i) {\n i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the form for creating a new DetailStockOut. | public function create()
{
return view('detail_stock_outs.create');
} | [
"public function create()\n {\n return view('detail_stock_ins.create');\n }",
"public function actionCreate()\n {\n $model = new ProductStockClosing();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'UNIX_BULAN_ID' =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get's the current location node of the logged in user. | public static function getCurrentLocationNodeObjectOfUser() {
$nid = self::getCurrentLocationObjectOfUser();
$locationModel = \Models\Location::load($nid->nid);
return $locationModel->object;
} | [
"public function getUserLocation()\n {\n return $this->user_location;\n }",
"public function getCurrentLocation();",
"public function getCurrentNode()\n {\n $node_name = gethostname();\n return $this->getNode($node_name);\n }",
"public function getCurrentLocation() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation gETReturnIdAttachments Retrieve the attachments associated to the return | public function gETReturnIdAttachments($return_id)
{
$this->gETReturnIdAttachmentsWithHttpInfo($return_id);
} | [
"public function testGETReturnIdAttachments()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function gETReturnIdAttachmentsAsync($return_id)\n {\n return $this->gETReturnIdAttachmentsAsyncWithHttpInfo($return_id)\n ->then(\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set view storage path. | public function setViewStoragePath($path)
{
$this->app['view']->setStoragePath($path);
return $this;
} | [
"public function setStoragePath($path);",
"public static function setStoragePath($path)\n\t{\n\t\t$path = rtrim($path, '/\\\\');\n\t\tself::$_storage_path= $path.'/';\n\t}",
"public function setViewPath($path)\n {\n $len = strlen($path) - 1;\n if ($path[$len] == '/') {\n $path = subs... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tracking Urls for Auth.User | protected function trackingUrls()
{
if(!auth_check_session()) { return; }
$f = date('Y.W', time());
File::append(config('veer.history.path') . '/urls.' . $f . '.txt',
\Illuminate\Support\Facades\Auth::id(). '|' . app('url')->current() . '|' .
\Illuminate\Support\Facades\Route::currentRouteName() . "\r\... | [
"public function getUserUrl()\n {\n return $this->user_url;\n }",
"public function getUserInfoUrl();",
"protected function getUserInfoUrl()\n {\n return $this->baseUrl;\n }",
"public function url(\\App\\Models\\User $user)\n {\n return $this->verificationUrl($user);\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a view variable. | public function getViewVar($key = null)
{
return Hash::get($this->_View->viewVars, $key);
} | [
"public function viewVariable($name) {\n\t\tif (empty($this->controller->viewVars)) {\n\t\t\t$this->fail('There are no view variables, perhaps you need to run a request?');\n\t\t}\n\t\tif (isset($this->controller->viewVars[$name])) {\n\t\t\treturn $this->controller->viewVars[$name];\n\t\t}\n\t\treturn null;\n\t}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Answers the singleton instance of Installer. | public static function inst()
{
if (!self::$instance) {
self::$instance = new Installer();
}
return self::$instance;
} | [
"public static function instance() {\n\t\tif ( ! isset( self::$instance ) ) {\n\t\t\t// Setup the setup\n\t\t\tself::$instance = new Mai_Engine_Installer;\n\t\t\t// Methods\n\t\t\tself::$instance->setup_constants();\n\t\t\tself::$instance->includes();\n\t\t\tself::$instance->hooks();\n\t\t}\n\t\treturn self::$insta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves the fail attempts count from the data file | public function getAttemptsCount()
{
// file doesn't exist, so zero
if (!file_exists($this->dataFilePath))
{
return 0;
}
// retrieve data from file
$lines = file($this->dataFilePath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$attemptsInfos = explode(':', $lines[0]);
// ch... | [
"public function get_failed_count();",
"public function get_failure_count() {\n return isset($this->_failures) ? count($this->_failures) : -1;\n }",
"public function getFailedAttempts(): int;",
"public function numFailed() : int\n {\n return $this->numFailed;\n }",
"public static func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initial sqlite3 with table "logs" in $this>pdo logs = id INTEGER PRIMARY KEY AUTOINCREMENT level VARCHAR(10) NOT NULL message TEXT NOT NULL | public function __construct() {
$this->pdo = new \PDO('sqlite:syslog.sqlite3');
$this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$this->pdo->exec("CREATE TABLE IF NOT EXISTS logs (id INTEGER PRIMARY KEY AUTOINCREMENT, level VARCHAR(10) NOT NULL, message TEXT NOT NULL)");
... | [
"private function createLogsTable()\n {\n $this->db->raw(\"\n CREATE TABLE IF NOT EXISTS logs (\n id INTEGER PRIMARY KEY,\n task_id VARCHAR(20) NOT NULL,\n group_id INTEGER NULL,\n description VARCHAR(255) NULL,\n starte... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
args['map'] args['path'] args['streets'] args['altnames'] args['houses'] | function __construct($args)
{
if (!empty($args['map']))
{
$this->map = $args['map'];
}
$this->path = $args['path'];
$this->toolkit = mtoToolkit :: instance();
$this->db = $this->toolkit->getDbConnection();
... | [
"function __construct($args)\n {\n if (!empty($args['map']))\n {\n $this->map = $args['map'];\n } \n \n $this->path = $args['path'];\n \n $this->has_kladr = file_exists($this->path . \"/KLADR.DBF\");\n if ($args['streets'])\n { \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the task id for this object | public function setid($id)
{
if (empty($this->taskid)) {
$this->taskid = $id;
// Fetch the tasks info from the database
$this->fetchProperties();
// Check this task is owned by this owner
$user = new user();
$googleAuth_... | [
"public function setIDTask ($idTask) {\n\t\t$this->_idTask = $idTask;\n\t}",
"public function setTaskID($task_id){\r\n\t\t$this->task_id = $task_id;\r\n\t}",
"public function setTask_id($task_id)\n {\n $this->task_id = $task_id;\n\n return $this;\n }",
"public function setTaskSetID($tasksetid) {\n\t\t$this-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delay sync action to ensure that all post meta is saved before SP syncs. | protected function delay_sync_actions() {
if ( class_exists( 'SP_Sync_Manager' ) && has_action( 'save_post', [ SP_Sync_Manager(), 'sync_post' ] ) ) {
remove_action( 'save_post' ,[ SP_Sync_Manager(), 'sync_post' ] );
add_action( 'save_post', [ SP_Sync_Manager(), 'sync_post' ], 1000 );
}
} | [
"public function afterSyncing() {}",
"public function afterPostImport() {\n\t\t$this->resumeSyncHooks();\n\t}",
"public function testPostSync() {\n\t\t$sites = ep_get_sites();\n\n\t\tforeach( $sites as $site ) {\n\t\t\tswitch_to_blog( $site['blog_id'] );\n\n\t\t\tadd_action( 'ep_sync_on_transition', array( $thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get All Requisition Comments By Requisition Id | public function getAllRequisitionCommentsByRequisitionId($id)
{
$sql = "
SELECT
`requisition_comments`.`comment` as requisition_comment,
`requisition_comments`.`datetime_added` as comment_datetime_added,
`users`.`firstname` as user_firstname,
`users`.`lastname` as user_lastname
FROM
`requi... | [
"public function getAllInvoiceCommentById($id)\n {\n return DB::table( Database::COMMENT)->where('invoice_id', $id)->get();\n }",
"public function getAllInvoiceComments($invoice_id = NULL)\n {\n\treturn $this->setRequestData(sprintf(self::RESOURCE_INVOICE_COMMENTS, $invoice_id));\n }",
"publi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ static function sets the id of the groupunit using their groupid | function setGroupUnitID($groupId)
{
global $default;
$id = lookupID($default->groups_units_table, "group_id", $groupId);
$this->iId= $id;
} | [
"public function setGroup($id);",
"public function setIdGroup($idGroup){\n $this->idGroup = $idGroup;\n\n }",
"function set_group_id($value, $index=NULL) {\n\t\t$this->_data['cell_id'] = $value;\n\t}",
"public function setIdGroup($id_group)\n\t{\n\t\t$this->id_group = $id_group;\n\t\treturn $this;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test get/set placementDescription methods | public function testGetPlacementDescription()
{
$object = new ItemDescriptor();
$object->setPlacementDescription("none");
$actualValue = $object->getPlacementDescription();
$this->assertEquals($actualValue, "none");
} | [
"public function testSetGetDescription()\n {\n $this->item->setDescription('A fine javelin, suitable for throwing at retreating enemies.');\n $this->assertEquals($this->item->getDescription(), 'A fine javelin, suitable for throwing at retreating enemies.');\n }",
"abstract protected function g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get active emails quantity | public function getActiveEmailQty(): int
{
return $this->activeEmailQty;
} | [
"public function getActiveEmailQty(): int;",
"public function getInactiveEmailQty(): int\n {\n return $this->inactiveEmailQty;\n }",
"public function getNbOfEMailings()\n\t{\n\t\t$sql = \"SELECT count(mc.email) as nb\";\n\t\t$sql.= \" FROM \".MAIN_DB_PREFIX.\"mailing_cibles as mc\";\n\t\t$sql.= \" ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a form to create a Evento entity. | private function createCreateForm(Evento $entity)
{
$form = $this->createForm(new EventoType(), $entity, array(
'action' => $this->generateUrl('evento_create'),
'method' => 'POST',
));
$form->add('submit', 'submit', array('label' => 'Crear'));
return $form;
... | [
"private function createCreateForm(Event $entity)\n {\n $form = $this->createForm(new EventType(), $entity, array(\n 'action' => $this->generateUrl('organizer_event_create'),\n 'method' => 'POST',\n ));\n// $em = $this->getDoctrine()->getManager();\n// $defaultPa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a new ChildDocumentDateQuery object. | public static function create($modelAlias = null, Criteria $criteria = null)
{
if ($criteria instanceof ChildDocumentDateQuery) {
return $criteria;
}
$query = new ChildDocumentDateQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
... | [
"private function get_date_query( $args = array() ) {\n\t\treturn new Queries\\Date( $args );\n\t}",
"public function testQueryDateObject()\n {\n //The QueryDate\n $QueryDate = new MediaManager\\Analytics\\QueryDate('23-02-2016');\n\n //Check the default get\n $this->assertEquals('2... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
save notime shipmentId to table 'notime_shipping' | public function notime_shipping_save_shipment_id($event) {
if(!Mage::getStoreConfig('carriers/notime/active', Mage::app()->getStore()->getId())) return;
$_quote = $event->getQuote();
$request = Mage::app()->getRequest();
$shipmentId = trim($request->getPost('notime_shipment_id'));
... | [
"public function saveShipment(ShipmentRequest $request){\n\t\t$shipmentRequest = $request->all();\n\t\t$shipment = new Shipment($shipmentRequest);\n\t\t$shipment->save();\n\t\treturn $shipment->id;\n\t}",
"private function saveShipmentTrackingNoAction()\n\t\t{\n\t\t\tif(empty($_POST['id'])) {\n\t\t\t\texit;\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render passports and VISAs. | public function render_passports() {
$passports = $this->get_meta( 'passports' );
if ( empty( $passports ) ) {
$passports = [];
}
$visas = $this->get_meta( 'visas' );
if ( empty( $visas ) ) {
$visas = [];
}
if ( empty( $visas ) && empty( $passports ) ) {
return;
}
// Merge passports and ... | [
"function render(){\r\n\t\t\t$this->auth->is_auth() ? $this->index->state['user']() : $this->index->state['guest']();\r\n\t\t}",
"public function renderView()\n\t{\n\t}",
"public function render() {\n /* if the user and view(s) are defined, \n * assign the user session to the view(s)\n */... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Class Edit Income Info function | public function edit($income_code)
{
$data['page_name'] = 'income_entry/edit_income_entry';
$data['page_title'] = 'Income Entry';
$data['income_info']=$this->income_entry->get_income_info_to_update($income_code);
$this->load->view('backend/index',$data);
} | [
"public function update(){\n $this->tax = $this->getTax();\n echo \"The new tax in the USA is: \". $this->tax .\" as of today.\";\n }",
"public function update(){\n $this->tax = $this->getTax();\n echo \"The new tax in Canada is: \". $this->tax .\" as of today.\";\n }",
"public functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the Redirect URL using either the config loginRedirect or the Auth.redirect (Default). | public function redirectUrl()
{
if ($redirectUrl = $this->Session->read('Auth.redirect')) {
$this->Session->delete('Auth.redirect');
return $redirectUrl;
}
return $this->config['loginRedirect'];
} | [
"protected function getRedirectUrl()\n {\n return $this->getParameter('redirectUrl');\n }",
"public function getRedirectUrl();",
"public function getRedirectLoginUrl()\n {\n $loginUrl = $this->getWordpress()->getBlogInfo('wpurl')\n .'/wp-login.php?redirect_to='.urlencode($_SERVER['REQU... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
is the provided template drag and drop? if so, filter down the scorecards | protected function isRanked(ScorecardCollection $scorecards, ScorecardTemplate $template)
{
if($template->type == 'R') {
return $scorecards->filterRanked();
}
return $scorecards;
} | [
"protected function filterScorecardsByTemplate($scorecards, $template_id)\n\t{\n\t\treturn $scorecards->filter(function($sc) use($template_id) {\n\t\t\treturn $sc->template_id == $template_id;\n\t\t});\n\t}",
"public function filter_boardingCards(){\r\n\t\tfor($i=0;$i<$this->boardingCards_num;$i++){\r\n\t\t\tif(s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process put sides of the strat. | private function _process_put_side($row, $hour, $rsi_index)
{
// If we do not have an open trade we see if this is the time to open one.
// We also do not put trades on late in the date.
if(is_null($this->open_trade) && ($hour < 12))
{
// Check to see if the RSI reading is under 30
if($rsi_index[$row['Da... | [
"function place($nile_id,$side){\n\t\t$current_side = FIND_KEY_BY_VALUE($this->neighbors,$nile_id);\n\t\tINFO(__METHOD__.\" put $nile_id on $side \");\n\t\tINFO(__METHOD__.\" Current side $current_side \");\n\t\tif(Strings::Same($current_side,$side)){\n\t\t\treturn;\n\t\t}\n\t\t//Put NILE on TOP\n\t\tswitch($cur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the [fact_destinataire] column value. | public function getFactDestinataire()
{
return $this->fact_destinataire;
} | [
"public function getCidadeDestino()\n {\n return $this->cidadeDestino;\n }",
"public function getDestinataireId()\r\n {\r\n return $this->destinataireId;\r\n }",
"public function getDestino()\n {\n return $this->destino;\n }",
"public function getDestino()\r\n {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return assignees implementation instance for this object | function assignees() {
if($this->assignees === false) {
$this->assignees = new ISubtaskAssigneesImplementation($this);
} // if
return $this->assignees;
} | [
"public function assignees()\n {\n return $this->hasMany(Assignee::class, 'task_id');\n }",
"public function getAssignees(): Generator\n {\n return $this->fetch(sprintf('%s/assignees', $this->url));\n }",
"public function getAssignee()\n {\n return $this->hasOne(Assignee::cla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets up the available routes for the resource. | protected function setUpRoutes()
{
} | [
"public function setRoutes(): void\n {\n $versions = $this->_versions;\n $default = 'api/v1/v0';\n\n Router::scope('/api', function ($routes) use ($versions, $default) {\n // Setting up fallback non-versioned API url calls.\n // It can handle `api/controller/index.json`... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Restituisce la data di partenza di ricerca | public function getDataPartenzaRicerca() {
if (isset($_REQUEST['data_partenza_ricerca'])) {
return $_REQUEST['data_partenza_ricerca'];
} else
return 0;
} | [
"public function getDatiCreaPartita() {\n\t\t$dati_richiesti=array('Titolo','Indirizzo','Descrizione','Data', 'Ora', 'Minuti', 'Giocatori', 'Attrezzatura','Prezzo', 'Categoria', 'Partecipazione');\n\t\t$dati=array();\n\t\tforeach ($dati_richiesti as $dato) {\n\t\t\tif (isset($_REQUEST[$dato]))\n\t\t\t\t$dati[$dato]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if featured system are enable or not | function et_is_enable_feature(){
$job_option = new ET_JobOptions();
return $job_option->use_feature();
} | [
"public function is_featured()\n {\n }",
"public function isSystemOn()\n\t{\n\t\treturn Craft::isSystemOn();\n\t}",
"function getEnabled() {\n\t\tif (!Config::getVar('general', 'installed')) return true;\n\t\treturn parent::getEnabled();\n\t}",
"public function actionCheckFeatured() {\n $... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update update(array $u_data) if not include where, all columns will update | public function update(array $u_data) {
$pre_data = "";
foreach ($u_data as $key => $value) {
$pre_data .= $key . " = ";
if(gettype($value) == "string") {
$pre_data .= "'" . $value . "', ";
}
else {
$pre_data .= $value . ", ... | [
"function update($table, $data, $where=''){\n\t\t$data = $this->checkFields($table, $data);\n\t\tforeach($data as $column=>$value){\n\t\t\t$v_arr[] = \"$column='$value'\";\n\t\t}\n\t\t$sql = \"UPDATE $table SET \".implode(\",\", $v_arr).\" \".$where;\n\t\t$this->exec($sql);\n\t}",
"function update_data($table,$co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Redirect Historical to New Permalink Structure /%year%/%postname%/ => /%__coauthor%/%year%/%monthnum%/%postname%/ | public function redirect_historical( $wp ) {
$pagename = isset( $wp->query_vars['pagename'] ) ? $wp->query_vars['pagename'] : false;
if ( ! $pagename ) return;
$parts = explode( '/', $pagename );
$count = count( $parts );
if ( $count === 1 ) return;
if (
$parts[0] === 'author' &&
strlen( $parts[1] ... | [
"public function update_permalinks() {\n\t\tglobal $wp_rewrite;\n\t\t$wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');\n\t}",
"public function archive_redirect() {\n\t\tglobal $wp_query;\n\n\t\tif ( $wp_query->is_date || $wp_query->is_author ) {\n\t\t\t$this->redirect( home_url( '/' ),... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ ===================== Folderize If the path part of the current URL does not end with "/", redirect with a "/" appended. This sets all relative URLs accessed from the page below the current path instead of alongside the last part. This is done with a 301 permanent redirect. Returns true if the redirect was done. ====... | public static function Folderize()
{
$parts = explode( "?", self::$url );
if ($parts[0][ strlen($parts[0]) - 1 ] != '/') {
$parts[0] .= '/';
$url = implode( '?', $parts );
self::Redirect( $url );
return true;
}
return false;
} | [
"private function tryDirectoryRedirect() {\n\t\tif (config('app.redirect_to_directories', true) === false) {\n\t\t\treturn false;\n\t\t}\n\n\t\tProfiler::record('Check for directory redirection');\n\n\t\tif (substr($this->request->path(), -1) !== \"/\") {\n\t\t\t$originalUri = $this->request->path();\n\t\t\t$origin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation foldersRenameAsync This method allows to rename a folder | public function foldersRenameAsync($name, $id)
{
return $this->foldersRenameAsyncWithHttpInfo($name, $id)
->then(
function ($response) {
return $response[0];
}
);
} | [
"public function renameFolder(string $old, string $new): Response;",
"public function testRenameFolder() {\n $this->objFromFixture('Member', 'apiuser')->login();\n \n\n //Test renaming a folder\n $response=$this->getAMFResponse('Snippets.renameFolder', array(\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the original url found in DB. Empty string is returned if no record was found. | function fetchOriginalUrl($short_url, $pdo = NULL) {
if (is_null($short_url) or $short_url === ''){
return '';
}
if (is_null($pdo)) {
$pdo = new PDO('mysql:host=localhost;dbname='.DB_NAME, DB_USER, DB_PASSWORD);
}
$stm = $pdo->prepare('SELECT original_url FROM url WHERE short_url = :short_url AND is_de... | [
"protected function getUrlFromDB()\n {\n if ($longUrl = $this->request->getData('long_url')) {\n return $this->Urls->findByLongUrl($longUrl)\n ->select(['id'])\n ->first();\n }\n }",
"public function getOriginalLink()\n {\n if (!isset($this->d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end public function input_font_active create the ui element for field border_active | public function input_border_active( $params )
{
//tpl: class ui:colorpicker
$inputBorderActive = $this->view->newInput( 'input'.$this->prefix.'BorderActive' , 'Colorpicker' );
$this->items['border_active'] = $inputBorderActive;
$inputBorderActive->addAttributes
(
array
... | [
"public function get_font_color_control() {\n\t\t\t// Variables used in view\n\t\t\t$value = $this->value('font_color');\n\t\t\t$default_color = $this->default['font_color'];\n\t\t\t$current_color = isset( $value ) ? $value : $default_color;\n\n\t\t\t// Get control view\n\t\t\t?>\n <label><?php _... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the update_restaurant method updates an existing restaurant in the database. Details of the restaurant are posted in a form. Return true if succeed; false otherwise. | public function update_restaurant($id)
{
//if the script did not received post data, display an error message and then terminate the script immediately
if (!filter_has_var(INPUT_POST, 'name') ||
!filter_has_var(INPUT_POST, 'phone') ||
!filter_has_var(INPUT_POST, 'address') ||... | [
"public function updated(Restaurant $restaurant)\n {\n //\n }",
"public function updateRestaurant($restaurantId, $description, $address, $phoneNum) {\r\n $sql = \"UPDATE restaurant SET description=:description, address=:address, phone_no=:phoneNum \"\r\n . \" WHERE restaurant_id... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Locate class Block Node | protected function _getClassBlockNode($className)
{
if (!isset($this->_cache_class_block[$className])) {
// Locate Class
$classNode = $this->_getClassNode($className);
if (VWP::isWarning($classNode)) {
$this->_cache_class_block[$className] = $cl... | [
"public function getBlockClass() {\n\t\t\treturn $this->block_class;\n\t\t}",
"public static function getBlock($className) {\r\n if ($class = self::getClassPath($className)) {\r\n $className = _CL_NAMESPACE_ . '_Core_' . $class['name'];\r\n\r\n //set the model name for this class\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets sub settings that the setting should contain. | public function get_sub_settings() {
return array(
array(
'id' => 'site_url',
'title' => __( 'Custom Site URL', 'google-site-kit-dev-settings' ),
'description' => __( 'This will override your actual site URL, causing Site Kit to request and display insights for the site URL you enter her... | [
"public function getSubSettings(): array;",
"public function getSubsetting()\n {\n return $this->subsetting;\n }",
"abstract public function getSettings();",
"public function getAll()\n\t{\n\t\treturn $this->settings;\n\t}",
"public function getSettings();",
"private function get_settings()\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Listen to the Category updated event. | public function updated(Category $Category)
{
//code...
} | [
"public function track_product_category_updated($category_id)\n {\n }",
"protected function emitCategoryUpdated(\\Lelesys\\Plugin\\News\\Domain\\Model\\Category $category) {\n\n\t}",
"protected function categoryChanged() {\n if ( $url_tag_id = $this->get('url_tag_id') ) {\n // Up... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fucntion to return dns packet(s) | public function pack_dns_packet() {
$this->dns_packet = chr(0).chr(1).
chr(1).chr(0).
chr(0).chr(1).
chr(0).chr(0).
chr(0).chr(0).
chr(0).chr(0).
$this->QNAME.
... | [
"private function dns_get_record($address)\n {\n $output = $dns = array();\n $retval = false;\n if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')\n {\n @exec('nslookup -type A '.$address, $output, $retval);\n if (!$retval and array_key_exists(1, $output))\n {\n $output[0] = $output[1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the permission callback. | public function permission(Closure $callback)
{
$this->permission = $callback;
} | [
"public function setPermission($value);",
"public function setPermission($permission);",
"public function setPermissionCallback($permissionCallback)\n {\n $this->permissionCallback = $permissionCallback;\n\n return $this;\n }",
"public function setPermissionGranted();",
"public function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the public 'liip_imagine.filter.loader.crop' shared service. | protected function getLiipImagine_Filter_Loader_CropService()
{
return $this->services['liip_imagine.filter.loader.crop'] = new \Liip\ImagineBundle\Imagine\Filter\Loader\CropFilterLoader();
} | [
"protected function getLiipImagine_Filter_Loader_StripService()\n {\n return $this->services['liip_imagine.filter.loader.strip'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\StripFilterLoader();\n }",
"protected function getLiipImagine_Filter_Loader_PasteService()\n {\n return $thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Output start menu array | function print_start_menu_array()
{
global $conf;
print '<div class="tmenudiv">';
print '<ul role="navigation" class="tmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Top menu"').'>';
} | [
"protected function generateMenu() {}",
"function drawMenu() {\n\n system(\"clear\");\n mainHeader();\n\n echo \"(1) import file\\n\";\n echo \"(2) drop word indexes\\n\";\n echo \"(3) create word index\\n\";\n echo \"(0) Exit!\\n\";\n echo \"----------------------------\\n\\n\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |