query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Get a newsletter list id by the slugified name.
public function get_newsletter_list_id_by_slug( string $slug = '' ) : string { $newsletter_lists = (array) $this->get_option( 'newsroom-settings', 'newsletter', 'mailchimp_lists', 'lists' ); // Return the list id that corresponds to this slug. foreach ( $newsletter_lists as $list ) { if ( sanitize_title( $list['name'] ) === $slug ) { return $list['id']; } } // Return first value as a default value. return $newsletter_lists[0]['id'] ?? ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_id_from_blogname($slug)\n {\n }", "public function getListId();", "protected function getListId($strList)\n\t{\n\n\t\t$arrLists = $this->api->lists();\n\t\tforeach($arrLists['data'] as $list)\n\t\t{\n\t\t\tif ($list['name']==$strList)\n\t\t\t\treturn $list['id'];\n\t\t}\n\t\treturn null;\n\n...
[ "0.63937783", "0.6365867", "0.6194987", "0.60476315", "0.6009202", "0.6006033", "0.59316283", "0.58851385", "0.5818528", "0.5762376", "0.5753282", "0.5641002", "0.5600172", "0.5552371", "0.54814565", "0.5470993", "0.53987837", "0.53985", "0.53564936", "0.5345052", "0.52916986...
0.7455327
0
Register Gutenberg blocks for this component.
public function register_blocks() { if ( function_exists( 'register_block_type' ) ) { register_block_type( "civil/{$this->slug}", [ 'editor_script' => 'block-js-' . $this->slug, 'render_callback' => function( array $attributes ) { return $this->render_block_data( $attributes ); }, 'attributes' => [ 'title' => [ 'type' => 'text', 'default' => __( 'CTA Title', 'civil-first-fleet' ), ], 'cta_text' => [ 'type' => 'text', 'default' => __( 'CTA Description', 'civil-first-fleet' ), ], 'cta_button_text' => [ 'type' => 'text', 'default' => __( 'CTA Button', 'civil-first-fleet' ), ], 'newsletter' => [ 'type' => 'boolean', ], 'newsletter_list' => [ 'type' => 'text', ], ], ] ); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_blocks() {\n\t\t}", "public function registerBlocks(): void\n\t{\n\t\tforeach (Components::getBlocks() as $block) {\n\t\t\t$this->registerBlock($block);\n\t\t}\n\t}", "function register_block() {\n\n\t// Define our assets.\n\t$editor_script = 'build/index.js';\n\t$editor_style = '...
[ "0.7944318", "0.7940284", "0.74017155", "0.7388673", "0.7385046", "0.7348771", "0.7309499", "0.7302173", "0.7278604", "0.72688156", "0.72652555", "0.7245643", "0.7095067", "0.70712817", "0.70670027", "0.69964504", "0.6961915", "0.69473207", "0.6946324", "0.6918326", "0.689939...
0.7379821
5
Format Gutenberg block data to appear in the component template and render it.
public function render_block_data( $attributes ) { $type = ! empty( $attributes['newsletter'] ) ? 'newsletter' : 'subscribe'; $this->set_setting( 'type', $type ); $this->set_setting( 'layout', 'inline' ); $this->set_setting( 'newsletter', $attributes['newsletter_list'] ?? '' ); $this->set_data( 'title', $attributes['title'] ?? 'Test' ); $this->set_data( 'description', $attributes['cta_text'] ?? 'Whatever' ); $this->set_data( 'button_text', $attributes['cta_button_text'] ?? '' ); return ai_partial( [ 'slug' => $this->get_component_path( $this->setting( 'type' ) ), 'return' => true, 'variables' => [ 'component' => $this, 'stylesheet' => $this->slug, ], ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render( $block_data )\n\t{\n\t\treturn \"<\".$block_data['header_type'].\">\".$block_data['h_content'].\"</\".$block_data['header_type'].\">\";\n\t}", "function page_render_block($block) {\n static $xtpl_block;\n \n if (!$xtpl_block) $xtpl_block = new XTemplate('html/block.xtpl');\n \n $x...
[ "0.75445247", "0.67666394", "0.6595602", "0.6538642", "0.6501218", "0.64389527", "0.63021046", "0.6294761", "0.6289585", "0.62679476", "0.6239257", "0.6232958", "0.6161073", "0.6139421", "0.6131822", "0.6123884", "0.60948426", "0.60728", "0.6001656", "0.5992444", "0.5983275",...
0.61081356
16
Expose newsletter options for CTA block
public function provide_newsletter_options() { wp_add_inline_script( 'civil-first-fleet-admin-js', sprintf( 'var civilNewsletterOptions = %1$s;', wp_json_encode( $this->get_newsletter_options_for_gutenberg() ) ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function optinpanda_subscription_services_options( $options ) {\r\n \r\n // mailchimp\r\n \r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-mailchimp-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => ...
[ "0.6402801", "0.59012383", "0.5846641", "0.58366555", "0.58024496", "0.57236177", "0.56400645", "0.5636054", "0.5607285", "0.5558025", "0.5546646", "0.5521867", "0.5508108", "0.5482793", "0.54770607", "0.5475041", "0.5465809", "0.5464011", "0.5455378", "0.5450994", "0.5410267...
0.7374673
0
Helper for creating new instances of this component.
function call_to_action( array $settings = [], array $data = [], array $fm_fields = [] ) : Call_To_Action { return new Call_To_Action( $settings, $data ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function create() {\n\t}", "public function create() {\n\t \n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function newInstance();", "public function newInstance();", "public function new()\n\t{\n\t\t//\n\t...
[ "0.67847914", "0.6752442", "0.6668784", "0.6668784", "0.6668784", "0.6665173", "0.6665173", "0.6633438", "0.6633438", "0.6619607", "0.6607726", "0.6590344", "0.6587409", "0.6587409", "0.658727", "0.6584584", "0.65551203", "0.6550108", "0.6527658", "0.65139335", "0.65139335", ...
0.0
-1
Handle newsletter form submissions.
function newsletter_submission_ajax() { /** * Validate nonce. */ if ( ! isset( $_POST['newsletter_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['newsletter_nonce'] ) ), 'civil_newsletter_nonce' ) ) { wp_send_json_error( __( 'Something went wrong! Reload the page and try again.', 'civil-first-fleet' ) ); } /** * Validate email. */ if ( empty( $_POST['email'] ) ) { wp_send_json_error( __( 'Please provide an email.', 'civil-first-fleet' ) ); } $email = sanitize_text_field( wp_unslash( $_POST['email'] ) ); // Invalid email. if ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) ) { wp_send_json_error( __( 'Email is invalid, please enter a valid email address (i.e. email@example.com).', 'civil-first-fleet' ) ); } /** * Validate mailchimp list slug. */ $list = ''; if ( ! empty( $_POST['list'] ) ) { // Get sanitized list slug. $list = sanitize_text_field( wp_unslash( $_POST['list'] ) ); } /** * Get various settings. */ $call_to_action = new Call_To_Action(); $newsletter_list_id = $call_to_action->get_newsletter_list_id_by_slug( $list ); $mailchimp_api_key = $call_to_action->get_option( 'newsroom-settings', 'newsletter', 'mailchimp_api_key' ); $success_message = $call_to_action->get_option( 'newsroom-settings', 'newsletter', 'success_message' ); // Validate newsletter list id. if ( empty( $newsletter_list_id ) ) { wp_send_json_error( __( 'No email list found.', 'civil-first-fleet' ) ); } // Fallback success message. if ( empty( $success_message ) ) { $success_message = __( 'Thank you for subscribing!', 'civil-first-fleet' ); } // Mailchimp is not configured for this site. if ( empty( $mailchimp_api_key ) ) { wp_send_json_error( __( 'Mailchimp is not configured properly.', 'civil-first-fleet' ) ); } // Get the domain. $domain = substr( $mailchimp_api_key, strpos( $mailchimp_api_key, '-' ) + 1 ); // Send data to Mailchimp. $response = wp_remote_post( 'https://' . $domain . '.api.mailchimp.com/3.0/lists/' . $newsletter_list_id . '/members', [ 'headers' => [ 'Authorization' => 'Basic ' . base64_encode( 'user:' . $mailchimp_api_key ), 'Content Type' => 'application/json', ], 'body' => wp_json_encode( [ 'email_address' => $email, 'status' => 'subscribed', ] ), ] ); // Check response. if ( is_wp_error( $response ) ) { wp_send_json_error( $response->get_error_message() ); } // Get response body. $body = json_decode( wp_remote_retrieve_body( $response ), true ); // New subscription confirmed. if ( ! empty( $body['id'] ) ) { wp_send_json_success( $success_message ); } // Generic error if title and detail are unavailable. if ( empty( $body['title'] ) || empty( $body['detail'] ) ) { wp_send_json_success( esc_html__( 'Something went wrong. Unknown error.', 'civil-first-fleet' ) ); } // Determine which response to use. switch ( $body['title'] ) { case 'Member Exists': $message = __( 'You are already subscribed to this list. Thanks!', 'civil-first-fleet' ); break; default: $message = $body['detail']; } wp_send_json_success( $message ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function index() {\n\t\tif($this->RequestHandler->isPost()) {\n\n\t\t\tprint_r($this->data);\n\t\t\tdie;\n\n\t\t\tif($this->FormNewsletter->save($this->data)) {\n\n\t\t\t}\n\t\t}\n\n\t}", "function simplenews_admin_newsletter_form_submit($form, &$form_state) {\n //dpm($form_state);\n $op = isset($form_state['v...
[ "0.727666", "0.67628634", "0.667265", "0.64187956", "0.64120746", "0.6406954", "0.6321864", "0.62122965", "0.6210184", "0.61502266", "0.6147232", "0.6138065", "0.6117792", "0.61030376", "0.60886616", "0.6085357", "0.60726976", "0.60506487", "0.6049155", "0.60348487", "0.60304...
0.669795
2
Retrieves the note object with required associated entities to populate the table and back links
private function getNote($noteId) { return $this->restClient->get( 'note/' . $noteId, 'Note', ['notes', 'client', 'client-users', 'current-report', 'report-id', 'note-client', 'user'] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function note()\n {\n return $this->hasOne('App\\Note');\n }", "public function getNotes();", "public function getNote();", "public function show(Note $note)\n {\n $note->load('card');\n $note->load('user');\n return $note;\n }", "public function getNote()\n ...
[ "0.64464825", "0.6199639", "0.607955", "0.59363973", "0.58607846", "0.5842101", "0.58379894", "0.5822413", "0.58024", "0.57963854", "0.5746308", "0.57230115", "0.56952125", "0.5677816", "0.56392133", "0.56387514", "0.55995524", "0.5586624", "0.5586604", "0.55766606", "0.55692...
0.52841705
63
compruebo si existe la variable
public function eliminar() { if (isset ($_REQUEST['id'])){ $id=$_REQUEST['id']; $miConexion=HelperDatos::obtenerConexion(); $resultado=$miConexion->query("call eliminar_rubro($id)"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function has(string $variable): bool;", "public function has(string $variableName): bool;", "public static function exists($_name) {\n\t\tif (!$_name) {\n\t\t\ttrigger_error(self::TEXT_Variable);\n\t\t\treturn array(FALSE,NULL);\n\t\t}\n\t\t$_var=&self::ref(self::resolve($_name));\n\t\treturn isset($_va...
[ "0.5389594", "0.52625084", "0.52565646", "0.52349865", "0.51573074", "0.51278126", "0.5113274", "0.5096186", "0.5081764", "0.50625914", "0.50559837", "0.50527334", "0.50504106", "0.5038977", "0.5027071", "0.5021214", "0.4971078", "0.49602044", "0.49449673", "0.4942937", "0.49...
0.0
-1
Return the correct error constant for a specified type.
public static function getTypeError( $type ) { $data = [ Type::INTEGER => static::INTEGER, Type::FLOAT => static::FLOAT, Type::BOOLEAN => static::BOOLEAN, Type::TIMESTAMP => static::TIMESTAMP, Type::DATETIME => static::DATETIME, Type::DATE => static::DATE, Type::TIME => static::TIME, Type::YEAR => static::YEAR, Type::IP => static::IP, Type::EMAIL => static::EMAIL, Type::URL => static::URL, Type::JSON => static::JSON, Type::OBJECT => static::VALUE, ]; return isset($data[$type]) ? $data[$type] : static::VALUE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getErrorForType($errorType) {\n switch($errorType) {\n default:\n case 'no_error':\n $this->addMsg(\n MSG_WARNING,\n $this->_gt('The action failed, but no error was triggered. Something`s wrong here.')\n );\n break;\n case 'path_not_found':\n $this->addMsg(MSG...
[ "0.7035882", "0.69569284", "0.6695219", "0.6695219", "0.6582162", "0.6554966", "0.65529144", "0.6403434", "0.62343675", "0.62272364", "0.6129866", "0.60431916", "0.5985268", "0.59731704", "0.5966196", "0.5944607", "0.592055", "0.58545244", "0.5790182", "0.57803136", "0.575693...
0.6753201
2
Preparamos un array con las clases a cargar
function carga_clases($clase) { $ficheros = array(); $ruta = $_SERVER['DOCUMENT_ROOT']; $ficheros[] = $ruta."/../app/clases/slim/".$clase.".php"; $ficheros[] = $ruta."/../app/clases/funciones/".$clase.".php"; foreach ($ficheros as $key => $fichero) { if (file_exists($fichero)) include_once ($fichero); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadClasses()\n\t\t{\n\t\t\t// foreach($GLOBALS['classes'] as $var => $class)\n\t\t\t// {\n\t\t\t\t// $this->$var = $class;\n\t\t\t// }\n\t\t\t\n\t\t\t// $this->load = _new('loader');\n\t\t\t\n\t\t\t/** Registramos todos os objetos que serão necessários **/\n\t\t\tforeach(Registry::getAll() as $va...
[ "0.66470855", "0.62646455", "0.61982894", "0.61563396", "0.61517954", "0.61340576", "0.61304104", "0.60375494", "0.6016654", "0.6004739", "0.59652877", "0.59338295", "0.5901618", "0.5886792", "0.5843145", "0.5833798", "0.58225805", "0.58217704", "0.5797647", "0.5797647", "0.5...
0.0
-1
functions for our custom Roles Group the roles for easy reference
function eman_roles( $type='turner' ) { switch ( $type ) { case 'owner' : return array('owner','owners_rep','consultant'); break; case 'sub' : return array('subcontractor'); break; case 'pending' : return array('subscriber'); break; case 'turner' : return array('administrator','editor'); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function getRoles();", "public function roles();", "public function roles();", "public function roles();", "public function roles();", "function wp_roles()\n {\n }", "public function & GetRoles ();", "function egsr_custom_site_roles(){\n\n return Array ( \n // STAFF...
[ "0.7782521", "0.7696201", "0.7696201", "0.7696201", "0.7696201", "0.75370044", "0.749545", "0.72671574", "0.7242646", "0.72290826", "0.7210035", "0.71732897", "0.71664774", "0.7130352", "0.7130352", "0.7130352", "0.71055824", "0.708331", "0.70611787", "0.70392215", "0.7025081...
0.6185253
88
Is the post allowed to be edited. This does not check if the current user has permission, just whether a post is currently in a status that is editable by a permitted user.
function eman_post_editable( $post ) { if ( is_numeric($post) ) $post = get_post($post); if ( ! is_object($post) ) return false; // Settings area always editable if ( emanager_post::is_settings($post) ) return true; $status = emanager_post::status($post, 'slug'); // If no status yet or is in draft or revise, it is editable if ( 'draft' == $status || 'revise' == $status ) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function canEditPost(Post $post) {\n return ($this->isAdmin() || ($this->id == $post->getCreatorId()));\n }", "public function getUserCanEditAttribute()\n {\n return AccessControl::check($this, 'edit_post', false);\n }", "function canEdit() {\r\n\t\tif($this->owner->ID == Member::current...
[ "0.82246447", "0.8179985", "0.8062197", "0.7820332", "0.7810295", "0.7804649", "0.77726203", "0.7768972", "0.76149523", "0.75322396", "0.7519968", "0.7509877", "0.7421341", "0.74180424", "0.7360027", "0.72776985", "0.7257722", "0.7231762", "0.7213345", "0.7176713", "0.7174331...
0.7700109
8
Does the user have permission to edit the post
function eman_can_edit( $post, $user_id=false ) { /** * If you can't view this post, then you can't edit it... */ if ( ! eman_can_view($post, $user_id) ) return false; if ( is_numeric($post) ) $post = get_post($post); if ( ! is_object($post) ) return false; if ( ! $user_id ) $user_id = get_current_user_id(); $user = get_user_by('id', $user_id); $status = emanager_post::status($post, 'slug'); $bic_userlogin = emanager_bic::get_bic($post, 'user_login'); /** * Test if user has capability to edit */ // Issues have different criteria if ( 'em_issue' == $post->post_type ) { // Original author if ( emanager_post::is_author($post) || emanager_post::same_company_as_post($post) || eman_check_role('turner') ) { return true; } } // PCO Request exception for allowances. Allow user to edit if in their court and status is before sent to owner. if ( 'em_noc' == $post->post_type ) { if (($bic_userlogin === $user->user_login) && in_array($status, array('draft','manager','ready'))) { return true; } if (eman_check_role('turner') && in_array($status, array('draft'))) { return true; } } // If the post is editable if ( eman_post_editable($post) ) { // Original author if ( emanager_post::is_author($post) ) { return true; } // Same company as original author elseif ( emanager_post::same_company_as_post($post) ) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserCanEditAttribute()\n {\n return AccessControl::check($this, 'edit_post', false);\n }", "function canEditPost(Post $post) {\n return ($this->isAdmin() || ($this->id == $post->getCreatorId()));\n }", "public function canEdit()\n {\n if(!Auth::check())\n ...
[ "0.84221214", "0.83484954", "0.8106697", "0.8041006", "0.8019068", "0.80131185", "0.7856465", "0.778718", "0.7748919", "0.77367485", "0.7725223", "0.7720093", "0.76655984", "0.7615415", "0.7611155", "0.7602609", "0.75980103", "0.7595543", "0.7556069", "0.7499649", "0.7488245"...
0.7857166
6
Does the user have permission to edit the post
function eman_can_view( $post, $user_id=false ) { if ( is_numeric($post) ) $post = get_post($post); if ( ! $user_id ) $user_id = get_current_user_id(); // Turner can view anything if ( eman_check_role('turner', $user_id) ) return true; // Pending can't view anything if ( eman_check_role('pending', $user_id) ) return false; // Test a post_type generally if ( is_string($post) && get_post_type_object($post) ) { $post_type = $post; $is_post = false; } // Test a post specifically elseif ( is_object($post) ) { $post_type = $post->post_type; $is_post = true; // If BIC user, all set, they can view it if ( $user_id == emanager_bic::get_bic($post, 'ID') ) { return true; } } else { return false; } // Settings for post type $cpt = ( $settings = eman_post_types($post_type) ) ? $settings : array(); // Test settings permissions if ( ! empty($cpt['access']) ) { // Owners have no access to settings if ( eman_check_role('owner', $user_id) && ! in_array('owner', $cpt['access']) ) return false; // Subs have limited access to settings if ( eman_check_role('sub', $user_id) && ! in_array('sub', $cpt['access']) ) return false; } elseif ( eman_check_role('owner', $user_id) && ( ($is_post && 'noc' === eman_pco_or_noc($post)) || ( ! $is_post && 'em_noc' == $post_type && ! get_query_var('pco')) ) ) { return true; } else { return false; } if ( $is_post ) { // Test if user is in same company or created post if ( $is_post && (emanager_post::is_author($post) || emanager_post::same_company_as_post($post) || ('em_issue' == $post->post_type && eman_check_role('owner', $user_id)) | ('em_letter' == $post->post_type && eman_check_role('owner', $user_id)) ) ) return true; // If is NOC (not PCO), and is owner group, they can view if ( $is_post && 'pco' == eman_pco_or_noc($post) && eman_check_role('owner', $user_id) ) return true; return false; } else { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserCanEditAttribute()\n {\n return AccessControl::check($this, 'edit_post', false);\n }", "function canEditPost(Post $post) {\n return ($this->isAdmin() || ($this->id == $post->getCreatorId()));\n }", "public function canEdit()\n {\n if(!Auth::check())\n ...
[ "0.8423035", "0.83486325", "0.810801", "0.8040089", "0.8019035", "0.80128634", "0.7857617", "0.7856601", "0.7787601", "0.7748365", "0.77378696", "0.77264553", "0.7719297", "0.7666172", "0.76168805", "0.76111805", "0.7603423", "0.7599395", "0.7596366", "0.75558656", "0.7500102...
0.6938779
84
Test if the post is in a review phase, if so return the reviewer(s)
function eman_post_reviewable( $post ) { // Get current post status $status = emanager_post::status($post, 'slug'); if ( $status && ! in_array($status, array('void','approved','approve','draft','revise','executed')) ) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isReviewed() {\n\t\t$this->getReviewed();\n\t}", "function eman_can_review( $post, $user_id=false ) {\n\t// Get the post if an id was provide\n\tif ( is_numeric($post) ) { $post = get_post($post); }\n\t// If no post then nothing to review\n\tif ( ! is_object($post) ) { return false; }\n\n\t// Get...
[ "0.6868713", "0.6792641", "0.6603587", "0.65696305", "0.6429343", "0.63119996", "0.62915945", "0.6238787", "0.6211797", "0.59429663", "0.58551496", "0.5838472", "0.5837719", "0.58273524", "0.5820893", "0.5775277", "0.5742934", "0.5736777", "0.5731428", "0.57084596", "0.564400...
0.65818036
3
Test if the current user is assigned to review current post
function eman_can_review( $post, $user_id=false ) { // Get the post if an id was provide if ( is_numeric($post) ) { $post = get_post($post); } // If no post then nothing to review if ( ! is_object($post) ) { return false; } // Get current user if no user provided if ( ! $user_id ) $user_id = get_current_user_id(); // Test if owner review phase (doesn't require bic) $owner_review = false; $status = emanager_post::status($post, 'slug'); if ( 'em_noc' == $post->post_type && in_array($status, array('submitted','executed','recommend')) && eman_check_role('owner') ) {#( current_user_can('owner') || current_user_can('owners_rep') ) ) { return true; } // Test if the post is currently reviewable, returns the reviews if so if ( eman_post_reviewable($post) ) { if ( 'em_letter' === get_post_type( $post ) && current_user_can('manage_options') ) { return true; } elseif ( $user_id == emanager_bic::get_bic($post, 'ID') ) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isReviewed() {\n\t\t$this->getReviewed();\n\t}", "function eman_post_reviewable( $post )\n{\n\t// Get current post status\n\t$status = emanager_post::status($post, 'slug');\n\tif ( $status && ! in_array($status, array('void','approved','approve','draft','revise','executed')) ) {\n\t\treturn true;...
[ "0.69660896", "0.67894876", "0.6661757", "0.6377939", "0.6295337", "0.6227289", "0.61742353", "0.6137929", "0.6101535", "0.6080368", "0.6060328", "0.6013452", "0.59922814", "0.59704626", "0.5955485", "0.5945179", "0.59166694", "0.59101945", "0.58834374", "0.5868263", "0.58632...
0.72695756
0
add a payment method into the pool.
public function addMethod(PaymentInterface $instance): void { if (null === $instance->getCode()) { throw new \RuntimeException(sprintf('Payment handler of class %s must return a code on getCode method. Please refer to the documentation (https://sonata-project.org/bundles/ecommerce/master/doc/reference/bundles/payment/index.html)', \get_class($instance))); } $this->methods[$instance->getCode()] = $instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_payment_method() {\n\t\t$this->log('add_payment_method called in Xendit');\n\t\tif ( empty( $_POST['xendit_token'] ) || ! is_user_logged_in() ) {\n\t\t\twc_add_notice( __( 'There was a problem adding the card.', 'xendit-woocommerce-gateway' ), 'error' );\n\t\t\treturn;\n\t\t}\n\n\n\t\tif ( is_w...
[ "0.64285123", "0.63144106", "0.6155572", "0.61236054", "0.60530025", "0.6011616", "0.59819007", "0.5875798", "0.5850535", "0.58154863", "0.57770324", "0.5771772", "0.57677287", "0.5737274", "0.5735655", "0.5734283", "0.57338744", "0.57293606", "0.5712686", "0.5706667", "0.568...
0.5714812
18
return a PaymentInterface Object.
public function getMethod($code) { return $this->methods[$code] ?? null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPaymentResource()\n {\n return new PaymentResource($this->paymentAdapter->getConfiguration(), new Curl());\n }", "public function createPayment() {\n $api = new ApiPayment($this->_clientId, $this->_clientSecret, $this->_isTest);\n return $api;\n }", "public function getPa...
[ "0.743964", "0.7359942", "0.72701216", "0.7057427", "0.69820875", "0.6887184", "0.67597795", "0.6679508", "0.66530794", "0.6619033", "0.65809214", "0.6579237", "0.6428244", "0.64203614", "0.6407989", "0.6407989", "0.6407989", "0.64060456", "0.63535506", "0.6353416", "0.633886...
0.0
-1
Test bad gender value
public function testBadGender() { $gender1 = new GenderEntity(); $gender1->setGender('w'); $this->_em->persist($gender1); $this->_em->flush(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isGenderUnknown() {\n\tglobal $USER;\n\tif(!isset($USER['gender'])) return true; //If we don't know guess they aren't\n if($USER['gender']==\"u\") {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function _normalize_gender($value)\r\n{\r\n\t// normalize gender\r\n\tif ( is_string($value)...
[ "0.73266035", "0.69541395", "0.6916479", "0.68498904", "0.67447263", "0.66706026", "0.6614684", "0.65241253", "0.6401441", "0.638639", "0.6293059", "0.62637305", "0.619047", "0.6151729", "0.6070673", "0.60691273", "0.6065757", "0.602593", "0.5984099", "0.59706736", "0.5917554...
0.6907328
3
TODO: Implement calculateCurrency() method.
function calculateCurrency($prijs, $country) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCurrency();", "public function getCurrency();", "public function getSourceCurrency();", "public function getCurrency(): Currency;", "public function getCurrencyCode();", "public function getCurrencyCode();", "public function getCurrencyCode();", "public function getTargetCurrency()...
[ "0.79235417", "0.79235417", "0.7536152", "0.75107527", "0.73531413", "0.73531413", "0.73531413", "0.72994137", "0.7285341", "0.7284654", "0.7284654", "0.72460514", "0.7207526", "0.72067976", "0.72017", "0.7176202", "0.7124177", "0.7124177", "0.7124177", "0.7124177", "0.712417...
0.78123957
2
load page with initial data
public function index() { return Group::latest()->paginate(10); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadPage()\n\t{\n\t $data = $this->getData();\n \t \n\t $this->load->view('index', $data);\n\t}", "public function ee_breakouts_page_load() {}", "public function initPage() {}", "public function initPage() {}", "public function loadData()\n\t{\n\t\t$this->load->view('data_page');\n\...
[ "0.7552917", "0.73957604", "0.70848686", "0.70848686", "0.7008991", "0.664286", "0.64589596", "0.6418176", "0.64003956", "0.63648957", "0.6333083", "0.6283925", "0.6272305", "0.6236029", "0.6234139", "0.62139904", "0.62098414", "0.61889726", "0.6183714", "0.6144319", "0.61262...
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id...
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // update data $group = Group::findOrFAil($id); $this->validate($request, [ 'name' => 'required|string|max:255|min:2', ]); $group->update($request->all()); return ['message'=>'Getting id is: ' . $id]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { Group::findOrFail($id)->delete(); return ['message' => 'Group deleted successfully']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n ...
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897...
0.0
-1
sms config update form for sending sms
public function sms_configuration_form(){ $CI =& get_instance(); $CI->load->model('dashboard/Sms_model','sms_model'); $setting_detail = $CI->sms_model->retrieve_sms_editdata(); return $setting_detail; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function room_reservations_admin_settings_sms_submit($form_id, &$form_state) {\n if ($form_state['clicked_button']['#value'] == t('Save configuration')) {\n $sms_option = $form_state['values']['sms_option'];\n $confirmation = ROOM_RESERVATIONS_SAVE_CONFIRMATION_MSG;\n $error = ROOM_RESERVATIONS_SAVE_ERRO...
[ "0.7377929", "0.7066406", "0.6825808", "0.6762988", "0.65102875", "0.649229", "0.6467846", "0.641201", "0.639927", "0.6369663", "0.63397586", "0.6336609", "0.6266326", "0.62467176", "0.6231464", "0.6198391", "0.6107992", "0.60989505", "0.60700464", "0.60573393", "0.60550106",...
0.67104524
4
send sms after order completed
public function send_sms($order_no=null,$customer_id=null,$type=null){ $CI =& get_instance(); $CI->load->model('dashboard/Sms_model','sms_model'); $gateway = $CI->sms_model->retrieve_active_getway(); $sms_template = $CI->db->select('*')->from('sms_template')->where('type',$type)->get()->row(); $sms = $CI->db->select('*')->from('sms_configuration')->get()->row(); $customer_info=$CI->db->select('customer_phone')->from('customer_info')->where('customer_id',$customer_id)->get()->row(); $recipients = $customer_info->customer_phone; $sms_type= strtolower($sms_template->type); if($sms_type == "neworder" || $sms_type == "completeorder" || $sms_type == "processing" || $sms_type == "cancel"){ $message= str_replace('{id}', $order_no, $sms_template->message); } if(1 == $gateway->id ){ /**************************** * SMSRank Gateway Setup ****************************/ $CI =& get_instance(); $url = "http://api.smsrank.com/sms/1/text/singles"; $username = $gateway->user_name; $password=base64_encode($gateway->password); $message=base64_encode($message); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, "$url?username=$username&password=$password&to=$recipients&text=$message"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)'; curl_setopt($curl, CURLOPT_USERAGENT, $agent); $output = json_decode(curl_exec($curl), true); return true; curl_close($curl); } if( 2 == $gateway->id ){ /**************************** * nexmo Gateway Setup ****************************/ $api = $gateway->user_name; $secret_key = $gateway->password; $message = $message; $from = $gateway->sms_from; $data = array( 'from' => $from, 'text' => $message, 'to' => $recipients ); require_once APPPATH.'libraries/nexmo/vendor/autoload.php'; $basic = new \Nexmo\Client\Credentials\Basic($api, $secret_key); $client = new \Nexmo\Client($basic); $message = $client->message()->send($data); if(!$message) { return json_encode(array( 'status' => false, 'message' => 'Curl error: ' )); } else { return json_encode(array( 'status' => true, 'message' => "success: " )); } } if( 3 == $gateway->id ){ /**************************** * budgetsms Gateway Setup ****************************/ $message = $message; $from = $gateway->sms_from; $userid = $gateway->userid; $username = $gateway->user_name; $handle = $gateway->password; $data = array( 'handle' => $handle, 'username' => $username, 'userid' => $userid, 'from' => $from, 'msg' => $message, 'to' => $recipients ); $url = "https://api.budgetsms.net/sendsms/?"; $curl = curl_init($url); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); if(curl_errno($curl)) { return json_encode(array( 'status' => false, 'message' => 'Curl error: ' . curl_error($curl) )); } else { return json_encode(array( 'status' => true, 'message' => "success: ". $response )); } curl_close($curl); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function action_woocommerce_send_sms_order_completed($order_id) {\n $log = new WC_Logger();\n if(get_qt_options( 'enable_sms_completed_order' ) && get_qt_options( 'enable_sms_completed_order' ) == \"on\") {\n $sms = new SMS_Sender();\n $message = $sms->generateMessage( get_qt_options('sms_compl...
[ "0.7785686", "0.7736203", "0.70642453", "0.7045813", "0.6902287", "0.6810297", "0.672946", "0.66964304", "0.66045296", "0.6541491", "0.6518679", "0.6506084", "0.6487713", "0.64792156", "0.6429101", "0.63885206", "0.6361394", "0.63177717", "0.6299142", "0.6282297", "0.6272114"...
0.6545153
9
$shop = Shop::select('name','user_id')>groupBy('name','user_id')>get() ;
public function management_shop(){ //$quantity = Shop::select('name','user_id')->groupBy('name','user_id')->count(); $users = Users::where('role_id','2')->get(); return view('pages_admin.management_shop',['users'=>$users]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function wilaya_tags()\n {\n \n$DataWilayas = Colis::where('validation','=',true)->where(function ($query) {\n $query->where('id_stats','=',null)\n ->orWhere('id_stats','=',11);\n})->groupBy('wilaya')->pluck('wilaya')->toArray();\n\n//dd($DataWilayas);\n\nreturn response()->json($DataWilayas);\n\...
[ "0.62181747", "0.57488173", "0.572569", "0.5694601", "0.56368256", "0.5604074", "0.55893785", "0.55648404", "0.5559832", "0.55543333", "0.55288905", "0.5518318", "0.54968137", "0.5468685", "0.5451865", "0.5451865", "0.5434816", "0.5432675", "0.54074913", "0.53995085", "0.5378...
0.62329465
0
Perform postregistration booting of services.
public function boot() { $config_file = __DIR__.'/config/config.php'; $this->publishes([ $config_file => config_path('snap_scan.php'), ], 'config'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function boot()\n {\n\n $this->app->bind(FileUploaderServiceInterface::class,FileUploaderService::class);\n $this->app->bind(ShopServiceInterface::class,ShopService::class);\n $this->app->bind(CategoryServiceInterface::class,CategoryService::class);\n $this->app->bind(ProductS...
[ "0.7523447", "0.72817886", "0.720491", "0.71984196", "0.7176205", "0.71662176", "0.71574175", "0.71444714", "0.714033", "0.7099516", "0.70984703", "0.70885664", "0.7087128", "0.70815575", "0.7077817", "0.7070107", "0.706762", "0.70658684", "0.7060647", "0.70550144", "0.705466...
0.0
-1
Register any package services.
public function register() { $this->app->bind('SnapScanHandler', function ($app) { return new SnapScanHandler(new SnapScanHandler()); }); $this->app->alias('SnapScanHandler',SnapScanHandler::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerServices(): void\n {\n $this->registerKernels();\n $this->registerFactories();\n $this->registerMicroServices();\n }", "public function register()\n {\n $this->registerServices();\n }", "public function register()\n {\n // Only Enviro...
[ "0.76041543", "0.7520954", "0.7361004", "0.7352219", "0.7302387", "0.7252181", "0.7216501", "0.71864396", "0.7177226", "0.71727633", "0.7171777", "0.7163188", "0.7162261", "0.7150864", "0.7143927", "0.71338046", "0.71206653", "0.71104735", "0.7097425", "0.7096296", "0.7090195...
0.0
-1
Get the services provided by the provider.
public function provides() { return ['SnapScanHandler']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public function getServices()\n {\n if (is_null($this->serviceProviders)) {\n $this->serviceProviders = $this->getServiceProviders();\n }\n\n return $this->serviceProviders;\n }", "protected function getServices()\n {\n return $this->services;\n }", "pro...
[ "0.79039633", "0.7667588", "0.76229626", "0.75573224", "0.7470691", "0.7423859", "0.7423859", "0.7423859", "0.7409516", "0.736475", "0.736475", "0.7363987", "0.7322196", "0.71889", "0.7162814", "0.71509963", "0.7137116", "0.70622355", "0.7047945", "0.70362085", "0.70213807", ...
0.0
-1
Mocks don't work on this gateway because it has to call cURL directly.
public function testPurchaseSuccess() { // $this->setMockHttpResponse('WebservicePurchaseSuccess.txt'); $data = file_get_contents(__DIR__ . '/Mock/WebservicePurchaseSuccess.txt'); $purchase = $this->gateway->purchase($this->options); $response = $purchase->createResponse($data); // echo "Response data =\n"; // print_r($response->getData()); // echo "\nEnd Response data\n"; $this->assertTrue($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertEquals('259611::1452486844', $response->getTransactionReference()); $this->assertNull($response->getMessage()); $this->assertEquals('APPROVED', $response->getCode()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setUpCurl()\n {\n $this->curl = $this->get('app.curl.connector');\n $this->curl->setEndPointBaseUrl($this->getParameter('themoviedb_endpoint_url'));\n $this->curl->setExtraHeaders([\n CURLOPT_HEADER => false,\n CURLOPT_HTTPHEADER => [\"Accept: applicat...
[ "0.64444286", "0.61840504", "0.61490595", "0.6109234", "0.6083616", "0.60660547", "0.6001272", "0.5949743", "0.5936732", "0.59072816", "0.590172", "0.5873138", "0.5871482", "0.587044", "0.58385944", "0.5798404", "0.5730074", "0.57195556", "0.5713729", "0.57136023", "0.5713581...
0.0
-1
Deserialize JSON content from request.
protected function getData(Request $request, $key = NULL) { return $key ? $request->request->get($key) : $request->request->all(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getJsonRequestContent(Request $request)\n {\n return json_decode($request->getContent(), true);\n }", "public function fromJson() {\n return json_decode($this->getRequest()->getContent(),true);\n }", "public function parse($request)\r\n {\r\n $data = json_decode($requ...
[ "0.72556823", "0.71413106", "0.6624271", "0.6612224", "0.6578103", "0.6538436", "0.6307548", "0.6307548", "0.6298856", "0.62367254", "0.6156682", "0.6145528", "0.608869", "0.59884214", "0.59680426", "0.5966766", "0.5832127", "0.5805215", "0.57987344", "0.5795668", "0.5769368"...
0.0
-1
Create a JSON response with serialized data.
protected function json($data, $status = 200, array $headers = [], array $serializationGroups = ['api']) { $response = new JsonResponse(NULL, $status, $headers); $serializer = $this->get('serializer'); $context = SerializationContext::create()->enableMaxDepthChecks(); if ($serializationGroups) { $context->setGroups($serializationGroups); } $content = $serializer->serialize($data, 'json', $context); $response->setContent($content); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function responseJSON($data) {\n \t// Convert to JSON\n \t$dataJSON = $this->serializeJson($data);\n \t$response = new Response($dataJSON);\n \t$response->headers->set('Content-Type', 'application/json');\n \treturn $response;\n }", "private function ajson($data){\n $json = $th...
[ "0.7516463", "0.75109375", "0.7286312", "0.7269864", "0.7082692", "0.70223707", "0.7008661", "0.69642955", "0.69584554", "0.68988836", "0.6890527", "0.68520194", "0.68513304", "0.6833189", "0.6785855", "0.67738163", "0.67640924", "0.6739679", "0.6733518", "0.6733518", "0.6684...
0.0
-1
Apply values to an object.
protected function setValues($entity, array $data, array $properties = NULL) { $entityService = $this->get('os2display.entity_service'); $entityService->setValues($entity, $data, $properties); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function apply(array $propertyValues);", "public function applyValue($value);", "public function apply($value);", "public function values($data){\n\t\tforeach($data as $key => $value){\n\t\t\tif(property_exists($this, $key)){\n\t\t\t\t$this->{$key} = $value;\n\t\t\t}\n\t\t}\n\t}", "public function s...
[ "0.65710735", "0.6396828", "0.6251648", "0.61289644", "0.591095", "0.5837547", "0.5783791", "0.57204914", "0.5659402", "0.55062664", "0.5418958", "0.54184306", "0.5366455", "0.5353116", "0.5325303", "0.53145635", "0.5273034", "0.5257819", "0.52543074", "0.5236966", "0.5189625...
0.0
-1
Set API data on an object or a list of objects.
protected function setApiData($object) { return $this->get('os2display.api_data')->setApiData($object); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setApiData( array $data );", "public function setData(&$object, &$dataObject = null)\n {\n if ($dataObject === null)\n {\n $dataObject = $this->getApiRequest();\n }\n\n if (is_array($dataObject))\n {\n throw new \\Exception('array_not_su...
[ "0.72501975", "0.69637233", "0.6734153", "0.6463909", "0.6454353", "0.63867646", "0.6334855", "0.6256978", "0.6226091", "0.6226091", "0.6226091", "0.6226091", "0.6226091", "0.61937344", "0.6146082", "0.61171454", "0.61154133", "0.6111498", "0.6109041", "0.61022186", "0.608351...
0.7065436
1
Send message to email if approve user
public function approve(&$route, &$args, &$output) { $this->load->model('customer/customer'); $customer_info = $this->model_customer_customer->getCustomer($args[0]); if ($customer_info) { $this->load->model('setting/store'); $store_info = $this->model_setting_store->getStore($customer_info['store_id']); if ($store_info) { $store_name = html_entity_decode($store_info['name'], ENT_QUOTES, 'UTF-8'); $store_url = $store_info['url']; } else { $store_name = html_entity_decode($this->config->get('config_name')[$this->config->get('config_country_id')], ENT_QUOTES, 'UTF-8'); $store_url = HTTP_CATALOG; } $this->load->model('localisation/language'); $language_info = $this->model_localisation_language->getLanguage($customer_info['language_id']); if ($language_info) { $language_code = $language_info['code']; } else { $language_code = $this->config->get('config_language'); } $language = new Language($language_code); $language->load($language_code); $language->load('mail/customer_approve'); $subject = sprintf($language->get('text_subject'), $store_name); $data['text_welcome'] = sprintf($language->get('text_welcome'), $store_name); $data['text_login'] = $language->get('text_login'); $data['text_service'] = $language->get('text_service'); $data['text_thanks'] = $language->get('text_thanks'); $data['button_login'] = $language->get('button_login'); $data['login'] = $store_url . 'index.php?route=account/login'; $data['store'] = $store_name; $data['store_url'] = $store_url; $this->load->model('tool/image'); if (is_file(DIR_IMAGE . $this->config->get('config_logo'))) { $data['logo'] = $this->model_tool_image->resize($this->config->get('config_logo'), $this->config->get('theme_default_image_location_width'), $this->config->get('theme_default_image_cart_height')); } else { $data['logo'] = ''; } $mail = new Mail($this->config->get('config_mail_engine')); $mail->parameter = $this->config->get('config_mail_parameter'); $mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname'); $mail->smtp_username = $this->config->get('config_mail_smtp_username'); $mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8'); $mail->smtp_port = $this->config->get('config_mail_smtp_port'); $mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout'); $mail->setTo($customer_info['email']); $mail->setFrom($this->config->get('config_email')[$this->config->get('config_country_id')]); $mail->setSender($store_name); $mail->setSubject($subject); $mail->setHtml($this->load->view('mail/customer_approve', $data)); $mail->send(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function approve()\n {\n $message = new MailMessage;\n $message->greeting(\"Hi {$this->post->reporting->name}!\");\n $message->line(\"The post {$this->post->titile} has been approved successfully.\"); \n foreach ($this->workflow as $key => $value) {\n...
[ "0.7238097", "0.7053536", "0.70228046", "0.7014744", "0.6954638", "0.6803464", "0.67411125", "0.6718009", "0.67045325", "0.6683301", "0.667713", "0.66715467", "0.66224676", "0.66192865", "0.65913916", "0.6528739", "0.65251744", "0.65011215", "0.6498036", "0.64841914", "0.6480...
0.0
-1
Send message to email if deny user
public function deny(&$route, &$args, &$output) { $this->load->model('customer/customer'); $customer_info = $this->model_customer_customer->getCustomer($args[0]); if ($customer_info) { $this->load->model('setting/store'); $store_info = $this->model_setting_store->getStore($customer_info['store_id']); if ($store_info) { $store_name = html_entity_decode($store_info['name'], ENT_QUOTES, 'UTF-8'); $store_url = $store_info['url']; } else { $store_name = html_entity_decode($this->config->get('config_name')[$this->config->get('config_country_id')], ENT_QUOTES, 'UTF-8'); $store_url = HTTP_CATALOG; } $this->load->model('localisation/language'); $language_info = $this->model_localisation_language->getLanguage($customer_info['language_id']); if ($language_info) { $language_code = $language_info['code']; } else { $language_code = $this->config->get('config_language'); } $language = new Language($language_code); $language->load($language_code); $language->load('mail/customer_deny'); $subject = sprintf($language->get('text_subject'), $store_name); $data['text_welcome'] = sprintf($language->get('text_welcome'), $store_name); $data['text_denied'] = $language->get('text_denied'); $data['text_thanks'] = $language->get('text_thanks'); $data['button_contact'] = $language->get('button_contact'); $data['contact'] = $store_url . 'index.php?route=information/contact'; $data['store'] = $store_name; $data['store_url'] = $store_url; $this->load->model('tool/image'); if (is_file(DIR_IMAGE . $this->config->get('config_logo'))) { $data['logo'] = $this->model_tool_image->resize($this->config->get('config_logo'), $this->config->get('theme_default_image_location_width'), $this->config->get('theme_default_image_cart_height')); } else { $data['logo'] = ''; } $mail = new Mail($this->config->get('config_mail_engine')); $mail->parameter = $this->config->get('config_mail_parameter'); $mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname'); $mail->smtp_username = $this->config->get('config_mail_smtp_username'); $mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8'); $mail->smtp_port = $this->config->get('config_mail_smtp_port'); $mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout'); $mail->setTo($customer_info['email']); $mail->setFrom($this->config->get('config_email')[$this->config->get('config_country_id')]); $mail->setSender($store_name); $mail->setSubject($subject); $mail->setHtml($this->load->view('mail/customer_deny', $data)); $mail->send(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deny($message = null) {\n // Ignore soft 403 for ajax requests as redirections is transparent.\n if (config\\SOFT_403 != false && !\\melt\\request\\is_ajax()) {\n $user = get_user();\n if ($user === null) {\n if (config\\LAST_DENY_AUTOREDIRECT)\n $_SESSION['us...
[ "0.6965566", "0.6497139", "0.6292134", "0.6282241", "0.6166016", "0.6161643", "0.61175984", "0.61131996", "0.60753155", "0.60715616", "0.6064979", "0.6023679", "0.601881", "0.60090697", "0.59926945", "0.59081644", "0.59061116", "0.5899145", "0.5891469", "0.5885069", "0.587292...
0.0
-1
Send message to email if confirmation user from 1C
public function confirmation1C(array $array) { $this->load->model('customer/customer'); $customerInfo = $this->model_customer_customer->getCustomer($array['customer_id']); if ($customerInfo) { $this->load->model('setting/store'); $storeInfo = $this->model_setting_store->getStore($customerInfo['store_id']); if ($storeInfo) { $storeName = html_entity_decode($storeInfo['name'], ENT_QUOTES, 'UTF-8'); $storeUrl = $storeInfo['url']; } else { $storeName = html_entity_decode( $this->config->get('config_name')[$this->config->get('config_country_id')], ENT_QUOTES, 'UTF-8' ); $storeUrl = HTTP_CATALOG; } $this->load->model('localisation/language'); $languageInfo = $this->model_localisation_language->getLanguage($customerInfo['language_id']); if ($languageInfo) { $languageCode = $languageInfo['code']; } else { $languageCode = $this->config->get('config_language'); } $language = new Language($languageCode); $language->load($languageCode); $language->load('mail/customer_confirm'); $subject = sprintf($language->get('text_subject'), $storeName); $data['html'] = $this->getHtmlForEmail($language, $customerInfo['language_id'], $storeUrl); $data['text_welcome'] = sprintf($language->get('text_welcome'), $storeName); $data['text_thanks'] = $language->get('text_thanks'); $data['store'] = $storeName; $data['store_url'] = $storeUrl; $mail = new Mail($this->config->get('config_mail_engine')); $mail->parameter = $this->config->get('config_mail_parameter'); $mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname'); $mail->smtp_username = $this->config->get('config_mail_smtp_username'); $mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8'); $mail->smtp_port = $this->config->get('config_mail_smtp_port'); $mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout'); $mail->setTo($customerInfo['email']); $mail->setFrom($this->config->get('config_email')[$this->config->get('config_country_id')]); $mail->setSender($storeName); $mail->setSubject($subject); $mail->setHtml($this->load->view('mail/customer_confirm', $data)); $mail->send(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionSendConfirmationEmail() {\n\n\t\t$userId = User::checkLogged();\n\t\t$confirmation = User::generateConfirmationCode($userId);\n\t\t$subject = \"Confirm your account on JustRegMe\";\n\t\t$bodyPath = ROOT . '/template/email/confirmation.php';\n\t\t$body = include($bodyPath); //loads HTML-body f...
[ "0.77735835", "0.7400447", "0.73311573", "0.7285174", "0.72354627", "0.7227032", "0.71744674", "0.7127186", "0.70456165", "0.701664", "0.6975683", "0.694117", "0.69361216", "0.693306", "0.68931043", "0.68619716", "0.68411064", "0.68094176", "0.6794977", "0.6709405", "0.670013...
0.6232916
51
Send message on email user registered from 1C
public function registeredUser(array $array) { $this->load->model('customer/customer'); $customerInfo = $this->model_customer_customer->getCustomer($array['customer_id']); if ($customerInfo) { $this->load->model('setting/store'); $storeInfo = $this->model_setting_store->getStore($customerInfo['store_id']); if ($storeInfo) { $storeName = html_entity_decode($storeInfo['name'], ENT_QUOTES, 'UTF-8'); $storeUrl = $storeInfo['url']; } else { $storeName = html_entity_decode( $this->config->get('config_name')[$this->config->get('config_country_id')], ENT_QUOTES, 'UTF-8' ); $storeUrl = HTTP_CATALOG; } $this->load->model('localisation/language'); $languageInfo = $this->model_localisation_language->getLanguage($customerInfo['language_id']); if ($languageInfo) { $languageCode = $languageInfo['code']; } else { $languageCode = $this->config->get('config_language'); } $language = new Language($languageCode); $language->load($languageCode); $language->load('mail/customer'); $subject = sprintf($language->get('text_subject'), $storeName, HTTP_DOMAIN); $data['text_welcome'] = sprintf( $language->get('text_welcome'), $storeName, $array['email'], $array['password'] ); $data['html'] = $this->getHtmlForEmail($language, $customerInfo['language_id'], $storeUrl); $data['text_thanks'] = $language->get('text_thanks'); $data['store'] = $storeName; $data['store_url'] = $storeUrl; $mail = new Mail($this->config->get('config_mail_engine')); $mail->parameter = $this->config->get('config_mail_parameter'); $mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname'); $mail->smtp_username = $this->config->get('config_mail_smtp_username'); $mail->smtp_password = html_entity_decode( $this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8' ); $mail->smtp_port = $this->config->get('config_mail_smtp_port'); $mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout'); $mail->setTo($customerInfo['email']); $mail->setFrom($this->config->get('config_email')[$this->config->get('config_country_id')]); $mail->setSender($storeName); $mail->setSubject($subject); $mail->setHtml($this->load->view('mail/customer_registered', $data)); $mail->send(); $this->alert($array, $customerInfo); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function emailAtLogin() {}", "function userNotificationEmail($email, $user)\n{\n\t$module = new sociallogin();\n\t$sub = $module->l('Thank You For Registration', 'sociallogin_functions');\n\t$vars = array('{firstname}' => $user['fname'], '{lastname}' => $user['lname'], '{email}' => $email, '{passwd}' => ...
[ "0.71064544", "0.7001147", "0.6752328", "0.6739938", "0.67198044", "0.67095405", "0.66630244", "0.6653953", "0.6630405", "0.66128504", "0.6612142", "0.65974516", "0.65909904", "0.65508133", "0.6543881", "0.65415883", "0.65335226", "0.65244615", "0.6499075", "0.6496388", "0.64...
0.0
-1
Send message on email admin, that user registered
public function alert(array $array, array $customerInfo) { // Send to main admin email if new account email is enabled if (in_array('account', (array)$this->config->get('config_mail_alert'))) { $language = new Language('ru-ru'); $language->load('ru-ru'); $language->load('mail/customer'); $data['html'] = $this->getHtmlForEmail($language, 2, HTTP_CATALOG); $data['firstname'] = $customerInfo['firstname']; $data['lastname'] = $customerInfo['lastname']; $data['email'] = $array['email']; $data['text_firstname'] = $language->get('text_firstname'); $data['text_lastname'] = $language->get('text_lastname'); $data['text_customer_group'] = $language->get('text_customer_group'); $data['text_new_customer'] = $language->get('text_new_customer'); $data['text_email'] = $language->get('text_email'); $data['text_telephone'] = $language->get('text_telephone'); $data['telephone'] = $customerInfo['telephone']; $data['store_url'] = HTTP_SERVER; $data['store'] = html_entity_decode( $this->config->get('config_name')[$this->config->get('config_country_id')], ENT_QUOTES, 'UTF-8' ); if (isset($customerInfo['customer_group_id'])) { $customerGroupId = $customerInfo['customer_group_id']; } else { $customerGroupId = $this->config->get('config_customer_group_id'); } $this->load->model('customer/customer_group'); $customerGroupInfo = $this->model_customer_customer_group->getCustomerGroup($customerGroupId); if ($customerGroupInfo) { $data['customer_group'] = $customerGroupInfo['name']; } else { $data['customer_group'] = ''; } $mail = new Mail($this->config->get('config_mail_engine')); $mail->parameter = $this->config->get('config_mail_parameter'); $mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname'); $mail->smtp_username = $this->config->get('config_mail_smtp_username'); $mail->smtp_password = html_entity_decode( $this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8' ); $mail->smtp_port = $this->config->get('config_mail_smtp_port'); $mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout'); $mail->setTo($this->config->get('config_email')[$this->config->get('config_country_id')]); $mail->setFrom($this->config->get('config_email')[$this->config->get('config_country_id')]); $mail->setSender(html_entity_decode( $this->config->get('config_name')[$this->config->get('config_country_id')], ENT_QUOTES, 'UTF-8' )); $mail->setSubject(html_entity_decode( $language->get('text_new_customer'), ENT_QUOTES, 'UTF-8' )); $mail->setHtml($this->load->view('mail/register_alert', $data)); $mail->send(); $emails = explode(',', $this->config->get('config_mail_alert_email')); foreach ($emails as $email) { if (utf8_strlen($email) > 0 && filter_var($email, FILTER_VALIDATE_EMAIL)) { $mail->setTo($email); $mail->send(); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sendEmail()\r\n {\r\n\t\t$mail = new UserMails;\r\n\t\t$mail->sendAdminEmail('admin-user', $this->_user);\r\n }", "function emailRegistrationAdmin() {\n require_once ('com/tcshl/mail/Mail.php');\n $ManageRegLink = DOMAIN_NAME . '/manageregistrations.php';\n $emailBody =...
[ "0.7884341", "0.73652416", "0.7296909", "0.7022467", "0.6981888", "0.68622625", "0.68542683", "0.6843973", "0.6833348", "0.6817059", "0.68146116", "0.6803863", "0.6801985", "0.6760432", "0.67151946", "0.66846037", "0.6671598", "0.6661611", "0.66564333", "0.6640074", "0.662756...
0.0
-1
Get html content for email message
public function getHtmlForEmail(Language $language, int $languageCustomer, string $storeUrl) { $this->load->model('catalog/information'); if (is_file(DIR_IMAGE . $this->config->get('config_logo'))) { $data['logo'] = $storeUrl . 'image/prolmlogo.png'; } else { $data['logo'] = ''; } $data['splitter'] = $storeUrl . 'image/catalog/splitter.png'; $data['domainLang'] = $this->model_catalog_information->getAddressInfo($languageCustomer); $data['telephone'] = empty($data['domainLang']['phone']) ? $data['domainLang']['phone'] : $this->config->get('config_telephone'); $url = new Url(HTTP_CATALOG, $this->config->get('config_secure') ? HTTP_CATALOG : HTTPS_CATALOG); $data['menu'] = [ 'catalog' => [ 'text' => $language->get('text_catalog'), 'link' => $url->link('product/category'), ], 'payAndDelivary' => [ 'text' => $language->get('text_pay_delivery'), 'link' => $url->link('information/delivery'), ], 'historyOrder' => [ 'text' => $language->get('text_history_order'), 'link' => $url->link('account/order'), ] ]; $data['menuBelow'] = [ 'termsOfUse' => [ 'text' => $language->get('text_terms_of_use'), 'link' => $url->link('information/articles/view', '&article_id=' . 5), ], 'contacts' => [ 'text' => $language->get('text_contacts'), 'link' => $url->link('information/contact'), ] ]; return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBodyHtml(): string\n {\n return $this->htmlMessage;\n }", "public function getHTMLBody()\n {\n $parser = $this->getParser();\n $return = $parser->getMessageBody('html');\n return $return;\n }", "public function getMailBodyHTML(Notification $notificatio...
[ "0.7725141", "0.7192339", "0.7189205", "0.7127608", "0.7127307", "0.69888604", "0.6955731", "0.6950138", "0.6879559", "0.6826657", "0.6813142", "0.68102914", "0.67707115", "0.67331606", "0.6717965", "0.6703493", "0.6688689", "0.6680039", "0.666195", "0.6635774", "0.66192186",...
0.0
-1
Display Functions Functions to display information to the screen which may be called from multiple pages. Also performs database access in some cases
function displayPageAlerts(){ // This function will display any messages which have been added to // $_SESSION['alertMessages']. These alert messages are written to by many // data processing functions, either as errors or completion confirmations. // This function is called at the top of every page by the header // to display error messages created in processing POST data. // Only displays diagnostic errors for the Software Administrator if(ALLOW['SOFTWARE_ASSIST'] == true){ foreach($_SESSION['alertMessages']['systemErrors'] as $message){ displayAlert("<strong>Error: </strong>".$message, 'alert'); } } else { // If it is a normal user, alert them that there was an error. if(sizeof($_SESSION['alertMessages']['systemErrors']) > 0){ displayAlert("Appologies, but it seems we have encountered some sort of internal error.",'alert'); } } $_SESSION['alertMessages']['systemErrors'] = []; // Error messages for the user. foreach((array)$_SESSION['alertMessages']['userErrors'] as $message){ displayAlert("<strong>Error: </strong>".$message,'warning'); } $_SESSION['alertMessages']['userErrors'] = []; // Alert messages for the user (ie confirmation messages) $alertMessage = ''; if(sizeof($_SESSION['alertMessages']['userAlerts']) == 1){ $alertMessage = $_SESSION['alertMessages']['userAlerts'][0]; } elseif(sizeof($_SESSION['alertMessages']['userAlerts']) > 1) { $alertMessage = "<ul>"; foreach($_SESSION['alertMessages']['userAlerts'] as $message){ $alertMessage .= "<li>{$message}</li>"; } $alertMessage .= "</ul>"; } displayAlert($alertMessage); $_SESSION['alertMessages']['userAlerts'] = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function displayPage()\n {\n\n // I check if there is a duplicate action\n $this->handleDuplicate();\n\n $formTable = new FormListTable();\n\n $formTable->prepare_items();\n require_once __DIR__ . '/templates/index.php';\n }", "public function display(){}", "publ...
[ "0.71792096", "0.70106566", "0.70011586", "0.70011586", "0.6912117", "0.6804588", "0.6782401", "0.6754691", "0.6753159", "0.6753159", "0.673801", "0.6693175", "0.665921", "0.665921", "0.6659037", "0.6659037", "0.6590923", "0.6582383", "0.6530309", "0.6517392", "0.6511864", ...
0.0
-1
Creates a button to navigate to an event
function displayEventButton($eventID, $eventInfo){ //Creates a button to navigate to an event // Format location string $location = ''; if($eventInfo['eventCity'] != null){ $location = $eventInfo['eventCity']; } if($eventInfo['eventProvince'] != null){ if(isset($location)){ $location .= ', '; } $location .= $eventInfo['eventProvince']; } if($eventInfo['eventCountry'] != null){ if(isset($location)){ $location .= ', '; } $location .= $eventInfo['eventCountry']; } $location = rtrim($location,', \t'); // Format year and date string $name = $eventInfo['eventName']; $year = $eventInfo['eventYear']; $startDate = $eventInfo['eventStartDate']; $endDate = $eventInfo['eventStartDate']; try { $format = "M jS"; $dateString = ''; if (isset($startDate)) { $dateString = (new DateTime($startDate))->format($format); if (isset($endDate) && $endDate != $startDate) $dateString .= " - " . (new DateTime($endDate))->format($format); } else if (isset($endDate)) { $dateString = (new DateTime($endDate))->format($format); } } catch (Exception $e) { $dateString = ''; } // Displays current event in red if($eventID == $_SESSION['eventID']) { $isActive = "alert"; } else { $isActive = ''; } ?> <button value='<?= $eventID ?>' style='width:100%' class='button hollow <?= $isActive ?>' name='changeEventTo' > <?= $name ?>, <?= $year ?> <span class='hide-for-small-only'> - </span> <BR class='show-for-small-only'> <?= $location ?> <BR> <?= $dateString ?> </button> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function makeLinkButton() {}", "public function makeShortcutButton() {}", "function newButton($view) {\n\t\t$str = '<a class=\"button is-primary\" href=\"?do=edit&amp;view='.$view.'\">New</a>';\n\t\treturn $str;\n\t}", "public function getButton() {}", "function CreateButton()\n\t{\n\t\t$button = ne...
[ "0.66758275", "0.6371852", "0.63427365", "0.6305093", "0.62175494", "0.62047577", "0.6123406", "0.6001758", "0.59789425", "0.5882958", "0.58787584", "0.58160496", "0.5797098", "0.5745899", "0.57406306", "0.5738357", "0.57351345", "0.5725283", "0.57037705", "0.5680082", "0.567...
0.6582091
1
/ Function to display each exchange on regular screens
function displayExchangeReg($exchange, $num = null, $showExchTime = false){ $colorCode1 = COLOR_CODE_1; $colorCode2 = COLOR_CODE_2; $t1 = $exchange[1][1]; if($t1 == null){$t1 = "&nbsp;";} $t2 = $exchange[1][2]; if($t2 == null){$t2 = "&nbsp;";} $b1 = $exchange[2][1]; if($b1 == null){$b1 = "&nbsp;";} $b2 = $exchange[2][2]; if($b2 == null){$b2 = "&nbsp;";} if($showExchTime && $exchange['time'] == ''){ $exchange['time'] = "0:00"; } $class = ''; $odd = ''; if($num % 2 != 1){ $class= 'old-exch-odd'; } else { $odd= "opacity:0.92;"; } ?> <div class='shrink text-center' style='width: 40px'> <?php if($showExchTime): ?> <div class='cell <?=$class?>'> <?=$exchange['time']?> </div> <?php endif ?> <div class='cell f1-BG' style='<?=$odd?>'> <?=$t1?><BR><?=$t2?> </div> <div class='cell f2-BG' style='<?=$odd?>'> <?=$b1?><BR><?=$b2?> </div> </div> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayExchangeSmall($exchange, $num = null, $showExchTime = false){\r\n\t\t$colorCode1 = COLOR_CODE_1;\r\n\t\t$colorCode2 = COLOR_CODE_2;\r\n\t\t\r\n\t\t$t1 = $exchange[1][1];\r\n\t\tif($t1 == null){$t1 = \"&nbsp;\";}\r\n\t\t$t2 = $exchange[1][2];\r\n\t\tif($t2 == null){$t2 = \"&nbsp;\";}\r\n\t\t$b1 = $e...
[ "0.6211648", "0.6066554", "0.60325634", "0.5869405", "0.5693486", "0.56888366", "0.5667165", "0.5645903", "0.5638992", "0.5635639", "0.56331897", "0.5608421", "0.5589225", "0.5583504", "0.5583504", "0.5550186", "0.5550186", "0.5549243", "0.5549243", "0.55442953", "0.55334306"...
0.6019705
3
/ Function to display each exchange on small screens
function displayExchangeSmall($exchange, $num = null, $showExchTime = false){ $colorCode1 = COLOR_CODE_1; $colorCode2 = COLOR_CODE_2; $t1 = $exchange[1][1]; if($t1 == null){$t1 = "&nbsp;";} $t2 = $exchange[1][2]; if($t2 == null){$t2 = "&nbsp;";} $b1 = $exchange[2][1]; if($b1 == null){$b1 = "&nbsp;";} $b2 = $exchange[2][2]; if($b2 == null){$b2 = "&nbsp;";} if($showExchTime && $exchange['time'] == ''){ $exchange['time'] = "0:00"; } $class = ''; $odd = ''; if($num % 2 != 1){ $class= 'old-exch-odd'; } else { $odd= "opacity:0.92;"; } ?> <tr class='old-exch-mini'> <td class='<?=$class?>'> <?php if($showExchTime){ echo $exchange['time']; } else { echo $num; } ?> </td> <td class='f1-BG' style='<?=$odd?>'> <?=$t1?> </td> <td class='f1-BG' style='<?=$odd?>'> <?=$t2?> </td> <td class='f2-BG' style='<?=$odd?>'> <?=$b1?> </td> <td class='f2-BG' style='<?=$odd?>'> <?=$b2?> </td> </tr> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Show_Shelf($cur_title,$shelf_arr)\r\n\t\t{ \r\n\t\t\tglobal $ecom_siteid,$db,$ecom_hostname,$Settings_arr,$ecom_themeid,$default_layout,$Captions_arr,$inlineSiteComponents,$shelf_for_inner,$position;\r\n\t\t\t$Captions_arr['COMMON'] = getCaptions('COMMON');\r\n\t\t\tif (count($shelf_arr))\r\n\t\t\t{\r\n\t...
[ "0.573733", "0.571079", "0.54027015", "0.5391598", "0.5384205", "0.5356286", "0.5318571", "0.53166896", "0.529249", "0.5287912", "0.5263718", "0.5253724", "0.5234444", "0.522349", "0.5222967", "0.52117777", "0.52025247", "0.5189127", "0.517437", "0.5169443", "0.5160491", "0...
0.64309853
0
10 minutes to seconds ApiSDK constructor.
public function __construct(Client $guzzleClient, CacheItemPoolInterface $cacheManager, string $api_url, string $api_key) { $this->client = $guzzleClient; $this->cacheManager = $cacheManager; $this->api_url = $api_url; $this->api_key = $api_key; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function secondsToMinutes() {\n return $this;\n }", "function getTime10sec(){\n /** Setting the variable to override the Warning **/\n $modifiedLast2=0;\n\n /** Getting the epoch seconds **/\n $time = microtime(false);\n $time = explode(\" \", $time); \n ...
[ "0.55712605", "0.55442446", "0.5442015", "0.54371256", "0.533712", "0.5324363", "0.5313277", "0.52750695", "0.52659523", "0.52457553", "0.5219858", "0.52064866", "0.5192312", "0.51876837", "0.5181743", "0.5160134", "0.51496243", "0.5142288", "0.5128972", "0.51199937", "0.5106...
0.0
-1
/currently working from backup controller purpose of making Backup controller is to manage multiple backup options like backing up/restoring selected tables, files etc but have not done
public function fullDownload(){ Artisan::call('backup:run'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionBackup()\n {\n $user = \\Yii::$app->db->username;\n $pass = \\Yii::$app->db->password;\n $db = preg_replace('/^.*\\=(\\w+)$/', '$1', \\Yii::$app->db->dsn);\n $name = date('Y-m-d_H-i').\".sql\";\n $tables = implode(\" \", array_filter(\\Yii::$app->db->sche...
[ "0.7501994", "0.7501994", "0.74587715", "0.7380878", "0.72930586", "0.71496445", "0.7110567", "0.70745957", "0.7070066", "0.70070225", "0.69423586", "0.69091964", "0.68951863", "0.68580306", "0.6805526", "0.6804428", "0.67792207", "0.66517615", "0.65997326", "0.65959764", "0....
0.5672623
90
Checks $request if it contains a key username
private function handleKeyUsername(UserInterface $user, Request $request) { $data = $request->request->all(); if (array_key_exists('username', $data)) { // Change username only if username is changed if ($data['username'] != $user->getUsername()) { // Check if username is already taken $user1 = $this->container->get('fos_user.user_manager')->findUserByUsernameOrEmail($data['username']); if (null != $user1) { $this->logAndThrowError(400, 'Already taken by Username: '.$user1->getUsername(), $this->get('translator')->trans('api.show_error_username_taken', array(), 'messages', $request->getLocale()), $request->getLocale()); } $user->setUsername($data['username']); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkUsernameAction() {\n\t\t\n\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\t\n\t\tif ($request->isPost()) {\n\t\t\t// get the json raw data\n\t\t\t$handle = fopen(\"php://input\", \"rb\");\n\t\t\t$http_raw_post_data = '';\n\t\t\t\n\t\t\twhile (!feof($handle)) {\n\t\t\t $http_raw_post_data ...
[ "0.71173346", "0.6623698", "0.6560921", "0.64837253", "0.64821213", "0.6460515", "0.6368974", "0.6340982", "0.6340982", "0.6275556", "0.62253416", "0.62231296", "0.6200667", "0.61848736", "0.61238307", "0.61106", "0.6106317", "0.60954565", "0.6094907", "0.6088458", "0.6083287...
0.66007006
2
Checks $request if it contains a key email
private function handleKeyEmail(UserInterface $user, Request $request) { $data = $request->request->all(); if (array_key_exists('email', $data)) { // Check if email is valid if (!filter_var($data['email'], FILTER_VALIDATE_EMAIL)) { $this->logAndThrowError(400, 'Invalid email: '.$data['email'], 'Invalid email: '.$data['email']); } // Update email only if email is changed if ($data['email'] != $user->getEmail()) { // Check if email is already taken $user1 = $this->container->get('fos_user.user_manager')->findUserByUsernameOrEmail($data['email']); if (null != $user1) { $this->logAndThrowError(400, 'Email ' .$user1->getEmail().' already taken by Username: '.$user1->getUsername(), $this->get('translator')->trans('api.show_error_email_taken', array(), 'messages', $request->getLocale()), $request->getLocale()); } $user->setEmail($data['email']); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function emailCheck(Request $request)\n\t{\n\t\t\t$enteredEmail= $request['datafile'];\n\t\t\tif(DB::table('users')->where('email', '?')->setBindings([$enteredEmail])->exists())\n\t\t\t{\n\t\t\t\techo '<div style=\"color: red;\"> <b>'.$enteredEmail.'</b> is already in use! </div>|false';\n\t\t\t}\n\t\t\tels...
[ "0.6737034", "0.6660183", "0.6614548", "0.65276796", "0.64959806", "0.64825976", "0.6469953", "0.6434258", "0.64230204", "0.6420706", "0.6395769", "0.6394716", "0.6366026", "0.632835", "0.6165209", "0.61529183", "0.61512333", "0.61341697", "0.61320317", "0.61040586", "0.60866...
0.5967593
35
Checks $request if it contains a key firstname
private function handleKeyFirstname(UserInterface $user, Request $request) { $data = $request->request->all(); if (array_key_exists('firstname', $data)) { // Check if firstname is empty. At least firstname is required. if (null == $data['firstname']) { $this->logAndThrowError(400, 'Invalid empty firstname', $this->get('translator')->trans('api.show_error_firstname', array(), 'messages', $request->getLocale()), $request->getLocale()); } $user->setFirstname($data['firstname']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function requestFirstname();", "public function validateFirstName()\n {\n $first_name = filter_var(\n $this->_sanitized_data['first_name'],\n FILTER_SANITIZE_STRING,\n array('flags' => FILTER_FLAG_STRIP_HIGH)\n );\n $validation_response = true;\n\n ...
[ "0.74195737", "0.6942196", "0.676981", "0.6685169", "0.6506473", "0.6420983", "0.6261692", "0.62095326", "0.61524653", "0.61272323", "0.6111696", "0.60673445", "0.60331047", "0.5994855", "0.5972798", "0.59704715", "0.5967549", "0.5948522", "0.5933441", "0.5922871", "0.5914432...
0.69370884
2
Checks $request if it contains a key lastname
private function handleKeyLastname(UserInterface $user, Request $request) { $data = $request->request->all(); if (array_key_exists('lastname', $data)) { $user->setLastname($data['lastname']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkName() {\r\n // Params\r\n $this->lastName = $this->uri->params['lastName'];\r\n // Class call\r\n $checkClass = new LastNameOrigin($this->lastName);\r\n $res = $checkClass->Call();\r\n // Return result\r\n $this->returnJson($res['code'], $res['...
[ "0.65704906", "0.63535494", "0.6291259", "0.6164824", "0.6130299", "0.60979563", "0.605185", "0.6024341", "0.583428", "0.5792942", "0.5761136", "0.57210726", "0.57042253", "0.57009566", "0.56352043", "0.5610754", "0.55972534", "0.5552901", "0.55404615", "0.553794", "0.5515708...
0.6838159
0
Checks $request if it contains a key dob
private function handleKeyDob(UserInterface $user, Request $request) { $data = $request->request->all(); if (array_key_exists('dob', $data)) { // Check if dob is valid list($mm,$dd,$yyyy) = array_merge( explode('/',$data['dob']), array(0,0,0) ); if (!checkdate($mm,$dd,$yyyy)) { $this->logAndThrowError(400, 'Invalid mm/dd/yyyy DOB: '.$data['dob'], $this->get('translator')->trans('api.show_error_dob', array(), 'messages', $request->getLocale()), $request->getLocale()); } $user->setDob($data['dob']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function has_request( $key = '' ) {\n\t\treturn $this->has( $key, 'REQUEST' );\n\t}", "private function _requestHasParam(string $key, array $request)\n {\n return array_key_exists($key, $request);\n }", "function inputHas($key) {\n\t// check to see if $_REQUEST has a key/value\n\t// retu...
[ "0.6526556", "0.6399009", "0.6350673", "0.63215864", "0.6282226", "0.6263174", "0.62313104", "0.61848956", "0.6155496", "0.6085376", "0.6072185", "0.60458225", "0.58731747", "0.5868312", "0.5866773", "0.58251905", "0.5800377", "0.57985306", "0.57936066", "0.5766436", "0.57505...
0.0
-1
Get the truncated email displayed when requesting the resetting.
protected function getObfuscatedEmail(UserInterface $user) { $email = $user->getEmail(); if (false !== $pos = strpos($email, '@')) { $email = '...'.substr($email, $pos); } $this->logMessage(200, $email); return $email; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function composeEmailToUser()\n\t{\n\t\t$theURL = ( empty($this->myReentryURL) ?\n\t\t\t\t$this->composeReentryURL() : $this->myReentryURL ) ;\n\t\t$s = $this->model->getRes( 'account/email_body_pwd_reset_instr/'\n\t\t\t. $this->myEmailAddr . '/'\n\t\t\t. $this->getRandomCharsFromToken() )\n\t\t\t. '<a h...
[ "0.62151855", "0.59940463", "0.598448", "0.5977034", "0.59119844", "0.5873606", "0.58677894", "0.5857438", "0.5787881", "0.5781386", "0.578032", "0.57716125", "0.57606804", "0.5740637", "0.5738527", "0.5720125", "0.57069385", "0.5669697", "0.56673753", "0.5660789", "0.5653182...
0.0
-1
Fetch oAuth Access Token from oAuth engine.
private function fetchAccessToken(Request $request, $grantType) { $request = $this->container->get('request'); $data = $request->request->all(); $clientId = $data['client_id']; $clientSecret = $data['client_secret']; $refreshToken = array_key_exists('refresh_token', $data) ? $data['refresh_token'] : null; $username = array_key_exists('username', $data) ? $data['username'] : null; $password = array_key_exists('password', $data) ? $data['password'] : null; $client = new OAuth2\Client($clientId, $clientSecret); // This is a common function for both getAccessTokenAction() and getRefreshTokenAction(). // Hence, we need to distinguish between parameters passed. if (null != $refreshToken) { $params = array('refresh_token' => $refreshToken); } else { $params = array('username' => $username, 'password' => $password ); } $response = $client->getAccessToken($this->container->getParameter('oauth2_token_endpoint'), $grantType, $params); $accessToken = 'Total Garbage'; if (isset($response['result'])) { if (isset($response['result']['access_token'])) { $accessToken = $response['result']['access_token']; } elseif (isset($response['result']['error'])) { // If error occurred, then throw an exception, else return the result $this->logAndThrowError(400, $response['result']['error'].' - '.$response['result']['error_description'], $response['result']['error_description'] ); } } return $response['result']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getAccessToken($oauth_token) {\n\n\t}", "private function _get_access_token() {\n return $this->_http->request( \n 'POST', 'https://oauth.api.189.cn/emp/oauth2/v3/access_token',\n http_build_query( array(\n 'grant_type' => 'client_credentials...
[ "0.7369777", "0.7346858", "0.7318164", "0.7109133", "0.7104074", "0.70772237", "0.70772237", "0.70772237", "0.70772237", "0.70772237", "0.7027913", "0.70111966", "0.6989268", "0.69647336", "0.69121563", "0.689256", "0.686822", "0.685164", "0.6838357", "0.6830064", "0.68045056...
0.0
-1
Display a listing of the resource.
public function index() { $data = DB::select('SELECT books.title, users.name, transactions.created_at, transactions.status, transactions.id FROM transactions join books on transactions.book_id=books.id JOIN users on transactions.user_id=users.id '); return view('transactions.home',compact('data')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.683052...
0.0
-1
========== ========== Add ========== ==========
public function getAdd() { return view('manage.content.help.action.add'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add();", "public function add();", "public function add()\n\t{\n\n\t}", "public function add()\n\t{\n\n\t}", "protected function add() {\n\t}", "public function add()\n {\n }", "public function add()\n {\n }", "public function add()\n {\n }", "function add() {\n ...
[ "0.8832246", "0.8832246", "0.8502424", "0.8502424", "0.83639914", "0.83517", "0.83517", "0.83517", "0.780352", "0.76057625", "0.7446904", "0.7431286", "0.73978317", "0.7289647", "0.726008", "0.71996987", "0.719899", "0.718201", "0.71811295", "0.71811295", "0.703739", "0.703...
0.0
-1
========== ========== View ========== ==========
public function getView($actionId){ $dataHelpAction = TfHelpAction::find($actionId); $accessObject = 'action'; if(count($dataHelpAction) > 0){ return view('manage.content.help.action.view', compact('dataHelpAction', 'accessObject')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getView() {}", "public function getView() {}", "public function view()\n\t{\n\t\t// TODO Implement\t\n\t}", "public function getView(){ }", "public function view() {\r\n\r\n\t}", "public function getView()\n {\n }", "public function getView();", "abstract protected function getV...
[ "0.7848998", "0.7848998", "0.7729135", "0.7719871", "0.7666695", "0.7653342", "0.7533955", "0.75137216", "0.7403517", "0.731911", "0.72504705", "0.7171853", "0.71609455", "0.7159511", "0.7120142", "0.70251733", "0.7024106", "0.7024106", "0.69670874", "0.6962228", "0.6942319",...
0.0
-1
========== ========== Edit ========== ==========
public function getEdit($actionId = '') { $modelHelpAction = new TfHelpAction(); $dataHelpAction = $modelHelpAction->getInfo($actionId); $accessObject = 'action'; return view('manage.content.help.action.edit', compact('dataHelpAction', 'accessObject')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit()\n\t{\n\t\t//\n\t}", "public function edit() {\n\t\t\t\n\t\t}", "public function edit()\n\t{\n\t\t\n\t}", "public function edit( )\r\n {\r\n //\r\n }", "public function edit()\n {\n \n }", "public function Edit()\n\t{\n\t\t\n\t}", "public function edit() {\...
[ "0.80653745", "0.7988233", "0.7942489", "0.78812987", "0.76994014", "0.75946134", "0.7561528", "0.75569594", "0.7541516", "0.7541516", "0.7541516", "0.7533244", "0.7533244", "0.7511633", "0.7482816", "0.7482816", "0.7482816", "0.7370197", "0.7333015", "0.7333015", "0.7333015"...
0.0
-1
========== ========== Delete ========== ==========
public function getDelete($actionId = '') { if (!empty($actionId)) { $dataHelpAction = new TfHelpAction(); $dataHelpAction->getDelete($actionId); } return redirect()->back(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "publi...
[ "0.84841895", "0.84841895", "0.84841895", "0.84841895", "0.84841895", "0.84841895", "0.84841895", "0.84841895", "0.84841895", "0.84841895", "0.84841895", "0.84841895", "0.84841895", "0.84841895", "0.84841895", "0.82929915", "0.82929915", "0.82929915", "0.82929915", "0.82580566"...
0.0
-1
Run the database seeds.
public function run() { $data = [ 'Telkomsel', 'Indosat', 'PT. TOWER BERSAMA/ TBG', 'PT. SOLU SINDO KREASI PRATAMA/ TBG', 'PT. SOLUSI MENARA INDONESIA/ TBG', 'Protelindo', 'Komet Infra Nusantara (KIN)', 'IBS', 'STP', 'XL/ Axis', 'Mitratel', 'XL', 'PT. PRIMA MEDIA SELARAS/ TBG', 'Retower/Centratama Menara Indonesia', 'PT. TELENET INTERNUSA/ TBG', ]; for ($i = 0; $i < count($data); $i++) { $name[] = [ 'name' => $data[$i] ]; } Pemilik::insert($name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact...
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.78414...
0.0
-1
Extract configuration data of videos from the DOM structure
public function process(\DOMElement $mediaNode, $mediaParentTag) { $result = []; $moduleNameVideo = $mediaNode->getAttribute('module'); foreach ($mediaNode->getElementsByTagName(self::MEDIA_TYPE_CODE) as $node) { $videoId = $node->getAttribute('id'); $result[$mediaParentTag][$moduleNameVideo][Media::MEDIA_TYPE_CONFIG_NODE][$videoId]['type'] = $node->getAttribute('type'); foreach ($node->childNodes as $attribute) { if ($attribute->nodeType != XML_ELEMENT_NODE) { continue; } $nodeValue = $attribute->nodeValue; $result[$mediaParentTag][$moduleNameVideo][Media::MEDIA_TYPE_CONFIG_NODE][$videoId][$attribute->tagName] = $nodeValue; } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVideoConfigXml($videoUrl)\r\n\t{\r\n\t\t$xml = curlGet($videoUrl);\r\n\t\t$xml = '<?xml version=\"1.0\"?>'.\"\\n\".$xml;\r\n\r\n\t\t$dom = new DOMDocument();\r\n\t\t$dom->loadXML($xml);\r\n\r\n\t\t$result = array();\r\n\r\n\t\t//$dom->documentElement->getElementsByTagName('tracklist')\r\n\t\t$playlist ...
[ "0.6647664", "0.6276344", "0.60806245", "0.59963554", "0.5918467", "0.58600336", "0.5839703", "0.58276784", "0.5811184", "0.57546467", "0.57281154", "0.5683497", "0.5679592", "0.5653047", "0.56201124", "0.55730635", "0.55589265", "0.5528477", "0.5502508", "0.54925156", "0.548...
0.0
-1
Create a new command instance.
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "pu...
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315...
0.0
-1
Execute the console command.
public function handle() { //return view('crontest.index'); $userdate = strtotime(User::all()->first()->created_at); $checkdate = strtotime('-1 minute'); if ($userdate <= $checkdate){ echo User::all(); } else{ echo "niks is kleiner dan een minuut"; } echo "\n". strtotime(User::all()->first()->created_at); //echo "\n". strtotime('now'); echo "\n". strtotime('-1 minute'); echo "\n". date('r', strtotime(User::all()->first()->created_at)); echo "\n". date('r', strtotime('now')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() meth...
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.614841...
0.0
-1
Send request to add unsorted
public function add(array $elements);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_to_top_page(){\r\n\t\t$rslt = array('suc'=>true, 'msg'=>'');\r\n\r\n\t\t$id = $_POST['id'];\r\n\t\t$top_reports = get_option('iemop_top_reports', array());\r\n\t\t$total = count($top_reports);\r\n\r\n\t\tif(in_array($id, array_keys($top_reports))){ // remove frop top\r\n\t\t\tunset($top_reports...
[ "0.5540178", "0.55094814", "0.5460602", "0.53744185", "0.52074367", "0.5108507", "0.5059316", "0.5049457", "0.5019025", "0.501576", "0.49989995", "0.49814647", "0.49748263", "0.49744132", "0.49387768", "0.4931795", "0.4929889", "0.4922641", "0.48991978", "0.48786256", "0.4851...
0.0
-1
This case is simple enough: it just grows to the maximum size.
public function testAppendToMaxSizeWithoutAccess() { $array = new \ComplexPie\CacheArray(); $max = \ComplexPie\CacheArray::MAX_CACHE_SIZE; for ($i = 0; $i < $max; $i++) { $array[] = $i; } $this->assertSame($max, count($array)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function increaseCapacity();", "protected function increaseCapacity()\n {\n $size = count($this);\n\n if ($size > $this->capacity) {\n $this->capacity = max(intval($this->capacity * 1.5), $size);\n }\n }", "public function GetMaxSize ();", "public func...
[ "0.7092969", "0.6559906", "0.6540119", "0.6491448", "0.6288279", "0.6262019", "0.6262019", "0.6261677", "0.62073284", "0.6192205", "0.61842996", "0.61245584", "0.6048895", "0.6017522", "0.598997", "0.59672356", "0.5915472", "0.5816677", "0.58068436", "0.57660407", "0.5765297"...
0.6242693
8
Access here makes no difference, as this just makes everything stay when it hits 100 accesses.
public function testAppendToMaxSizeWithAccess() { $array = new \ComplexPie\CacheArray(); $max = \ComplexPie\CacheArray::MAX_CACHE_SIZE; for ($i = 0; $i < $max; $i++) { $array[] = $i; $array[$i]; } $this->assertSame($max, count($array)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAppendToOverMaxSizeWithAccess()\n {\n $array = new \\ComplexPie\\CacheArray();\n $max = \\ComplexPie\\CacheArray::MAX_CACHE_SIZE + 1;\n for ($i = 0; $i < $max; $i++)\n {\n $array[] = $i;\n $array[$i];\n }\n $this->assertSame(1, ...
[ "0.5631449", "0.55800486", "0.5463701", "0.54411274", "0.5400752", "0.53834504", "0.53747493", "0.5347652", "0.53394085", "0.532921", "0.5289664", "0.52665114", "0.5247412", "0.52307355", "0.52284706", "0.5209652", "0.5200519", "0.5177874", "0.5164256", "0.5146453", "0.511839...
0.53155667
10
This is slightly more complex, and relies upon (our) GC behaviour: it assumes that array values that are never accessed are removed.
public function testAppendToOverMaxSizeWithoutAccess() { $array = new \ComplexPie\CacheArray(); $max = \ComplexPie\CacheArray::MAX_CACHE_SIZE + 1; for ($i = 0; $i < $max; $i++) { $array[] = $i; } $this->assertSame(1, count($array)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function cleanExecutionArrays() {}", "function purge($arr){\n\treturn array_map(function($r){ return array_map(function($c){ return is_array($c)?false:$c;}, $r);}, $arr);\n}", "public abstract function retain_array(Array $array);", "function destroyer($arr, $valsToRemove) {\n\n $ret = array();\n...
[ "0.64107144", "0.6385838", "0.63625085", "0.63030386", "0.618334", "0.6123956", "0.6058442", "0.60106206", "0.5993708", "0.5973204", "0.5956171", "0.5956171", "0.59279144", "0.59057975", "0.5904087", "0.5904087", "0.5903962", "0.5903962", "0.5903962", "0.58981085", "0.5897071...
0.0
-1
The act of reading the 100th item after reaching 100 items means we clean up here.
public function testAppendToOverMaxSizeWithAccess() { $array = new \ComplexPie\CacheArray(); $max = \ComplexPie\CacheArray::MAX_CACHE_SIZE + 1; for ($i = 0; $i < $max; $i++) { $array[] = $i; $array[$i]; } $this->assertSame(1, count($array)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clean() {\n\t\t\tif( !$items = $this->getStats( 'items' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$memcache = $this->getMemcache();\n\t\t\tforeach( $items['items'] as $key => $item ) {\n\t\t\t\t$dump = $memcache->getStats( 'cachedump', $key, $item['number'] * 2 );\n\t\t\t\tforeach( array_keys( $dump )...
[ "0.5592316", "0.55519426", "0.54810303", "0.5360313", "0.5282318", "0.52376854", "0.52289677", "0.5202418", "0.5190127", "0.5155725", "0.51357967", "0.513187", "0.51103723", "0.5107141", "0.51045936", "0.50891477", "0.50680745", "0.5064575", "0.5054794", "0.50439286", "0.5042...
0.0
-1
When we set the 101st item we clear out all the items not new and not read.
public function testAppendToOverMaxSizeWithAccessToSpecific() { $array = new \ComplexPie\CacheArray(); $max = \ComplexPie\CacheArray::MAX_CACHE_SIZE; for ($i = 0; $i < $max; $i++) { $array[] = $i; } $array[1]; $array[2]; $array[3]; $array[] = $i; $this->assertSame(4, count($array)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reset()\n {\n $this->values[self::_ITEMS] = array();\n $this->values[self::_RAID_ID] = null;\n $this->values[self::_APPLY_ITEM_ID] = null;\n $this->values[self::_RANK] = null;\n }", "public function reset()\n {\n $this->values[self::_ITEM_ID] = null;\n ...
[ "0.64345783", "0.63590914", "0.62876505", "0.6282003", "0.62644154", "0.6234074", "0.62150097", "0.6171256", "0.61606157", "0.61222434", "0.61065227", "0.60917443", "0.608415", "0.6081429", "0.60432327", "0.603344", "0.6028012", "0.6021899", "0.5977743", "0.59549254", "0.5929...
0.0
-1
/ Just key for user access to other servers
public function actionKPT() { //$sid = CUser::model()->findByPk($this->user_id)->sess_id; //$kpt = md5($this->user_id . $sid . "I am robot"); echo CUser::kpt($this->user_id); exit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function display_option_server_key() {\n $server_key = $this->options['server_key'];\n $this->display_input_text_field('server_key', $server_key);\n?>\nThe secret key that clients must use to clear the cache on this blog, passed in the <code><?php esc_attr_e($this->plugin->query_var()); ?></co...
[ "0.6051755", "0.603635", "0.59319615", "0.5930907", "0.5917902", "0.5827446", "0.5816584", "0.5803472", "0.5760974", "0.57557845", "0.5731684", "0.5728786", "0.57219845", "0.57115257", "0.57115257", "0.57115257", "0.57115257", "0.57115257", "0.57115257", "0.57115257", "0.5711...
0.0
-1
TO DO:delete all files
public function actionCancelconvert() { if (!empty($_POST['id'])) { CConvertQueue::model()->deleteUserQueue($this->user_id, $_POST['id']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function deleteFiles() : void{\n $files = glob(self::DIRECTORY . '/*');\n foreach($files as $file){\n if(is_file($file))\n unlink($file);\n }\n }", "public function cleanAll()\n {\n $this->filesystem->remove(self::getFilesL...
[ "0.8366082", "0.8031866", "0.7982506", "0.7955873", "0.77811146", "0.7763387", "0.7617359", "0.7597527", "0.75652146", "0.7562641", "0.75381976", "0.7446817", "0.7434486", "0.7404502", "0.73800445", "0.7359796", "0.7344691", "0.73439187", "0.73206186", "0.73157865", "0.730599...
0.0
-1
TO DO:delete all files
public function actionRestartqueue() { if (!empty($_POST['id'])) { CConvertQueue::model()->restartUserQueue($this->user_id, $_POST['id']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function deleteFiles() : void{\n $files = glob(self::DIRECTORY . '/*');\n foreach($files as $file){\n if(is_file($file))\n unlink($file);\n }\n }", "public function cleanAll()\n {\n $this->filesystem->remove(self::getFilesL...
[ "0.8366082", "0.8031866", "0.7982506", "0.7955873", "0.77811146", "0.7763387", "0.7617359", "0.7597527", "0.75652146", "0.7562641", "0.75381976", "0.7446817", "0.7434486", "0.7404502", "0.73800445", "0.7359796", "0.7344691", "0.73439187", "0.73206186", "0.73157865", "0.730599...
0.0
-1
TO DO:delete all files
public function actionRemove() { if (!isset($_POST['id'])) die("what?"); $id = (int) $_POST['id']; if ($id < 1) die("unknown file"); CUserfiles::model()->RemoveFile($this->user_id, $id); echo "OK"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function deleteFiles() : void{\n $files = glob(self::DIRECTORY . '/*');\n foreach($files as $file){\n if(is_file($file))\n unlink($file);\n }\n }", "public function cleanAll()\n {\n $this->filesystem->remove(self::getFilesL...
[ "0.8366771", "0.80332875", "0.7984204", "0.79566497", "0.77805793", "0.77648276", "0.7618143", "0.75971586", "0.7565527", "0.75613517", "0.7538428", "0.7449401", "0.7434713", "0.74044645", "0.7381687", "0.7360416", "0.73453623", "0.73451596", "0.7321756", "0.73158133", "0.730...
0.0
-1
remove All untyped files
public function actionRemoveAll() { if (!isset($_POST['removeAll'])) die('what?'); CUserfiles::model()->RemoveAllFiles($this->user_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function clean() {\n\t\t$types = ['.aux', '.fdb_latexmk', '.fls', '.log', '.out', '.tex', '.toc'];\n\t\t$s = '';\n\t\tforeach (scandir($this -> directory) as $file) {\n\t\t\tif ($file === '.' || $file === '..') continue;\n\t\t\tforeach ($types as $t) {\n\t\t\t\t$extension = substr($file, 0-strlen($t));\n\t...
[ "0.749898", "0.72871673", "0.71437776", "0.7068363", "0.70107996", "0.6640639", "0.6588004", "0.655018", "0.6536964", "0.65352595", "0.6517671", "0.65104836", "0.6494262", "0.64738375", "0.6423328", "0.64179075", "0.6370674", "0.6348064", "0.6323481", "0.63179535", "0.6294955...
0.6096311
26
TODO Work out what I should include in the chat dasboard
public function run() { parent::run(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_chtrm_name($chatid){\r\n\r\n}", "public static function chatbot()\n {\n // no code needed.\n }", "public function messages();", "public function messages();", "public function messages();", "function get_chtrm($chatid){\r\n\r\n}", "function view_chat($demand_id)\n ...
[ "0.63842607", "0.6353082", "0.63511324", "0.63511324", "0.63511324", "0.63258594", "0.63217807", "0.60072714", "0.5999326", "0.5973857", "0.59590375", "0.5934345", "0.59178627", "0.5891356", "0.5881627", "0.5854293", "0.58467907", "0.5833208", "0.5820362", "0.5787204", "0.577...
0.0
-1
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.683052...
0.0
-1
Show the form for creating a new resource.
public function create() { return view('user_create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view(...
[ "0.7594622", "0.7594622", "0.7588457", "0.7580005", "0.75723624", "0.7499764", "0.7436887", "0.74322647", "0.7387517", "0.735172", "0.73381543", "0.73117113", "0.72958225", "0.7280436", "0.7273787", "0.72433424", "0.7230227", "0.7225085", "0.71851814", "0.71781176", "0.717402...
0.0
-1
Store a newly created resource in storage.
public function store(UserRequest $request) { $user = new User; // $user->create($request->all()); //Maneiras diferente de usar o request // dd($request->email); // dd($request->input('email')); // dd(request('email')); $user->create($request->all()); session()->flash('message', 'Cadastrado com sucesso'); return back(); // $user = new User; // $user->name = 'Fulano'; // $user->email = 'fulano@email.com'; // $user->password = \Hash::make(123); // $user->save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.63424...
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id...
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245...
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ...
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.6833...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "0.7424578", "0.7062392", "0.7056844", "0.6897447", "0.65815884", "0.6451359", "0.634689", "0.62107086", "0.6145251", "0.6121901", "0.6115076", "0.61009926", "0.60885817", "0.6053816", "0.6018965", "0.6007763", "0.5973282", "0.59455335", "0.593951", "0.59388787", "0.5892445",...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n ...
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897...
0.0
-1
Create a new controller instance.
public function __construct() { return $this->drone = new Drone; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this-...
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.687...
0.0
-1
////////////////////////////////////////////////////////////////////////////////////////////////////////////////// / SETTERS //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public function setCommentId($comment_id) { $this->comment_id = $comment_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function set();", "private function __construct()\t{}", "private function __() {\n }", "protected function __init__() { }", "public static function setters();", "private function __construct() {\r\n\t\t\r\n\t}", "private function __construct() {\r\n\t\r\n\t}", "function __s...
[ "0.71946627", "0.6386438", "0.63612854", "0.63112617", "0.62555087", "0.6239267", "0.61973727", "0.6190243", "0.6149702", "0.6149562", "0.6142734", "0.61350167", "0.6123348", "0.61232984", "0.61149085", "0.61149085", "0.61149085", "0.6103065", "0.61015344", "0.6091884", "0.60...
0.0
-1
Adds invitations to the list. Duplicated emails and empty invitiation are skipped
public function setInvitations(array $invitations) { foreach ($invitations as $newInvitation) { if (!($newInvitation instanceof ProjectInvitation)) { continue; } foreach ($this->invitations as $invitation) { if ($invitation->getInviteeEmail() === $newInvitation->getInviteeEmail()) { continue 2; } } $this->invitations[] = $newInvitation; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function invites();", "function invitations()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tlogout_invalid_user($this);\n\t\t$data['tender'] = $this->_tender->details($data['d']);\n\t\t$data['invited'] = $this->_tender->invitations($data['d']);\n\t\t\n\t\tif(empty($data['invited'])) $data['msg'] = ...
[ "0.66967165", "0.6605068", "0.6515697", "0.64643663", "0.64376414", "0.6394086", "0.63173693", "0.62609386", "0.6230056", "0.619493", "0.6146303", "0.6051922", "0.5992582", "0.5896271", "0.5859883", "0.58172053", "0.58092105", "0.5798885", "0.5786823", "0.5785944", "0.5773467...
0.61189526
11
generates a simple 'create table xxx based on field names
protected function getCreateTableSQL($tablename) { $SQL=''; foreach ($this->fieldNames as $fieldName) { if ($SQL!='') $SQL.=','."<br>"; $SQL.=$fieldName.' varchar(20)'; } $SQL.=')'; $SQL='create table '.$tablename.' ('.$SQL; return $SQL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function create_table($table_name, $fields, $primary_key = TRUE);", "function mscaffolding_create_table($name, $data)\n\t{\n\t\t$query_string = \"CREATE TABLE `\" . lconf_get(\"db_name\") . \"`.`\" . $name . \"` (`id` INT NOT NULL AUTO_INCREMENT,\";\n\n\t\tfor ($i = 0; $i < count($data) / 2; $i++...
[ "0.77528113", "0.7174744", "0.7074879", "0.70738554", "0.7069855", "0.70600814", "0.69637346", "0.69040567", "0.68488264", "0.68385315", "0.68304527", "0.67824686", "0.67729896", "0.67478955", "0.67433393", "0.67345285", "0.67339265", "0.66211396", "0.6581889", "0.65568125", ...
0.67293704
17
This is actually the rate, wrong wording...
public function getAmountTotal(): float { return $this->amountTotal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rate()\n {\n\n }", "public function rate()\n {\n return $this->rate;\n }", "public function rate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this-...
[ "0.73541623", "0.69482094", "0.69482094", "0.6941969", "0.6941969", "0.6941969", "0.6941969", "0.6941969", "0.6822514", "0.6788268", "0.6533004", "0.65031874", "0.6471485", "0.6372346", "0.6359106", "0.63149846", "0.6182789", "0.61517495", "0.6143315", "0.6138426", "0.6135762...
0.0
-1
This is actually the rate, wrong wording...
public function setAmountTotal($amountTotal) { $this->amountTotal = (float) $amountTotal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rate()\n {\n\n }", "public function rate()\n {\n return $this->rate;\n }", "public function rate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this-...
[ "0.73541623", "0.69482094", "0.69482094", "0.6941969", "0.6941969", "0.6941969", "0.6941969", "0.6941969", "0.6822514", "0.6788268", "0.6533004", "0.65031874", "0.6471485", "0.6372346", "0.6359106", "0.63149846", "0.6182789", "0.61517495", "0.6143315", "0.6138426", "0.6135762...
0.0
-1
This is actually the rate, wrong wording...
public function getAmountThisMonth(): float { return $this->amountThisMonth; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rate()\n {\n\n }", "public function rate()\n {\n return $this->rate;\n }", "public function rate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this-...
[ "0.7352856", "0.69476265", "0.69476265", "0.69412124", "0.69412124", "0.69412124", "0.69412124", "0.69412124", "0.68206745", "0.67875", "0.6533301", "0.65019286", "0.647187", "0.6371586", "0.63577384", "0.63143474", "0.6183147", "0.6150288", "0.61427957", "0.61382353", "0.613...
0.0
-1
This is actually the rate, wrong wording...
public function setAmountThisMonth($amountThisMonth) { $this->amountThisMonth = (float) $amountThisMonth; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rate()\n {\n\n }", "public function rate()\n {\n return $this->rate;\n }", "public function rate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this-...
[ "0.73541623", "0.69482094", "0.69482094", "0.6941969", "0.6941969", "0.6941969", "0.6941969", "0.6941969", "0.6822514", "0.6788268", "0.6533004", "0.65031874", "0.6471485", "0.6372346", "0.6359106", "0.63149846", "0.6182789", "0.61517495", "0.6143315", "0.6138426", "0.6135762...
0.0
-1
Constructs a class property list node.
public function __construct(int $flags, array $props, array $attributes = [], $type = null, array $attrGroups = []) { $this->attributes = $attributes; $this->flags = $flags; $this->props = $props; $this->type = \is_string($type) ? new Identifier($type) : $type; $this->attrGroups = $attrGroups; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createProperty()\n {\n $prop = new LiquibaseProperty();\n $this->properties[] = $prop;\n\n return $prop;\n }", "public function __construct($property, $class = null)\n {\n parent::__construct();\n\n if ($class) {\n $this->setToken('IndexClass...
[ "0.567661", "0.5623532", "0.54962903", "0.5408018", "0.5300851", "0.52674276", "0.51051277", "0.5090503", "0.5026088", "0.5021043", "0.50142705", "0.4949374", "0.49083596", "0.48735392", "0.4865902", "0.48503703", "0.48286992", "0.4808854", "0.4705104", "0.47040066", "0.46693...
0.0
-1
Whether the property is explicitly or implicitly public.
public function isPublic() : bool { return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isPublic()\n\t{\n\t\treturn $this->property->isPublic();\n\t}", "public function isPublic()\n {\n return $this->_public;\n }", "public function isPublic()\n {\n return $this->public;\n }", "public function isPublic() {\n\t\treturn $this->public;\n\t}", "public function isI...
[ "0.8748482", "0.82945853", "0.8206692", "0.8168307", "0.80445457", "0.80025643", "0.78572184", "0.77828765", "0.77181906", "0.7708724", "0.7577971", "0.73268676", "0.7324548", "0.7304451", "0.7302177", "0.7302177", "0.72548133", "0.7251892", "0.71335876", "0.71273106", "0.710...
0.7906713
6
Whether the property is protected.
public function isProtected() : bool { return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isProtected()\n {\n return $this->protected;\n }", "public function isProtected(): bool\n {\n return $this->node->isProtected();\n }", "public function isProtected(): bool\n {\n return $this->node->isProtected();\n }", "public function isProtected() {}", "pub...
[ "0.8379755", "0.7851283", "0.7851283", "0.782681", "0.7824568", "0.7734371", "0.7584322", "0.7429981", "0.7399157", "0.7112716", "0.7024482", "0.6962618", "0.6873163", "0.6830594", "0.6767726", "0.6733903", "0.6676794", "0.666128", "0.66601443", "0.6638949", "0.66339713", "...
0.81763554
1
Whether the property is private.
public function isPrivate() : bool { return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPrivate() : bool {\n return $this->private;\n }", "public function getPrivate() : bool\n {\n return $this->private;\n }", "public function isPrivate()\n\t{\n\t\t//return ($this->get('private') == self::PRIVACY_PRIVATE);\n\t\treturn ($this->get('access') == 5);\n\t}", "publ...
[ "0.8409907", "0.8401558", "0.7941218", "0.7888888", "0.7772115", "0.7772115", "0.7766804", "0.7766804", "0.7766804", "0.7656637", "0.7656637", "0.7656637", "0.7656637", "0.7656637", "0.7656637", "0.7656637", "0.7656637", "0.7610267", "0.7543198", "0.7455794", "0.7397863", "...
0.8158895
2
Whether the property is static.
public function isStatic() : bool { return (bool) ($this->flags & Class_::MODIFIER_STATIC); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIsStatic() {\n return $this->isStatic;\n }", "public function isStatic(): bool\n {\n return $this->node->isStatic();\n }", "public function isStatic(): bool\n {\n return $this->node->isStatic();\n }", "public function isStaticTheme(): bool\n {\n retur...
[ "0.8042929", "0.7673979", "0.7673979", "0.6878788", "0.6853044", "0.66025376", "0.6580997", "0.64821136", "0.6453732", "0.64506346", "0.6399567", "0.6348692", "0.6344331", "0.63267165", "0.6313184", "0.6196214", "0.6001549", "0.59658587", "0.5951252", "0.5930301", "0.58975476...
0.8106914
0
Whether the property is readonly.
public function isReadonly() : bool { return (bool) ($this->flags & Class_::MODIFIER_READONLY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isReadonly(): bool\n {\n return $this->readonly;\n }", "function isReadonly()\n {\n return $this->readonly;\n }", "public function isReadonly()\n {\n return $this->_isReadonly;\n }", "public function isReadonly()\n {\n return false;\n }", ...
[ "0.8707159", "0.86648536", "0.8519748", "0.8339267", "0.8332303", "0.83156174", "0.83086103", "0.8211605", "0.81598216", "0.8140601", "0.8137887", "0.8074169", "0.8073864", "0.80503345", "0.8017648", "0.8008397", "0.798483", "0.798483", "0.798483", "0.7980149", "0.7941318", ...
0.8507971
3
$modifs = [ [ "modtype" => "add", "entry" => array("cn"=>["SmithJones"]), ], ];
public function getModifyValues() { $a = array(); foreach($this->_states_ as $n => $v ){ if(($v === self::MODTYPE_ADD || $v === self::MODTYPE_RM || $v === self::MODTYPE_REPLACE) && !($this->_values_[$n]==="")){ $a [] = array( "modtype"=>$v, "entry" =>array("$n" => $this->_values_[$n]) ); } } return $a; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add(array $entry);", "public function add_entry($entry);", "function addMember($arr, $key, $name, $birthday, $email){\n\t\t$arr[$key]['name'] = $name;\n\t\t$arr[$key]['birthday'] = $birthday;\n\t\t$arr[$key]['email'] = $email;\n\t\treturn $arr;\n\t}", "function eio_grp_add($grp, $req)\n{\n}",...
[ "0.57095605", "0.55301386", "0.537621", "0.53369457", "0.5316902", "0.51243466", "0.5092822", "0.5088854", "0.5060994", "0.50297606", "0.5028835", "0.50194687", "0.5004327", "0.50026685", "0.4979404", "0.49465567", "0.4938897", "0.49335468", "0.49330348", "0.49307767", "0.491...
0.47924474
33
This runs on every query and makes sure that only records within the current conference can be shown. Eg, you can't see presentations that belong to another conference. If you do want this, remove this method. For the Conference model this is different because this model allows you to edit other conference info regardless the current conference_id (defined by hostname)
public function init() { if (isset($this->conference_id)) { if (!$this->conference_id) { return; } } $request = Zend_Controller_Front::getInstance()->getRequest(); if ( ($request->getControllerName() != 'conference') && ($request->getModuleName() == 'core') && (isset($this->conference_id)) && ($this->getTable()->getConferenceId()) ) { try { if ($this->getTable()->getConferenceId() != $this->conference_id) { throw new TA_Model_Resource_Db_Table_Row_Exception('This record does not match the conference identifier, eg. you are trying to view a record not in this conference'); } } catch (Zend_Db_Table_Row_Exception $e) { //do nothing } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function conference()\n {\n return $this->belongsTo(Conference::class);\n }", "public function findByConference($id)\n {\n return $this->model->where('conference_id', $id);\n }", "public function conference ($appointment_hash = NULL)\n {\n /* - - - - -Avoid page from...
[ "0.60403347", "0.55106777", "0.5411407", "0.49007103", "0.48556164", "0.4836632", "0.47707105", "0.4759692", "0.4738614", "0.47318187", "0.47248855", "0.4714006", "0.4682797", "0.46762115", "0.46659556", "0.46488267", "0.46191534", "0.46166414", "0.46138078", "0.46130016", "0...
0.58388996
1
Return column/value pairs with date values transformed to Zend_Date objects
public function toMagicArray($dateFormat = null) { $metadata = $this->getTable()->info('metadata'); foreach ($metadata as $column => $metadata) { if ($metadata['DATA_TYPE'] == 'timestamptz') { if ($this->$column) { $this->$column = $this->_isoToNormalDate($this->$column, $dateFormat); } } } return $this->toArray(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDates()\n {\n $sql = $this->tableGateway->getSql();\n $select = $sql->select();\n\n $select->columns(array('date'));\n $select->group('date');\n $select->where('TIMESTAMP(`date`,`to`) > NOW()');\n //$select->order('date ASC');\n $select->limit(...
[ "0.6017713", "0.5983906", "0.5954415", "0.59288406", "0.58567744", "0.58438146", "0.58105385", "0.5755734", "0.57237107", "0.56834817", "0.5656623", "0.56048656", "0.5531684", "0.5494284", "0.5487669", "0.5473291", "0.54728496", "0.5461339", "0.5459324", "0.5450524", "0.54107...
0.52105993
35
Transforms DB timestamp to normal date
protected function _isoToNormalDate($value, $dateFormat = null) { $zendDate = new Zend_Date( $value, Zend_Date::ISO_8601, Zend_Registry::get('Zend_Locale') //@todo: it seems I can remove this, because Zend gets this automatically ); if ($dateFormat) { return $zendDate->get($dateFormat); } return $zendDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function variant_date_from_timestamp($timestamp) {}", "function toDate ($timestamp)\n\t{\n\t\treturn date('Y-m-d', $timestamp);\n\t}", "function timestampToDate($t) {\n return date(\"d-m-Y\",$t);\n}", "private function ConvertPayPalTimestampToDBDateTime($timestamp)\n {\n\tif(strlen($timestamp) == 0) {\...
[ "0.6715593", "0.6697303", "0.66312283", "0.66169554", "0.6590467", "0.6546678", "0.6516426", "0.64353454", "0.63989764", "0.6393552", "0.6364486", "0.63637686", "0.63245696", "0.632122", "0.63062197", "0.62946856", "0.6279762", "0.62361616", "0.6199128", "0.6193797", "0.61703...
0.0
-1