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
Transform the given resource, and serialize the data with the given serializer.
public function make(ResourceInterface $resource, SerializerAbstract $serializer, array $options = []) { $options = $this->parseOptions($options, $resource); return $this->manager->setSerializer($serializer) ->parseIncludes($options['includes']) ->parseExcludes($options['excludes']) ->parseFieldsets($options['fieldsets']) ->createData($resource) ->toArray(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function transformResource($resource);", "public function serialize(ResourceInterface $resource, ResourceSerializationContext $context): string;", "public function transform()\n {\n $object = $this->resource;\n\n $data = $object instanceof Collection || $object instanceof Abstr...
[ "0.7339129", "0.6275892", "0.6226187", "0.61327666", "0.60439295", "0.59515953", "0.5933684", "0.5906503", "0.58640724", "0.5722398", "0.56925803", "0.5649679", "0.56295997", "0.5601711", "0.5487312", "0.5470276", "0.54135346", "0.5395011", "0.5345062", "0.5339683", "0.532838...
0.6287341
1
Parse the transformation options.
protected function parseOptions(array $options, ResourceInterface $resource): array { $options = array_merge([ 'includes' => [], 'excludes' => [], 'fieldsets' => [], ], $options); if (! empty($options['fieldsets'])) { if (is_null($resourceKey = $resource->getResourceKey())) { throw new LogicException('Filtering fields using sparse fieldsets require resource key to be set.'); } $options['fieldsets'] = $this->parseFieldsets($options['fieldsets'], $resourceKey, $options['includes']); } return $options; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _parseOptions($options) {\n\n if ( isset($options['dir']) ) {\n $this->dir = $options['dir'];\n }\n\n if ( isset($options['output'] ) ) {\n $this->output = $options['output'];\n }\n }", "protected function parse(): void\n {\n $parseO...
[ "0.64434844", "0.63370687", "0.61559653", "0.583622", "0.569475", "0.5576943", "0.55347776", "0.5509084", "0.5475196", "0.5471261", "0.5428163", "0.54002935", "0.53544784", "0.53475493", "0.53296775", "0.5323861", "0.5245392", "0.52443326", "0.52404094", "0.52160716", "0.5211...
0.0
-1
Parse the fieldsets for Fractal.
protected function parseFieldsets(array $fieldsets, string $resourceKey, array $includes): array { $includes = array_map(function ($include) use ($resourceKey) { return "$resourceKey.$include"; }, $includes); foreach ($fieldsets as $key => $fields) { if (is_numeric($key)) { unset($fieldsets[$key]); $key = $resourceKey; } $fields = $this->parseFieldset($key, (array) $fields, $includes); $fieldsets[$key] = array_unique(array_merge(key_exists($key, $fieldsets) ? (array) $fieldsets[$key] : [], $fields)); } return array_map(function ($fields) { return implode(',', $fields); }, $fieldsets); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setFieldsetsAndFields() {\n\t\t$Dataset = new FormularFieldset(__('Your Dataset'));\n\t\t$Dataset->setHtmlCode($this->getCode());\n\t\t$Dataset->addInfo( __('You can specify which values show up in the overview of your activities.').'<br>'.\n\t\t\t\t\t\t\t__('This does not influence the detailed ac...
[ "0.621226", "0.6145185", "0.60931283", "0.60651743", "0.60604435", "0.5899877", "0.5846825", "0.57718366", "0.5608294", "0.55899405", "0.55829585", "0.55675024", "0.55483866", "0.5535791", "0.5424805", "0.5421479", "0.5404015", "0.5360718", "0.5338165", "0.53086716", "0.53057...
0.53864276
17
Parse the given fieldset and append any related resource keys.
protected function parseFieldset(string $key, array $fields, array $includes): array { $childIncludes = array_reduce($includes, function ($segments, $include) use ($key) { return array_merge($segments, $this->resolveChildIncludes($key, $include)); }, []); return array_merge($fields, array_unique($childIncludes)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addFieldSet($fieldset) {\n\t\t$this->fieldsets[] = $fieldset;\n\t}", "public function prepareFieldset();", "public static function getFormFields($model, $fieldset = null, $mapping = null){\n\t\tif (!$fieldset || strtolower($fieldset) == 'form') {\n\t\t\t$fieldset = 'scaffold';\n\t\t}\n\t\t$bind...
[ "0.57472545", "0.5323171", "0.5310453", "0.52477765", "0.517298", "0.517025", "0.51319945", "0.51095396", "0.5089681", "0.49296865", "0.49261364", "0.48760328", "0.48755682", "0.48265404", "0.48222604", "0.4759858", "0.46920496", "0.46641815", "0.46522045", "0.46432373", "0.4...
0.0
-1
Resolve included segments that are a direct child to the given resource key.
protected function resolveChildIncludes($key, string $include): array { if (count($segments = explode('.', $include)) <= 1) { return []; } $relation = $key === array_shift($segments) ? [$segments[0]] : []; return array_merge($relation, $this->resolveChildIncludes($key, implode('.', $segments))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSegment($key);", "public function resolve($key);", "public function getByParent($key);", "public function Resolve($key);", "protected function parseNamespacedSegments($key)\n {\n list($namespace, $item) = explode('::', $key);\n\n // If the namespace is registered as a pa...
[ "0.51943487", "0.50396746", "0.500474", "0.4793643", "0.4777115", "0.46048528", "0.45161134", "0.44900838", "0.44562134", "0.44359654", "0.44185326", "0.440884", "0.4380058", "0.43690786", "0.43619815", "0.4318091", "0.42415175", "0.41752437", "0.41444394", "0.41420126", "0.4...
0.5911619
0
Returns description of macro, use, and accepted arguments
public function description() { $txt = array(); $txt['wiki'] = "Displays group events"; $txt['html'] = '<p>Displays group events.</p>'; $txt['html'] = '<p>Examples:</p> <ul> <li><code>[[Groupevent(number=3)]]</code> - Displays the next three group events</li> <li><code>[[Groupevent(title=Group Events, number=2)]]</code> - Adds title above event list. Displays 2 events.</li> <li><code>[[Groupevent(id=123)]]</code> - Displays single group event with ID # 123</li> </ul>'; return $txt['html']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMacroString(): string\n {\n return $this->macroString;\n }", "function defineDescription() {\n return 'List all available commands with a short description';\n }", "static function help($description, $cmdline, array $parameters) \n {\n\n }", "function fpg_definit...
[ "0.58642614", "0.57198465", "0.5688616", "0.5616013", "0.5475116", "0.54723245", "0.5419684", "0.538304", "0.5355571", "0.53491145", "0.5341322", "0.53347474", "0.5318063", "0.53105116", "0.5303859", "0.52531683", "0.5237085", "0.5209911", "0.5204668", "0.52001834", "0.518222...
0.0
-1
Query for group events
private function getGroupEvents( $group, $filters = array() ) { //instantiate database $database = App::get('db'); //build query $sql = "SELECT * FROM `#__events` WHERE publish_up >= UTC_TIMESTAMP() AND scope=" . $database->quote('group') . " AND scope_id=" . $database->Quote($group->get('gidNumber')) . " AND state=1"; //do we have an ID set if (isset($filters['id'])) { $sql .= " AND id=" . $database->Quote( $filters['id'] ); } //add ordering $sql .= " ORDER BY publish_up ASC"; //do we have a limit set if (isset($filters['number'])) { $sql .= " LIMIT " . $filters['number']; } //return result $database->setQuery($sql); return $database->loadObjectList(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getGroupEvents($id){\n $events = DB::table('group_events')\n ->where('group_id', '=', $id)\n ->whereNull('deleted_at');\n return $events;\n }", "public function events( $fields = '' ) {\n\t\treturn $this->client->getGroup( [\n\t\t\t'urlname' => $this->group,\n\t\t 'fields' ...
[ "0.65181583", "0.6408002", "0.60112226", "0.5999194", "0.5971994", "0.58897424", "0.5871323", "0.5864656", "0.58483195", "0.58332855", "0.5816507", "0.57964534", "0.5775302", "0.5770582", "0.5756007", "0.5734936", "0.5725029", "0.5685236", "0.56606984", "0.56358355", "0.56311...
0.62323684
2
/si existe el objeto
public function index(Request $request) { if($request) { /*podre obtener todos los registros de la base de datos*/ $query=trim($request->get('searchText')); /* se coloca el nombre de la tabla en donde se obtendran los registros*/ $especialidades=DB::table('Especialidad')->where('nombre','LIKE','%'.$query.'%') ->where ('condicion','=','1') ->orderBy('idEspecialidad','desc') ->paginate(5); /*aqui es donde se crean las carpetas*/ return view('registro.especialidad.index',["especialidades"=>$especialidades,"searchText"=>$query]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function exist($id){\n $rq = \"SELECT * FROM Objets WHERE id = :id\";\n $stmt = $this->pdo->prepare($rq);\n $data = array(\":id\" => $id);\n if(!$stmt->execute($data)){\n throw new Exception($pdo->errorInfo());\n }\n if($stmt->rowCount() > 0){\n ...
[ "0.68431485", "0.667574", "0.661937", "0.6577944", "0.65403473", "0.65100527", "0.6501511", "0.649743", "0.64866936", "0.64082694", "0.640642", "0.6362405", "0.63334703", "0.6304506", "0.63017946", "0.6301141", "0.62321895", "0.6205071", "0.6184529", "0.61618346", "0.61618346...
0.0
-1
/en esta seccion se realizo un cambi o de letra por mayuscula
public function show($id) { return view("registro.especialidad.show",["especialidad"=>Especialidad::findOrFail($id)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function procesar_cambio ($datos){\n //validamos que no exista otro periodo, para ello tomamos la fecha actual y obtenemos todos los periodo \n //que existen con sus respectivos dias y verificamos que el espacio que se quiere cargar no este ocupado en esos \n //dias\n \n...
[ "0.63051873", "0.6178388", "0.59874576", "0.59498256", "0.5944988", "0.594424", "0.59440386", "0.5902308", "0.5867017", "0.58595", "0.58540356", "0.58509314", "0.5823323", "0.5812478", "0.57747006", "0.57692826", "0.57575256", "0.5755964", "0.5751442", "0.5749754", "0.5742307...
0.0
-1
Create a new controller instance.
public function __construct() { }
{ "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
Show the application dashboard.
public function index() { return view('home'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n ...
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", ...
0.0
-1
Given a datetime, returns two datetimes, one with first second of the given day, and the other with the first second of next day
protected function getDayRange($date = null) { $date = !is_object($date) ? new \DateTime('TODAY') : $date; $startAt = \DateTime::createFromFormat('Y-m-d H:i:s', date("Y-m-d H:i:s", mktime(0, 0, 0, $date->format('m'), $date->format('d'), $date->format('Y')))); $endAt = clone $startAt; $endAt->modify('+1 day'); return array($startAt, $endAt); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function snapToSecond(): self\n {\n return new self(\n DatePoint::fromDate($this->startDate)->second()->startDate(),\n DatePoint::fromDate($this->endDate)->second()->endDate(),\n $this->bounds\n );\n }", "function getNextDay(){\r\n $dia = Data_Ca...
[ "0.511757", "0.50206476", "0.48857266", "0.48644817", "0.48464334", "0.47891855", "0.47503102", "0.4727731", "0.46840614", "0.46599853", "0.46309114", "0.46084163", "0.46014196", "0.4518214", "0.45135102", "0.44815618", "0.4479986", "0.44434792", "0.4385757", "0.43846914", "0...
0.0
-1
Given a datetime, returns two datetimes, one with first day of the given month, and the other with the first day of next month
protected function getMonthRange($date = null) { $date = !is_object($date) ? new \DateTime('TODAY') : $date; $startAt = \DateTime::createFromFormat('Y-m-d H:i:s', date("Y-m-d H:i:s", mktime(0, 0, 0, $date->format('m'), 1, $date->format('Y')))); $endAt = clone $startAt; $endAt->modify('+1 month'); return array($startAt, $endAt); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function data_first_month() {\n\t$month = date('m');\n\t$year = date('Y');\n\treturn date('Y-m-d', mktime(0,0,0, $month, 1, $year));\n}", "protected function startDate()\n {\n $d = new DateTime('first day of last month');\n $d->setTime(0, 0, 0);\n return $d;\n }", "func...
[ "0.65510756", "0.64819825", "0.64037824", "0.63896966", "0.6341828", "0.629297", "0.6232996", "0.6113486", "0.61058354", "0.6081079", "0.5987621", "0.5950634", "0.59351784", "0.5933844", "0.593269", "0.58682024", "0.5866758", "0.5862977", "0.5812257", "0.58082753", "0.5796713...
0.5217193
46
Given a datetime, returns two datetimes, one with first day of the given year, and the other with the first day of next year
protected function getYearRange($date = null) { $date = !is_object($date) ? new \DateTime('TODAY') : $date; $startAt = \DateTime::createFromFormat('Y-m-d H:i:s', date("Y-m-d H:i:s", mktime(0, 0, 0, 1, 1, $date->format('Y')))); $endAt = clone $startAt; $endAt->modify('+1 year'); return array($startAt, $endAt); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getFirstDayOfCurrentYear()\n\t{\n\t\t$dateInSeconds = mktime(0, 0, 0, 1, 1, date('Y'));\n\t\t$date = date('Y-m-d', $dateInSeconds);\n\t\treturn $date;\n\t}", "function nextYear($interval=1){ return $this->_getDate(0,0,$interval); }", "public static function createFromYear($year)\n {\n...
[ "0.6728055", "0.66671145", "0.6460425", "0.6460425", "0.62270594", "0.6204767", "0.618731", "0.61327356", "0.60020375", "0.5997086", "0.59464645", "0.5903922", "0.5865142", "0.5826837", "0.5823007", "0.57446814", "0.5740973", "0.57207304", "0.56946987", "0.56843156", "0.56714...
0.56817096
20
Action of getting list of main categories
public function run(): ActiveDataProvider { /** @var $category MainCategorySectionEntity.php */ $category = new $this->modelClass; return $category->search(Yii::$app->request->queryParams); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function showMainCategories()\n {\n $category = new Category;\n \n return new ViewResponse(\"frontend::categories::main.php\", [\n 'categories' => $category->getCollection( $category->byName($category->allParent()) ) \n ]);\n }", "public function getAllMainCate...
[ "0.7731627", "0.76224846", "0.756345", "0.756345", "0.7478371", "0.7471747", "0.73586774", "0.73557115", "0.73111844", "0.7269482", "0.72247195", "0.71986455", "0.71982497", "0.7124903", "0.71246314", "0.7118776", "0.7077425", "0.7069198", "0.7024604", "0.7006243", "0.7003454...
0.0
-1
Create tables in db
public static function up(){ DBW::create('Comment',function($t){ $t -> varchar('name') -> text('message') -> tinyint('public_flag') -> datetime('timestamp'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createTables()\n {\n $this->createConfigsTable();\n $this->createServersTable();\n $this->createSearchesTable();\n }", "public static function create_tables() {\n Site::create_table();\n Membership_Area::create_table();\n Restricted_Content::create_table();\n ...
[ "0.84406036", "0.83542097", "0.82980263", "0.8195946", "0.8002375", "0.7942317", "0.7939871", "0.79369557", "0.7888796", "0.7834099", "0.78016144", "0.77424884", "0.7728628", "0.76959133", "0.7690026", "0.7623613", "0.7524307", "0.7523996", "0.7511739", "0.74675983", "0.74342...
0.0
-1
Drop tables from db
public static function down(){ DBW::drop('Comment'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function dropDatabaseTables()\n {\n $this->useCamundaDatabase(function() {\n if ($tables = DB::select('SHOW TABLES')) {\n $this->line('Dropping existing database tables...');\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n foreach ($tab...
[ "0.8187412", "0.7894082", "0.77647614", "0.77567846", "0.77298355", "0.7666467", "0.75771344", "0.7574214", "0.756225", "0.7547076", "0.7547076", "0.7537164", "0.74000776", "0.7391763", "0.7391623", "0.7367011", "0.73607683", "0.73594075", "0.72993624", "0.7298619", "0.726148...
0.0
-1
hoja de vida admnin en la sede
function Inhabilitarq_admin1(){ require '../../conexion.php'; $cate=date('Y-m-d'); echo $consultar_nivel= "UPDATE `administradores` SET `INHABILITADO` = '1',`decreto_traslado` = '".$_POST['u']."', `fecha_traslado` = '".$cate."' WHERE `administradores`.`ID_ADMIN` = ".$_POST['io'].""; $consultar_nivel1=$conexion->prepare($consultar_nivel); $consultar_nivel1->execute(array()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function valorpasaje();", "function cc_ho_vetrina($agenzia, $rif){\n\tglobal $invetrina;\n\t\n\t// $agenzia qua è il numero interno di Cometa\n\tif( isset( $invetrina[$agenzia] ) ){\t\t\n\t\t\n\t\tif ($invetrina[$agenzia]['imm'] == $rif) {\n\t\t\t// questo immobile è in vetrina\n\t\t\t$vetrina = '1';\n\t\...
[ "0.67037445", "0.66259015", "0.6406372", "0.6372174", "0.6363704", "0.63108146", "0.6254146", "0.6203818", "0.6180267", "0.6137401", "0.61024684", "0.6098285", "0.6078396", "0.60733074", "0.607026", "0.6037753", "0.6035296", "0.60192764", "0.6011145", "0.6008205", "0.5997702"...
0.0
-1
hi Some hacky stuff to get rid of that iFrame PayPal introduces Submits the top form after it appends the GET variables from PayPal
public function check_paypal_return() { // Cancel payment if ( isset( $_GET['paypal_digital'] ) && $_GET['paypal_digital'] == 'cancel' ) { wp_print_scripts( 'jquery' ); ?><script> jQuery(function() { var blocker = top.document.getElementById("PPDGFrame"); // Checkout button var button = top.document.getElementsByName('bundle_checkout')[0]; jQuery(button).html('Checkout'); jQuery(button).prop('disabled', false); // Tip button var button = top.document.getElementsByName('giveTip'); jQuery(button[0]).html('Checkout'); jQuery(button[0]).prop('disabled', false); jQuery(button[1]).html('Checkout'); jQuery(button[1]).prop('disabled', false); jQuery(blocker).remove(); }); </script><?php exit; } // Returning from PayPal if ( isset( $_GET['PayerID'] ) && ( isset( $_GET['paypal_digital'] ) && $_GET['paypal_digital'] == 'paid' ) ) { EDD_PPDG_PayPal_IPN::load_block_ui(); ?><script> jQuery(function() { var form = top.document.forms["bundle-checkout-form"]; // If it wasn't the bundle checkout, let's see which tip form it might be if (!form) { // First we try the sharing form form = top.document.forms["tipshare-form"]; var button = jQuery(form).find('[name=giveTip]'); if (button.html() != 'Processing...') { // It wasn't the first tip form, so let's assume it's the second form = top.document.forms["tipster-form"]; } } var paypal_digital = jQuery('<input type="hidden" name="paypal_digital">').val('<?php echo $_GET["paypal_digital"]; ?>'); var payerid = jQuery('<input type="hidden" name="PayerID">').val('<?php echo $_GET["PayerID"]; ?>'); var token = jQuery('<input type="hidden" name="token">').val('<?php echo $_GET["token"]; ?>'); jQuery(form).append(paypal_digital); jQuery(form).append(payerid); jQuery(form).append(token); jQuery(form).submit(); }) </script><?php exit; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submit_paypal_post() {\n // a form with hidden elements which is submitted to paypal via the \n // BODY element's onLoad attribute. We do this so that you can validate\n // any POST vars from you custom form before submitting to paypal. So \n // basically, you'll have your own form w...
[ "0.68001527", "0.661467", "0.6596413", "0.6139517", "0.6118776", "0.61084944", "0.60322404", "0.597377", "0.5923005", "0.5874106", "0.5864122", "0.58513916", "0.5819222", "0.5806651", "0.56816393", "0.56504023", "0.56244314", "0.56051666", "0.55267453", "0.5524667", "0.550733...
0.59317255
8
Load locally Font Awesome externaly
function enqueue_our_required_stylesheets(){ wp_enqueue_style('font-awesome', get_stylesheet_directory_uri() . '/css/font-awesome/css/font-awesome.css'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pagely_load_font_awesome() {\n\t\n\twp_enqueue_style( 'font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css', false, false, false ); \n}", "public function enqueue_font_awesome() {\n\t\tglobal $hestia_load_fa;\n\n\t\tif ( $hestia_load_fa !== true ) {\n\t\t\treturn ...
[ "0.72500086", "0.6890719", "0.6795949", "0.6689029", "0.6622551", "0.63101125", "0.62916046", "0.6250702", "0.61850107", "0.617171", "0.61546326", "0.61432326", "0.60146", "0.5901928", "0.5895587", "0.5863318", "0.5846166", "0.5835009", "0.5758817", "0.5757164", "0.57394576",...
0.59452474
13
Theme files model initialization
protected function _construct() { $this->_init(\Magento\Theme\Model\ResourceModel\Theme\File::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init_theme() {\r\n\r\n\t\t$possible_names = self::get_theme_name();\r\n\r\n\t\tforeach( $possible_names as $type => $name ){\r\n\r\n\t\t\t$theme_class = \"WP_Job_Manager_Field_Editor_Themes_\" . ucfirst( $name );\r\n\r\n\t\t\tif( class_exists( $theme_class ) ) {\r\n\t\t\t\t$theme = new $theme_class();\r\n...
[ "0.6800195", "0.6731695", "0.67305124", "0.67175525", "0.6597495", "0.6528827", "0.6504817", "0.6497808", "0.64037544", "0.63582635", "0.6344182", "0.6338255", "0.6320793", "0.6295597", "0.6273367", "0.6236512", "0.6214242", "0.6148983", "0.613683", "0.6130994", "0.61259943",...
0.7487144
0
Prepare file before it will be saved
public function beforeSave() { $fileService = $this->getCustomizationService(); $fileService->prepareFile($this); $fileService->save($this); return parent::beforeSave(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prepareFile()\n {\n // TODO: Implement prepareFile() method.\n }", "public function prepareFile() {\n\t\t// Check if the file do exists\n\t\tif (!is_dir($this->filedir)) {\n\t\t\t// Create empty directory for the userexport\n\t\t\tif (!mkdir($this->filedir, 0755)) {\n\t\t\t\t// Creat...
[ "0.83557665", "0.72432405", "0.65779614", "0.6370905", "0.6212607", "0.61622685", "0.61367375", "0.5840125", "0.58254534", "0.57053554", "0.5699601", "0.5685358", "0.5624671", "0.56105417", "0.55815697", "0.55481946", "0.55298483", "0.5493701", "0.5485542", "0.5470916", "0.54...
0.6321023
4
Prepare file before it will be deleted
public function beforeDelete() { $fileService = $this->getCustomizationService(); $fileService->delete($this); return parent::beforeDelete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prepareFile()\n {\n // TODO: Implement prepareFile() method.\n }", "public function prepareFile() {\n\t\t// Check if the file do exists\n\t\tif (!is_dir($this->filedir)) {\n\t\t\t// Create empty directory for the userexport\n\t\t\tif (!mkdir($this->filedir, 0755)) {\n\t\t\t\t// Creat...
[ "0.80228716", "0.79526275", "0.65727234", "0.63429105", "0.6293853", "0.62936807", "0.6271724", "0.62229", "0.6119158", "0.6046558", "0.60042024", "0.5869776", "0.5838994", "0.5771447", "0.57157636", "0.56980306", "0.5682228", "0.5666794", "0.56273854", "0.56260127", "0.55952...
0.0
-1
Run the database seeds.
public function run() { $consejocomunales = [ 'CUADRA DE BOLIVAR', 'GTC', 'LIDERES DE QUINTA CRESPO', 'SUR 4', ]; foreach($consejocomunales as $consejocomunal) { $inputs[]=['nombre_consejo_comunal'=>$consejocomunal, 'created_at'=>now(), 'updated_at'=>now(), ]; } ConsejoComunal::insert($inputs); }
{ "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
Adds parameters to the parameters list. Existing parameters will be preserved.
public function add(array $parameters);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function add_parameters($params = array())\n\t{\n\t\tforeach ($params as $param)\n\t\t{\n\t\t\t$this->add_parameter($param['name'], $param);\n\t\t}\n\t}", "public function addParams($parameters){\n\t\t\tif(is_array($parameters)){\n\t\t\t\tforeach ($parameters as $key=>$value) {\n\t\t\t\t\t$this->addPar...
[ "0.72710747", "0.7168612", "0.6997212", "0.6882149", "0.6831347", "0.6584377", "0.6551827", "0.6526356", "0.6503619", "0.64299524", "0.6426557", "0.6244276", "0.6224035", "0.61692095", "0.6123231", "0.61003435", "0.6056361", "0.60295343", "0.60172564", "0.60032135", "0.598990...
0.69284534
3
Gets all parameters. Alias of all().
public function getAll();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function all()\r\n {\r\n return $this->parameters;\r\n }", "public function all()\n {\n return $this->params;\n }", "public function getAllParam()\n {\n return isset($this->params) ? $this->params : null;\n }", "public function getParameters()\n {\n return $thi...
[ "0.8583619", "0.85735244", "0.8019177", "0.77445775", "0.76646143", "0.72774684", "0.7212084", "0.7212084", "0.7212084", "0.7212084", "0.7212084", "0.7212084", "0.7212084", "0.7212084", "0.7052244", "0.7052244", "0.7052244", "0.7052244", "0.7052244", "0.7052244", "0.7052244",...
0.0
-1
Returns true if a parameter name is defined.
public function has($name);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function has_parameter( $name ) {\n\t\treturn ! empty( $this->parameters[ $name ] );\n\t}", "public function hasParameter($name)\n {\n return array_key_exists($name, $this->parameters);\n }", "public function hasParameter(string $name): bool\n {\n return isset($this->parameters...
[ "0.8393713", "0.8341317", "0.8306979", "0.82981473", "0.82981473", "0.8247657", "0.82252705", "0.8212532", "0.8203109", "0.818559", "0.81779355", "0.8163702", "0.8161107", "0.8145657", "0.8122167", "0.80448806", "0.7980535", "0.79222465", "0.7892111", "0.7815151", "0.77349365...
0.0
-1
get contractors for category
function display($tmpl) { $cat = JRequest::getVar('cat'); $method = JRequest::getVar('method'); if($method == 'choosencat') { echo $this->getContractorsForCategory($cat); die(); } // get contractors for all categories $categories = $this->getAllCategories($cat); foreach ($categories as $categorie) { $categoriesContractors[$categorie->id] = $this->getContractorsForCategory($categorie->id); $categorieName[$categorie->id] = $categorie->catname; } $category_contractors = array_combine($categorieName, $categoriesContractors); arsort($category_contractors); $category_contractors = json_encode($category_contractors); echo $category_contractors; die(); parent::display($tmpl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getContractors()\n {\n return $this->hasMany(User::className(), ['id' => 'contractor_id'])->viaTable('favorite_contractor', ['customer_id' => 'id']);\n }", "function getConveyancingCompanies(){\n \n $conveyancingCompanies = array();\n \n $conveyancingLeadTypeCatIds = unse...
[ "0.6516423", "0.60534227", "0.5959141", "0.5891746", "0.58585215", "0.57167983", "0.57167983", "0.57001567", "0.5670047", "0.56605744", "0.56597155", "0.56583565", "0.5618464", "0.5611199", "0.56075513", "0.56075513", "0.5588957", "0.5544424", "0.5530724", "0.5516832", "0.550...
0.50486904
84
calculate distance between two places
public function distance($lat1, $lng1, $lat2, $lng2, $miles = true) { $pi80 = M_PI / 180; $lat1 *= $pi80; $lng1 *= $pi80; $lat2 *= $pi80; $lng2 *= $pi80; $r = 6372.797; // mean radius of Earth in km $dlat = $lat2 - $lat1; $dlng = $lng2 - $lng1; $a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlng / 2) * sin($dlng / 2); $c = 2 * atan2(sqrt($a), sqrt(1 - $a)); $km = $r * $c; return ($miles ? ($km * 0.621371192) : $km); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateDistance($first, $second)\r\n{\r\n return abs($first - $second);\r\n}", "function distance($lat1,$lon1,$lat2,$lon2){\n $delta_lat = $lat2-$lat1;\n $delta_lon = $lon2-$lon1;\n return (($delta_lat * $delta_lat) + ($delta_lon * $delta_lon));\n}", "public function calculateDistanceBetween(str...
[ "0.77610487", "0.76158", "0.7522438", "0.73643893", "0.7326963", "0.7248142", "0.71561724", "0.7099443", "0.706053", "0.70364004", "0.6989083", "0.69749033", "0.69577885", "0.694888", "0.69279116", "0.69217247", "0.6891768", "0.68254495", "0.6818011", "0.68116987", "0.6794835...
0.60588664
81
Returns whether the supplied value is a value type.
public static function isValueType($value) { if (is_scalar($value) || $value === null) { return true; } elseif (is_array($value)) { $isScalar = true; array_walk_recursive($value, function ($value) use (&$isScalar) { if ($isScalar && !(is_scalar($value) || $value === null)) { $isScalar = false; } }); return $isScalar; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isValue()\n {\n return\n $this->type === 'string' ||\n $this->type === 'number' ||\n $this->type === 'null' ||\n $this->type === 'boolTrue' ||\n $this->type === 'boolFalse';\n }", "final public function isType(string $value):bool\n {\n ret...
[ "0.809748", "0.7780862", "0.73132294", "0.72554064", "0.71008927", "0.70079076", "0.69856507", "0.69838655", "0.68819124", "0.687105", "0.6859007", "0.6822661", "0.67740864", "0.67572004", "0.6708007", "0.66971725", "0.66896874", "0.668202", "0.6679527", "0.66275203", "0.6607...
0.77763796
2
Run the database seeds.
public function run() { User::create([ 'name' => 'igo', 'email' => 'igo@test.ru', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'Алхимик', 'email' => 'alkhimik@test.ru', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'Ярус', 'email' => 'jarusrus@test.ru', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'AVZ', 'email' => 'avz@test.ru', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'artel', 'email' => 'artel@test.ru', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'Phantom', 'email' => 'phantom@test.ru', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'liveparhomenko', 'email' => 'liveparhomenko@test.ru', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'Лёха', 'email' => 'leha@test.ru', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'AndreWWW', 'email' => 'usachenko@test.ru', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'MikhailChurikov', 'email' => 'barrister2003@gmail.com', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'admin', 'email' => 'admin@test.ru', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); }
{ "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
calculate the hash from a salt and a password
public function getPasswordHash($salt,$password) { return hash('whirlpool',$salt.$password); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHash($plaintext, $salt = false);", "function getPasswordHash($password,$salt){\n\t\treturn hash('sha256',$salt.$password);\n}", "function getHash( $password, $salt = '' )\r\n{\r\n\treturn hash( 'sha256', $password . $salt );\r\n}", "public static function calculateHash($password, $salt = N...
[ "0.8000154", "0.792624", "0.7875374", "0.77660835", "0.7694312", "0.7682023", "0.76436245", "0.76034766", "0.7601997", "0.75511366", "0.75480235", "0.74727935", "0.7361804", "0.73225516", "0.7320579", "0.7308873", "0.73048615", "0.73025006", "0.7281019", "0.7269301", "0.72649...
0.77189004
4
compare a password to a hash
public function comparePassword($password,$hash) { $salt = substr( $hash, 0, 8 ); return $hash == getPasswordHash($salt,$password); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function comparePasswordHash($pwd, $hash);", "public function verifyPassword (string $hash, string $password): bool;", "function comparePassword($password, $hash){\t\n\t\t$salt = substr($hash, 0, 8);\n\t\treturn $hash === $salt . ( hash('sha256', $salt . $password ));\n\t}", "function verifyHash($pass...
[ "0.84183806", "0.82081324", "0.80464685", "0.7897498", "0.7856224", "0.7845529", "0.78226334", "0.7798452", "0.7786626", "0.7763831", "0.7663868", "0.7581365", "0.75544554", "0.75210744", "0.75132596", "0.75064105", "0.7505626", "0.74768686", "0.74745095", "0.7450916", "0.744...
0.7343482
29
Relizo la preparacion de mi query utilizando PDO
public function createUser($correo) { $query = $this->connect()->prepare('SELECT * FROM users WHERE Correo = :correo'); $query->execute(['correo' => $correo]); //Guardo el obj PDO en cadenaValida $this->cadenaValida = $query->fetch(); //si el resultado retorna true no inserta, de lo contrario inserta if ($this->cadenaValida) { //El usuario ya existe, hay que retornar mensaje de lo que paso return $resultado = true; }else { //El correo buscado no existe, hay que insertar en tabla users //Obtenemos el ultimo valor de ID de usuario para agregar al nuevo $idTemp = $this->connect()->query('SELECT MAX(IDUsuario) FROM users'); $a = $idTemp->fetch(PDO::FETCH_BOTH); $this->idu = $a[0]; $this->idu = (int) $this->idu + 1; $this->nombre = $_POST['name']; $this->apellidoP = $_POST['ap']; $this->apellidoM = $_POST['am']; $this->correo = $_POST['correo']; $this->pass = md5($_POST['pass']); $this->rol = 1; $query = $this->connect()->prepare( 'INSERT INTO users VALUES( :idTemp, :nombre, :apellidoP, :apellidoM, :correo, :pass, :rol)' ); $query->execute([ 'idTemp' => $this->idu, 'nombre' => $this->nombre, 'apellidoP' => $this->apellidoP, 'apellidoM' => $this->apellidoM, 'correo' => $this->correo, 'pass' => $this->pass, 'rol' => $this->rol]); return $resultado = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function preExe(){\n\t\t$pre = $this->prepare($this->_query);\n\t\t$pre->execute();\n\t\treturn $pre->fetchAll();\n\t}", "public static function preparar($sql) {\n\t\treturn self::getConexao()->prepare($sql);\n\t}", "public function prepare_query()\n {\n }", "abstract public function pr...
[ "0.70094097", "0.68753254", "0.6814938", "0.6691309", "0.6668082", "0.6652417", "0.6521593", "0.64841115", "0.64768386", "0.6451954", "0.6439241", "0.64310646", "0.6323444", "0.6302723", "0.62936795", "0.6283903", "0.62721497", "0.62216", "0.62006897", "0.6152584", "0.6147673...
0.0
-1
Custom hooks (like excerpt length etc) Programatically create pages
function create_custom_pages() { $custom_pages = array( 'issues' => 'Issues', 'weeklies' => 'Weeklies', 'artists' => 'Artists', 'contributors' => 'Contributors', 'incubator' => 'Incubator', 'about' => 'About', 'shop' => 'Shop', 'contribute' => 'How to Contribute', 'contact' => 'Contact Us', 'faq' => 'FAQ', 'definitions' => 'Definitions', 'terms-and-conditions' => 'Terms & Conditions', 'bag' => 'Bag', ); foreach($custom_pages as $page_name => $page_title) { $page = get_page_by_path($page_name); if( empty($page) ) { wp_insert_post( array( 'post_type' => 'page', 'post_title' => $page_title, 'post_name' => $page_name, 'post_status' => 'publish' )); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prePageContent();", "function createPage();", "abstract protected function view_generatePageContent();", "static public function createPages() {\n\t\treturn false;\n\t}", "function create_custom_pages() {\n $custom_pages = array(\n 'home' => 'Home',\n );\n foreach($custom_pages as $pa...
[ "0.69990826", "0.6873259", "0.6805698", "0.67635626", "0.67450964", "0.66911846", "0.66292787", "0.6522234", "0.65204996", "0.6502909", "0.6502162", "0.6467448", "0.6464114", "0.64301103", "0.6421911", "0.6421154", "0.63817465", "0.6369027", "0.635663", "0.6353419", "0.633241...
0.715312
0
Lists all feuilleDePresence entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $feuilleDePresences = $em->getRepository('TimSoftGeneralBundle:FeuilleDePresence')->findAll(); return $this->render('feuilledepresence/index.html.twig', array( 'feuilleDePresences' => $feuilleDePresences, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllDecoupage() {\n $qb = $this->createQueryBuilder('e')\n ->where('e.etatDecoupage != ' . TypeEtat::SUPPRIME);\n // ->orderBy('e.typeDecoupage', 'ASC');\n return $qb->getQuery()->getResult();\n }", "public function getAllActifDecoupage() {\n ...
[ "0.56037074", "0.54625285", "0.54452515", "0.5405205", "0.5361675", "0.5359551", "0.53568226", "0.53077036", "0.5300708", "0.5292877", "0.5229869", "0.5183213", "0.5173436", "0.5171986", "0.5168669", "0.5156404", "0.5139592", "0.51228356", "0.5120314", "0.5114125", "0.509708"...
0.6995217
0
Run the database seeds.
public function run() { DB::table('news')->insert([ [ 'name'=>"BẢN TIN CU ĐƠ SỐ 35", 'short_description'=>"", 'full_description'=>'full', 'cover_image'=>"https://vnptproject.blob.core.windows.net/imagecontainer/newproject_1_original-348x209.png", 'is_highlight'=>true, 'created_at' => Carbon::now()->format('d-m-y H:i:s'), 'updated_at' => Carbon::now()->format('d-m-y H:i:s') ], [ 'name'=>"BẢN TIN CU ĐƠ SỐ 36", 'short_description'=>"", 'full_description'=>'full', 'cover_image'=>"https://vnptproject.blob.core.windows.net/imagecontainer/cu36_19_original-2-348x209.png", 'is_highlight'=>true, 'created_at' => Carbon::now()->format('d-m-y H:i:s'), 'updated_at' => Carbon::now()->format('d-m-y H:i:s') ], ]); }
{ "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
Get most used categories.
public function getMostUsed(int $count, int $minUsage): Collection;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTopCategories($limit=10) {\n\t\tglobal $db;\n\t\t$categories = $db->query(\"SELECT category, used FROM categories ORDER BY used DESC LIMIT $limit\");\n\t\treturn $categories;\n\t}", "public function getUsedCategoryIds()\n {\n return $this->_usedCategories;\n }", "public static f...
[ "0.7166379", "0.6749168", "0.6592025", "0.6474236", "0.6453217", "0.6434446", "0.6423125", "0.6409292", "0.63249904", "0.63217443", "0.62262", "0.6223241", "0.61820984", "0.6173459", "0.6173459", "0.6163641", "0.61551267", "0.6147352", "0.6142744", "0.6142379", "0.61331403", ...
0.5812668
72
///////////////////////////////////////////////////////////////////////// ////// DONNEES ////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
Function donneefournisseurs() { echo "copie des données de la table fournisseurs"; $req="INSERT INTO `".Valorisation::$anneenouvelle."`.`fournisseurs` SELECT * FROM `".Valorisation::$anneeancienne."`.`fournisseurs`"; Valorisation::$bddnew->query($req); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _NDL()\r\n\t{\r\n\r\n\t}", "public function nadar()\n {\n }", "public function getDod();", "public function getD() {}", "public function getDNIS();", "public function get_nonces()\n {\n }", "public function masodik()\n {\n }", "public function refresh_nonces()\n ...
[ "0.6770926", "0.63583595", "0.5771632", "0.5640144", "0.5603915", "0.539892", "0.5302617", "0.5300238", "0.5267297", "0.5229034", "0.5204969", "0.51400983", "0.5136169", "0.51331395", "0.5116453", "0.5105415", "0.50690305", "0.50632244", "0.5057986", "0.50569594", "0.501162",...
0.0
-1
/ Get all plugins
private function plugins(){ $all_plugins = explode(',', json_decode(file_get_contents($this->pluginsJson))->all->names); debug($all_plugins); die; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_plugins() {\n\t\treturn get_plugins();\n\t}", "function getPlugins();", "public function getPlugins()\n {\n $this->getPlugin('base');\n }", "public function get_all()\n {\n $plugins = $this->get_plugins();\n\n $pluginControllers = array();\n\n foreach(...
[ "0.8409967", "0.8120879", "0.7948986", "0.79063874", "0.7899298", "0.78108704", "0.77326596", "0.7716178", "0.7707845", "0.7696413", "0.76845837", "0.76785946", "0.76785946", "0.7652743", "0.76153463", "0.75304776", "0.7460938", "0.7436911", "0.74078614", "0.7407826", "0.7402...
0.7445229
17
/ Get all Themes
private function themes() { $all_plugins = json_decode(file_get_contents($this->pluginsJson))->themes; return $all_plugins; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_themes()\n {\n }", "public function getAllThemes();", "public function getThemes(){\r\n return array('theme1'=>\"Theme 1\", \r\n\t\t\t'theme2'=>\"Theme 2\", \r\n\t\t\t'theme3'=>\"Theme 3\" \r\n\t\t\t);\r\n }", "public function all()\r\n {\r\n return $this->themes;\r\...
[ "0.7894927", "0.7696822", "0.75600994", "0.74947655", "0.7331566", "0.7307173", "0.7278911", "0.7194517", "0.71852803", "0.71593225", "0.71535057", "0.7132874", "0.7093899", "0.7053806", "0.7040051", "0.6996329", "0.69565624", "0.69317776", "0.6909936", "0.690989", "0.6870045...
0.7094426
12
/ Get Active Themes
private function activeThemes() { $all_plugins = json_decode(file_get_contents($this->pluginsJson))->active_theme; debug($all_plugins); die; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_get_active_and_valid_themes()\n {\n }", "function current_theme()\n {\n return current_theme();\n }", "function get_themes()\n {\n }", "public function getTheme();", "public function getAvailableThemes()\n\t{\n\t\t$this->loadAvailableThemes();\n\t\treturn self::$_themes...
[ "0.73879415", "0.6897472", "0.68783414", "0.68014413", "0.67471313", "0.6729415", "0.67107755", "0.66909677", "0.6613024", "0.66011906", "0.65866995", "0.653904", "0.65389025", "0.65253586", "0.65244055", "0.64955294", "0.6494217", "0.6490037", "0.6489916", "0.6464742", "0.64...
0.69166875
1
Send an email to a user to confirm the account creation.
public function sendConfirmationEmailMessage(UserInterface $user): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function confirmationEmail()\n {\n $email = new Email;\n $email->sendEmail('submitted', 'applicant', Auth::user()->email);\n }", "public function actionSendConfirmationEmail() {\n\n\t\t$userId = User::checkLogged();\n\t\t$confirmation = User::generateConfirmationCode($userId);\n\t\t$subject = \"Co...
[ "0.7714776", "0.76262987", "0.7587884", "0.7463616", "0.7330064", "0.7047982", "0.6894653", "0.68547183", "0.6815853", "0.6793517", "0.6790032", "0.6788757", "0.67597675", "0.6715812", "0.6699413", "0.66919875", "0.6684836", "0.6670864", "0.66529524", "0.6621887", "0.65491134...
0.7031434
6
Logs a message to the PS log.
public static function log( $message, $severity = self::SEVERITY_INFO, $errorCode = null, $objectType = null, $objectId = null ) { /** @noinspection NestedTernaryOperatorInspection */ $logger = (class_exists('PrestaShopLogger') ? 'PrestaShopLogger' : (class_exists('Logger') ? 'Logger' : null)); if (!empty($logger)) { // The log message is not allowed to contain certain characters, so we url encode them before saving. $message = str_replace( array('{', '}', '<', '>'), array('%7B', '%7D', '%3C', '%3E'), $message ); call_user_func( array($logger, 'addLog'), $message, $severity, $errorCode, $objectType, $objectId, true ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function log( $message )\r\n {\r\n printf( \"%s\\n\", $message );\r\n }", "public function log( $message = '' ) {\r\n\t\t$message = date( 'Y-n-d H:i:s' ) . ' - ' . $message . \"\\r\\n\";\r\n\t\t$this->write_to_log( $message );\r\n\r\n\t}", "private function log($message) {\n ...
[ "0.7137101", "0.7074992", "0.69795454", "0.6975054", "0.6971381", "0.6966576", "0.6917005", "0.68997073", "0.68764615", "0.68764615", "0.68764615", "0.6697476", "0.66813713", "0.6677159", "0.66760796", "0.6674131", "0.6671204", "0.66402125", "0.6561707", "0.65574557", "0.6502...
0.0
-1
Logs an error message to log. If an exception is passed, the the exception code and message code are used too.
public static function error(Exception $e, $message = '') { $message = !empty($message) ? $message . ": " . $e->getMessage() : $e->getMessage(); NostoHelperLogger::log($message, self::SEVERITY_ERROR, $e->getCode()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function logError($message, Exception $exception = null)\n\t{\n\t\tif ($exception) {\n\t\t\t$line = $exception->getLine();\n\t\t\t$file = $exception->getFile();\n\t\t}\n\t\telse {\n\t\t\t$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t\t$line = $backtrace[0]['line'];\n\t\t\t$file = $backtrac...
[ "0.7176895", "0.69835794", "0.6921736", "0.691461", "0.68682444", "0.6863521", "0.6767112", "0.6719678", "0.67013776", "0.6685093", "0.66702217", "0.66169006", "0.6555061", "0.6535085", "0.652702", "0.64594734", "0.6454001", "0.6433207", "0.64202905", "0.63605684", "0.6355115...
0.6681177
10
Logs info message into the PS log
public static function info($message) { NostoHelperLogger::log($message, self::SEVERITY_INFO); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function log_info( $msg ){\n self::system_log( $msg, 'INFO' );\n }", "public function info()\n {\n $this->appendLog('info', \\func_get_args());\n }", "public function info($msg) {\n $this->writeLine($msg, 'info');\n }", "public function info($message)\r\n {\r\n $this->log...
[ "0.751274", "0.7453588", "0.7355964", "0.72713053", "0.72338414", "0.7213764", "0.7199855", "0.718971", "0.71627915", "0.7160561", "0.7115237", "0.71037114", "0.7090272", "0.7086304", "0.69740087", "0.6960835", "0.6937615", "0.6912593", "0.6863803", "0.6839215", "0.6828405", ...
0.68148553
21
Run the database seeds.
public function run() { User::firstOrCreate([ 'name' => 'linty', 'password' => encrypt('lty01234'), 'phone' => '17605961742' ]); }
{ "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
Create a Canvas user
public function createUser($rootAccountID){ $this->path = "accounts/$rootAccountID/users"; return $this->post(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_user ( $ID, $first_name, $last_name, $email ) {\n\tglobal $access_token, $canvas_base_url;\n\t\n\t$pass=md5(uniqid($first_name.$last_name, true));\n\t$url=$canvas_base_url.\"/api/v1/accounts/1/users.json\";\n\tsystem(\"curl $url -F 'user[name]=$first_name $last_name' -F 'user[short_name]=$first_nam...
[ "0.6220045", "0.6132002", "0.6132002", "0.6132002", "0.6132002", "0.61210227", "0.6109533", "0.6069237", "0.60299736", "0.600273", "0.5921305", "0.5881576", "0.58581567", "0.5804896", "0.5784626", "0.5758847", "0.5758847", "0.572616", "0.57174647", "0.5648136", "0.56193054", ...
0.0
-1
Get a Canvas user
public function getUser($userID){ $this->path = "users/$userID"; return $this->get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "function getUser() {\n return user_load($this->ui...
[ "0.7117057", "0.7043195", "0.7043195", "0.7043195", "0.7043195", "0.7043195", "0.7043195", "0.7043195", "0.7003708", "0.69072056", "0.68454635", "0.68388367", "0.68295234", "0.6817361", "0.68118834", "0.6749152", "0.6740439", "0.67043126", "0.67043126", "0.67043126", "0.67043...
0.0
-1
Edit a Canvas user
public function editUser($userID){ $this->path = "users/$userID"; return $this->put(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function user_edit($user_info)\n {\n }", "public function edit() {\n $token = $this->require_authentication();\n $user = $token->getUser();\n require \"app/views/user/user_edit.phtml\";\n }", "protected function edit() {\n\t\t// Make sure a user exists.\n\t\tif (empty($this->user)) {\n\...
[ "0.67884976", "0.67442274", "0.6586803", "0.6499426", "0.64862084", "0.64685345", "0.63772064", "0.6372386", "0.6348944", "0.63408554", "0.6330902", "0.6273171", "0.62031937", "0.6182024", "0.617777", "0.617777", "0.6177105", "0.61632895", "0.6146389", "0.6140922", "0.6129031...
0.61461693
19
Delete a Canvas user
public function users($rootAccountID){ $this->path = "accounts/$rootAccountID/users"; return $this->get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteUser()\n {\n $this->delete();\n }", "public function delete_user($user);", "public function delete() {\n\t\t$query = \"DELETE FROM Users WHERE userId = :id\";\n\t\t$query_params = array(':id' => $this->userData['userId']);\n\t\texecuteSQL($query, $query_params);\n\t}", "pub...
[ "0.7609813", "0.7547494", "0.7321743", "0.7228073", "0.70617616", "0.7056891", "0.7006814", "0.6987686", "0.69737715", "0.69434935", "0.69185024", "0.6877465", "0.6824094", "0.6811669", "0.6794841", "0.6788763", "0.67706233", "0.6760897", "0.6755995", "0.6755664", "0.6745841"...
0.0
-1
Relacion uno a muchos
public function inventario() { return $this->hasMany('App\Inventario'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function personas(){\n\n return $this->morphedByMany(Persona::class, 'cargoable'); //relacion muchos a muchos \"una persona tiene muchos cargos y un cargo tiene muchas personas\"\n }", "public function acessarRelatorios(){\n\n }", "protected function asignarCamposRelacionales() {\n f...
[ "0.5963053", "0.58973885", "0.570623", "0.56653345", "0.5629364", "0.5617675", "0.55253947", "0.54818696", "0.5471189", "0.54684395", "0.5464083", "0.5448724", "0.5448074", "0.5403418", "0.5395045", "0.53760886", "0.53733665", "0.5372526", "0.5366703", "0.53649825", "0.536483...
0.0
-1
Get the size in bytes of a folder
function foldersize($path) { $size = 0; if ($handle = @opendir($path)) { while (($file = readdir($handle)) !== false) { if (is_file($path . "/" . $file)) { $size += filesize($path . "/" . $file); } if (is_dir($path . "/" . $file)) { if ($file != "." && $file != "..") { $size += foldersize($path . "/" . $file); } } } } return $size; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDirectorySize(DirectoryInterface $directory): int;", "public function action_folder_size()\n {\n $RCMAIL = rcmail::get_instance();\n $STORAGE = $RCMAIL->get_storage();\n $OUTPUT = $RCMAIL->output;\n\n // sanitize: _folders\n $folders = rcube_utils::get_inp...
[ "0.81327164", "0.78180146", "0.78136855", "0.77301645", "0.7615019", "0.759118", "0.75860786", "0.7568007", "0.75582004", "0.75261784", "0.7513453", "0.74526995", "0.7446074", "0.74409175", "0.7376623", "0.73459893", "0.7344722", "0.733578", "0.73332244", "0.73124164", "0.728...
0.74519545
12
This function returns the file size of a specified $file.
function format_bytes($size, $precision = 0) { $sizes = array( 'YB', 'ZB', 'EB', 'PB', 'TB', 'GB', 'MB', 'KB', 'B' ); $total = count($sizes); while ($total-- && $size > 1024) $size /= 1024; return sprintf('%.' . $precision . 'f', $size) . $sizes[$total]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSize($file);", "public function size( $file ) {\n\t\treturn ftp_size( $this->link, $file );\n\t}", "static function size($file){\r\n\t\t$file = new File\\Instance($file);\r\n\t\treturn $file->Size();\r\n\t}", "private function find_filesize($file){\n\n if(substr(PHP_OS, 0, 3) == \"W...
[ "0.8640546", "0.829745", "0.82683253", "0.81077874", "0.77867633", "0.7741171", "0.77403975", "0.7739844", "0.7739844", "0.7739844", "0.76412", "0.7636729", "0.7455675", "0.7391385", "0.7368362", "0.7366099", "0.7252452", "0.7227844", "0.72021365", "0.7200149", "0.7191493", ...
0.0
-1
This function returns the mime type of $file.
function get_file_type($file) { global $image_types, $movie_types; $pos = strrpos($file, "."); if ($pos === false) { return "Unknown File"; } $ext = rtrim(substr($file, $pos + 1), "~"); if (in_array($ext, $image_types)) { $type = "Image File"; } elseif (in_array($ext, $movie_types)) { $type = "Video File"; } elseif (in_array($ext, $archive_types)) { $type = "Compressed Archive"; } elseif (in_array($ext, $document_types)) { $type = "Type Document"; } elseif (in_array($ext, $font_types)) { $type = "Type Font"; } else { $type = "File"; } return (strtoupper($ext) . " " . $type); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _getFileMimeType($file)\n {\n return mime_content_type($file);\n }", "private static function getMIMEType(&$file) {\n\t\t$type = Util_Mime::get_mime_type($file);\n\t\treturn $type;\n\t}", "public static function getMimeType( $file ) {\n $finfo = finfo_open(FILEINFO_MIME_TYP...
[ "0.8893712", "0.87844676", "0.8408267", "0.84001315", "0.8391973", "0.83830625", "0.8251235", "0.8107121", "0.8101801", "0.79573673", "0.7950392", "0.79051036", "0.7858282", "0.7853119", "0.78213763", "0.78085536", "0.7801808", "0.7767957", "0.77612567", "0.77541023", "0.7744...
0.7822663
14
Get rewrites in code pool
public function getCodePoolClassRewrite() { $cache = Mage::app()->loadCache(self::CACHE_KEY_CODE_POOL); if ($this->useCache() && $cache) { $classCodePoolRewrite = unserialize($cache); } else { $classCodePoolRewrite = array(); $usedClasses = $this->_getUsedClassMethods(); foreach ($usedClasses as $class => $methods) { $refl = new ReflectionClass($class); $filename = $refl->getFileName(); $pathByName = str_replace('_', DS, $class) . '.php'; if ((strpos($filename, 'local' . DS . $pathByName) !== false) || (strpos($filename, 'community'. DS . $pathByName) !== false)) { $classCodePoolRewrite[] = $class; } } if ($this->useCache()) { Mage::app()->saveCache(serialize($classCodePoolRewrite), self::CACHE_KEY_CODE_POOL, array(self::CACHE_TYPE)); } } return $classCodePoolRewrite; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_rewrites()\n {\n }", "private function buildRewrites(){\n\t\t\n\t\t// If we want to add IfModule checks, add the opening tag\n\t\tif($this->includeIfModuleCheck){\n\t\t\t$this->appendIfModuleCheckStart();\n\t\t}\n\t\t\t\n\t\t// If we want to turn the rewrite engine on, add ...
[ "0.6464985", "0.62512195", "0.6050162", "0.58340245", "0.57476276", "0.56199217", "0.5580024", "0.5564949", "0.55278873", "0.5521026", "0.54510957", "0.5406657", "0.54015404", "0.5366553", "0.5360821", "0.53552175", "0.5318952", "0.53100926", "0.529334", "0.5262394", "0.52560...
0.58238393
4
Get rewrites in xml
public function getXmlClassRewrites() { $cache = Mage::app()->loadCache(self::CACHE_KEY_XML); if ($this->useCache() && $cache) { $result = unserialize($cache); } else { $classRewrites = array(); $modules = $this->_getAllModules(); foreach ($modules as $modName => $module) { if ($this->_skipValidation($modName, $module)) { continue; } $result = $this->_getRewritesInModule($modName); if (!empty($result)) { $classRewrites[] = $result; } } $result = $this->_getClassMethodRewrites($classRewrites); if ($this->useCache()) { Mage::app()->saveCache(serialize($result), self::CACHE_KEY_XML, array(self::CACHE_TYPE)); } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rewrite_xmlsitemap_d4seo( $rewrites ) {\n\n\t\t$rewrites['sitemap(-+([a-zA-Z0-9_-]+))?\\.xml$'] = 'index.php?xmlsitemap=1&xmlurl=$matches[2]';\n\t\t#$rewrites['sitemap(-+([a-zA-Z0-9_-]+))?\\.xml\\.gz$'] = 'index.php?xmlsitemap=1params=$matches[2];zip=true';\n\t\t#$rewrites[] = 'sitemap(-+([a-zA-Z0-9_-]+))...
[ "0.65069914", "0.61066896", "0.5948208", "0.58654475", "0.5709655", "0.5663136", "0.56454134", "0.5626864", "0.5600636", "0.55312604", "0.54668826", "0.53480047", "0.5325653", "0.53003687", "0.5230206", "0.5213253", "0.5200744", "0.5194122", "0.5142629", "0.5106581", "0.51030...
0.6116348
1
Get class methods rewrites
protected function _getClassMethodRewrites($classRewrites) { $usedClasses = $this->_getUsedClassMethods(); foreach ($classRewrites as $position => &$usedClass) { foreach ($usedClass as $class => &$rewrites) { if (isset($rewrites['class'])) { $refl = new ReflectionClass($rewrites['class']); foreach ($usedClasses[$class] as $method) { $classOwner = $refl->getMethod($method)->class; if (($class != $classOwner) && !in_array($method, $rewrites['methods'])) { array_push($rewrites['methods'], $method); } } } } } return $classRewrites; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMethods($class);", "function get_class_methods() {\n\t\t$args = func_get_args();\n\t\t$result=call_user_func_array(\"get_class_methods\", $args);\n\t\tif (is_array($result))\n\t\t\tforeach ($result as $key=>$value) {\n\t\t\t\t$result[$key]=strtolower($value);\n\t\t\t}\n\t\treturn $result;\n\t}...
[ "0.69250196", "0.63380474", "0.6235909", "0.6173006", "0.6173006", "0.6173006", "0.61434335", "0.61434335", "0.6127227", "0.6101479", "0.6073301", "0.60529125", "0.6030636", "0.6026626", "0.6008329", "0.5978192", "0.59676653", "0.59536165", "0.594808", "0.59224343", "0.592063...
0.6561905
1
Get rewrites in separate module
protected function _getRewritesInModule($modName) { $classes = array(); $moduleConfig = $this->_getModuleConfig($modName); $usedClasses = $this->_getUsedClassMethods(); foreach ($usedClasses as $class => $methods) { $parts = explode('_', $class); $groupId = $this->_getGroupId($parts); $classId = $this->_getClassId($parts); if (!$groupId || ! $classId) { continue; } $typeNode = $moduleConfig->getNode()->global->{self::CONFLICT_TYPE . 's'}->$groupId; if (!$typeNode) { continue; }; $rewrites = $typeNode->rewrite; if ($rewrites && $rewrites->$classId) { $classes[$class] = array('class' => (string) $rewrites->$classId, 'methods' => array()); } } return $classes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_rewrites()\n {\n }", "function rest_api_register_rewrites()\n {\n }", "private function buildRewrites(){\n\t\t\n\t\t// If we want to add IfModule checks, add the opening tag\n\t\tif($this->includeIfModuleCheck){\n\t\t\t$this->appendIfModuleCheckStart();\n\t\t}\n\t\t...
[ "0.7558917", "0.7188281", "0.700113", "0.6868676", "0.65299636", "0.62868536", "0.6252848", "0.6243035", "0.62160486", "0.621164", "0.6110809", "0.607921", "0.6039175", "0.59781426", "0.5977478", "0.5950538", "0.58845514", "0.5881483", "0.58016205", "0.57591516", "0.5744839",...
0.0
-1
/ GETTERS AND SETTERS Returns $birthDay.
public function getBirthDay() { if($this->birthDay == null) return ""; else return $this->birthDay; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;...
[ "0.7846542", "0.7846542", "0.7846542", "0.7846542", "0.7846542", "0.76321125", "0.7424361", "0.735215", "0.73105216", "0.73060745", "0.7303557", "0.7257546", "0.7235914", "0.7231029", "0.72281873", "0.72106755", "0.7199915", "0.7189529", "0.71636885", "0.71636885", "0.7139764...
0.76944584
5
Get all item of table router by $routerVo object filter use paging
public function selectByFilter($routerVo, $orderBy=array(), $startRecord=0, $recordSize=0){ try { if (empty($routerVo)) $routerVo = new RouterVo(); $sql = "select * from `router` "; $condition = ''; $params = array(); $isFirst = true; if (!is_null($routerVo->routerId)){ //If isset Vo->element $fieldValue=$routerVo->routerId; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `router_id` $key :routerIdKey"; $isFirst = false; } else { $condition .= " and `router_id` $key :routerIdKey"; } if($type == 'str') { $params[] = array(':routerIdKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':routerIdKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `router_id` = :routerIdKey'; $isFirst=false; }else{ $condition.=' and `router_id` = :routerIdKey'; } $params[]=array(':routerIdKey', $fieldValue, PDO::PARAM_INT); }} if (!is_null($routerVo->layoutId)){ //If isset Vo->element $fieldValue=$routerVo->layoutId; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `layout_id` $key :layoutIdKey"; $isFirst = false; } else { $condition .= " and `layout_id` $key :layoutIdKey"; } if($type == 'str') { $params[] = array(':layoutIdKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':layoutIdKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `layout_id` = :layoutIdKey'; $isFirst=false; }else{ $condition.=' and `layout_id` = :layoutIdKey'; } $params[]=array(':layoutIdKey', $fieldValue, PDO::PARAM_INT); }} if (!is_null($routerVo->pkName)){ //If isset Vo->element $fieldValue=$routerVo->pkName; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `pk_name` $key :pkNameKey"; $isFirst = false; } else { $condition .= " and `pk_name` $key :pkNameKey"; } if($type == 'str') { $params[] = array(':pkNameKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':pkNameKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `pk_name` = :pkNameKey'; $isFirst=false; }else{ $condition.=' and `pk_name` = :pkNameKey'; } $params[]=array(':pkNameKey', $fieldValue, PDO::PARAM_STR); }} if (!is_null($routerVo->prefix)){ //If isset Vo->element $fieldValue=$routerVo->prefix; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `prefix` $key :prefixKey"; $isFirst = false; } else { $condition .= " and `prefix` $key :prefixKey"; } if($type == 'str') { $params[] = array(':prefixKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':prefixKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `prefix` = :prefixKey'; $isFirst=false; }else{ $condition.=' and `prefix` = :prefixKey'; } $params[]=array(':prefixKey', $fieldValue, PDO::PARAM_STR); }} if (!is_null($routerVo->suffix)){ //If isset Vo->element $fieldValue=$routerVo->suffix; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `suffix` $key :suffixKey"; $isFirst = false; } else { $condition .= " and `suffix` $key :suffixKey"; } if($type == 'str') { $params[] = array(':suffixKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':suffixKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `suffix` = :suffixKey'; $isFirst=false; }else{ $condition.=' and `suffix` = :suffixKey'; } $params[]=array(':suffixKey', $fieldValue, PDO::PARAM_STR); }} if (!is_null($routerVo->alias)){ //If isset Vo->element $fieldValue=$routerVo->alias; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `alias` $key :aliasKey"; $isFirst = false; } else { $condition .= " and `alias` $key :aliasKey"; } if($type == 'str') { $params[] = array(':aliasKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':aliasKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `alias` = :aliasKey'; $isFirst=false; }else{ $condition.=' and `alias` = :aliasKey'; } $params[]=array(':aliasKey', $fieldValue, PDO::PARAM_STR); }} if (!is_null($routerVo->aliasBy)){ //If isset Vo->element $fieldValue=$routerVo->aliasBy; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `alias_by` $key :aliasByKey"; $isFirst = false; } else { $condition .= " and `alias_by` $key :aliasByKey"; } if($type == 'str') { $params[] = array(':aliasByKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':aliasByKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `alias_by` = :aliasByKey'; $isFirst=false; }else{ $condition.=' and `alias_by` = :aliasByKey'; } $params[]=array(':aliasByKey', $fieldValue, PDO::PARAM_STR); }} if (!is_null($routerVo->aliasList)){ //If isset Vo->element $fieldValue=$routerVo->aliasList; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `alias_list` $key :aliasListKey"; $isFirst = false; } else { $condition .= " and `alias_list` $key :aliasListKey"; } if($type == 'str') { $params[] = array(':aliasListKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':aliasListKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `alias_list` = :aliasListKey'; $isFirst=false; }else{ $condition.=' and `alias_list` = :aliasListKey'; } $params[]=array(':aliasListKey', $fieldValue, PDO::PARAM_STR); }} if (!is_null($routerVo->callback)){ //If isset Vo->element $fieldValue=$routerVo->callback; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `callback` $key :callbackKey"; $isFirst = false; } else { $condition .= " and `callback` $key :callbackKey"; } if($type == 'str') { $params[] = array(':callbackKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':callbackKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `callback` = :callbackKey'; $isFirst=false; }else{ $condition.=' and `callback` = :callbackKey'; } $params[]=array(':callbackKey', $fieldValue, PDO::PARAM_STR); }} if (!empty($condition)){ $sql.=' where '. $condition; } //order by <field> asc/desc if(count($orderBy) != 0){ $orderBySql = 'ORDER BY '; foreach ($orderBy as $k => $v){ $orderBySql .= "`$k` $v, "; } $orderBySql = substr($orderBySql, 0 , strlen($orderBySql)-2); $sql.= " ".trim($orderBySql)." "; } if($recordSize != 0) { $sql = $sql.' limit '.$startRecord.','.$recordSize; } //debug LogUtil::sql('(selectByFilter) '. DataBaseHelper::renderQuery($sql, $params)); $stmt = $this->conn->prepare($sql); foreach ($params as $param){ $stmt->bindParam($param[0], $param[1], $param[2]); } if ($stmt->execute()) { $row= $stmt->fetchAll(PDO::FETCH_NAMED); return PersistentHelper::mapResult('RouterVo', $row); } } catch (PDOException $e) { throw $e; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getToPaginator();", "protected function getAll(){\n return $this->orderBy('id','desc')->paginate(10);\n }", "public function listItems($param = null){\n $query = $this->orderBy('id', 'ASC')->paginate(5);\n return $query;\n }", "public function index()\n {\n ...
[ "0.62928766", "0.61293566", "0.6113925", "0.5961577", "0.58780205", "0.585621", "0.5854648", "0.583071", "0.5822278", "0.5796941", "0.5704442", "0.56956583", "0.5688021", "0.56871855", "0.5667924", "0.5659477", "0.56510365", "0.56237423", "0.5610147", "0.56031924", "0.559643"...
0.6447709
0
Get value a field by PrimaryKey (routerId) Example getValueByPrimaryKey('routerName', 1) Get value of filed routerName in table router where routerId = 1
public function getValueByPrimaryKey($fieldName, $primaryValue){ //debug LogUtil::sql('(getValueByPrimaryKey) ... primaryValue = ' . $primaryValue); $routerVo = $this->selectByPrimaryKey($primaryValue); if($routerVo){ return $routerVo->$fieldName; } else{ return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValueByPrimaryKey($fieldName, $primaryValue){\n\t //debug\n LogUtil::sql('(getValueByPrimaryKey) ... primaryValue = ' . $primaryValue);\n\t\t\n\t\t$orderDataVo = $this->selectByPrimaryKey($primaryValue);\n\t\tif($orderDataVo){\n\t\t\treturn $orderDataVo->$fieldName;\n\t\t}\n\t\telse{\n...
[ "0.6869985", "0.6859942", "0.66671616", "0.66411173", "0.6569145", "0.64739686", "0.64556205", "0.629257", "0.624263", "0.6237822", "0.6176706", "0.6176706", "0.6176706", "0.61532664", "0.61532664", "0.6141538", "0.61303204", "0.6111565", "0.60566956", "0.6048704", "0.6034055...
0.7555657
0
Get value a field by field list input where Example getValueByField('routerName', array('routerId' => 1)) Get value of filed routerName in table router where routerId = 1
public function getValueByField($fieldName, $where){ $routerVo = new RouterVo(); $whereLog = []; foreach ($where as $k => $v){ $routerVo->{$k} = $v; $whereLog[] = "$k -> $v"; } //debug LogUtil::sql('(getValueByField) ... where = ' . '(' .join(', ', $whereLog). ')'); $routerVos = $this->selectByFilter($routerVo); if($routerVos){ $routerVo = $routerVos[0]; return $routerVo->$fieldName; } else{ return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFieldValue($field);", "function getByField ( $field,$value){\n\t\t $result=$this->fetchRow(\"$field= '$value' \"); //order by id?\n\t\t if($result==null)\n\t\t\t return;\n\t\t if(is_array($result))\n\t\t\t return $result[0];\n\t\t return $result;\n\t}", "public function getValue($field) {\n ...
[ "0.70037067", "0.6478295", "0.63547355", "0.63513243", "0.63162625", "0.63161474", "0.6311093", "0.6275998", "0.6268827", "0.6263299", "0.62076646", "0.6177865", "0.6177865", "0.6147156", "0.6147156", "0.6147156", "0.6076869", "0.60434717", "0.6013732", "0.60094845", "0.60094...
0.6048082
17
deleteByPrimaryKey from table router
public function deleteByPrimaryKey($routerId){ try { $sql = "DELETE FROM `router` where `router_id` = :routerId"; $params = array(); $params[] = array(':routerId', $routerId, PDO::PARAM_INT); //debug LogUtil::sql('(deleteByPrimaryKey) '. DataBaseHelper::renderQuery($sql, $params)); $stmt = $this->conn->prepare($sql); foreach ($params as $param){ $stmt->bindParam($param[0], $param[1], $param[2]); } $stmt->execute(); return true; } catch (PDOException $e) { throw $e; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}", "function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}", "public function delete()\n {\n $class = strtolower(get_called_class());\n $table = self::$_table_name != null ? self::$_table_name : $class . 's';\...
[ "0.6783657", "0.67601335", "0.6634717", "0.65407693", "0.6536913", "0.64822155", "0.63653404", "0.63531494", "0.6335252", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", ...
0.702577
0
deleteByFilter from table router
public function deleteByFilter($routerVo){ try { $sql = 'DELETE FROM `router`'; $isDel = false; $condition = array(); $params = array(); if (!is_null($routerVo->routerId)){ $isDel = true; $condition[] = '`router_id` = :routerId'; $params[] = array(':routerId', $routerVo->routerId, PDO::PARAM_INT); } if (!is_null($routerVo->layoutId)){ $isDel = true; $condition[] = '`layout_id` = :layoutId'; $params[] = array(':layoutId', $routerVo->layoutId, PDO::PARAM_INT); } if (!is_null($routerVo->pkName)){ $isDel = true; $condition[] = '`pk_name` = :pkName'; $params[] = array(':pkName', $routerVo->pkName, PDO::PARAM_STR); } if (!is_null($routerVo->prefix)){ $isDel = true; $condition[] = '`prefix` = :prefix'; $params[] = array(':prefix', $routerVo->prefix, PDO::PARAM_STR); } if (!is_null($routerVo->suffix)){ $isDel = true; $condition[] = '`suffix` = :suffix'; $params[] = array(':suffix', $routerVo->suffix, PDO::PARAM_STR); } if (!is_null($routerVo->alias)){ $isDel = true; $condition[] = '`alias` = :alias'; $params[] = array(':alias', $routerVo->alias, PDO::PARAM_STR); } if (!is_null($routerVo->aliasBy)){ $isDel = true; $condition[] = '`alias_by` = :aliasBy'; $params[] = array(':aliasBy', $routerVo->aliasBy, PDO::PARAM_STR); } if (!is_null($routerVo->aliasList)){ $isDel = true; $condition[] = '`alias_list` = :aliasList'; $params[] = array(':aliasList', $routerVo->aliasList, PDO::PARAM_STR); } if (!is_null($routerVo->callback)){ $isDel = true; $condition[] = '`callback` = :callback'; $params[] = array(':callback', $routerVo->callback, PDO::PARAM_STR); } if(!$isDel){ return null; } else{ $sql .= ' WHERE ' . join(' and ', $condition); } //debug LogUtil::sql('(deleteByFilter) '. DataBaseHelper::renderQuery($sql, $params)); $stmt = $this->conn->prepare($sql); foreach ($params as $param){ $stmt->bindParam($param[0], $param[1], $param[2]); } $stmt->execute(); return true; } catch (PDOException $e) { throw $e; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteFilter($id) {\n return parent::delete($id);\n }", "public function actionDelete() {}", "public function actionDelete() {}", "public function delete($where);", "protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg...
[ "0.66183454", "0.64114004", "0.64114004", "0.63414955", "0.629065", "0.6254012", "0.6234619", "0.61928946", "0.61919034", "0.61629164", "0.6129641", "0.611936", "0.6107998", "0.61020076", "0.60969555", "0.6046416", "0.6043646", "0.60369265", "0.6016262", "0.5983248", "0.59793...
0.6757574
0
insert cash received detials to the cash_paid_to_suppliers
public function addCashPaid(Request $request){ try { $validator = Validator::make($request->all(), [ 'invoiceNum'=> 'required', 'date'=> 'required', 'cashPaid'=> 'required' ]); if($validator->fails()){ return response()->json(['success'=>false,'error'=>$validator->errors(),'code'=>401]); } $input = $request->all(); $user = cash_paid_to_supplier::create($input); return response()->json(['success'=>true,'error'=>$validator->errors(),'code'=>200,'data'=>$user], 200); } catch (Exception $e) { return response()->json([ 'success'=>false, 'error'=>($e->getMessage()), 'code'=>500 ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cashTransactionInsert($generals_id, $data, $totalProductCost, $otherProductCost, $newCylinderProductCost, $mrid)\n {\n //58 account receiable head debit\n\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post...
[ "0.6507451", "0.62765795", "0.6050457", "0.5994779", "0.5991201", "0.58895457", "0.58572316", "0.5715127", "0.5711125", "0.5693986", "0.56718284", "0.56526047", "0.5636504", "0.560346", "0.55790955", "0.5576819", "0.5558392", "0.55525553", "0.5527979", "0.55150396", "0.548432...
0.5006355
95
CASH PAID API FOR CASH FLOW SUMMARY get all cash paid to suppliers details
public function getAllCashPaidInvoiceDetails(){ try { $invoiceDetials = array(); $invoiceDetials = DB::table('purchase_invoices') ->join('cash_paid_to_suppliers', 'purchase_invoices.invoiceNum', '=', 'cash_paid_to_suppliers.invoiceNum') ->join('supplier_details', 'purchase_invoices.supplierId', '=', 'supplier_details.id') ->select( 'cash_paid_to_suppliers.invoiceNum', 'supplier_details.supplierName', 'cash_paid_to_suppliers.date', 'cash_paid_to_suppliers.cashPaid' ) ->get(); $cashPaid = DB::table('cash_paid_to_suppliers')->sum('cashPaid'); return response()->json([ 'success'=>true, 'error'=>null, 'code'=>200, 'total'=>count($invoiceDetials), 'cumCashPaid'=>$cashPaid, 'data'=>$invoiceDetials ], 200); } catch (Exception $e) { return response()->json([ 'success'=>false, 'error'=>($e->getMessage()), 'code'=>500 ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ppt_resources_get_usd_stocks($data)\n{\n// return $data;\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid'])) {\n $...
[ "0.62205446", "0.59038824", "0.56042993", "0.5544532", "0.54817045", "0.54378057", "0.5429713", "0.54189414", "0.5408269", "0.53670806", "0.53650874", "0.5330118", "0.532987", "0.5326008", "0.5321207", "0.52843046", "0.52711475", "0.5268201", "0.5266923", "0.5228007", "0.5222...
0.5837146
2
get today cash paid to suppliers details
public function getTodayCashPaidInvoiceDetails(){ $myDate = Carbon::now(); $todayDate = $myDate->toDateString(); try { $invoiceDetials = array(); $invoiceDetials = DB::table('purchase_invoices') ->join('cash_paid_to_suppliers', 'purchase_invoices.invoiceNum', '=', 'cash_paid_to_suppliers.invoiceNum') ->join('supplier_details', 'purchase_invoices.supplierId', '=', 'supplier_details.id') ->select( 'cash_paid_to_suppliers.invoiceNum', 'supplier_details.supplierName', 'cash_paid_to_suppliers.date', 'cash_paid_to_suppliers.cashPaid' ) ->where('cash_paid_to_suppliers.date','=',$todayDate) ->get(); $cashPaid = DB::table('cash_paid_to_suppliers')->where('cash_paid_to_suppliers.date','=',$todayDate)->sum('cashPaid'); return response()->json([ 'success'=>true, 'error'=>null, 'code'=>200, 'total'=>count($invoiceDetials), 'cumCashPaid'=>$cashPaid, 'data'=>$invoiceDetials ], 200); } catch (Exception $e) { return response()->json([ 'success'=>false, 'error'=>($e->getMessage()), 'code'=>500 ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDollarsCreditedToday()\n {\n $today = Carbon::now();\n return $this->getDollarsCreditedOn($today);\n }", "function getReceiptCommercial()\n\t{\n\t\tglobal $db;\n\t\t\n\t\t$query = 'SELECT re.receipt_ref AS \"Receipt Ref\", r.relationship_name AS \"Supplier\", to_char(receip...
[ "0.63667494", "0.6291061", "0.6058577", "0.5928474", "0.59229475", "0.5888509", "0.5872082", "0.58637476", "0.5796674", "0.5796052", "0.5745656", "0.57418054", "0.57401776", "0.57177097", "0.55616957", "0.55249333", "0.5523045", "0.550979", "0.55005294", "0.5458427", "0.54291...
0.61347896
2
get all cash paid to suppliers details between two dates
public function searchCashPaidBetweenTimePeriod(request $request){ try { $validator = Validator::make($request->all(), [ 'from'=> 'required', 'to'=> 'required', ]); $invoiceDetials = array(); $invoiceDetials = DB::table('purchase_invoices') ->join('cash_paid_to_suppliers', 'purchase_invoices.invoiceNum', '=', 'cash_paid_to_suppliers.invoiceNum') ->join('supplier_details', 'purchase_invoices.supplierId', '=', 'supplier_details.id') ->select( 'cash_paid_to_suppliers.invoiceNum', 'supplier_details.supplierName', 'cash_paid_to_suppliers.date', 'cash_paid_to_suppliers.cashPaid' ) ->whereBetween('cash_paid_to_suppliers.date', [$request->from, $request->to]) ->get(); $cashPaid = DB::table('cash_paid_to_suppliers')->whereBetween('cash_paid_to_suppliers.date', [$request->from, $request->to])->sum('cashPaid'); return response()->json([ 'success'=>true, 'error'=>null, 'code'=>200, 'total'=>count($invoiceDetials), 'cumCashPaid'=>$cashPaid, 'data'=>$invoiceDetials ], 200); } catch (Exception $e) { return response()->json([ 'success'=>false, 'error'=>($e->getMessage()), 'code'=>500 ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,\n\t\t\tCAST(sum(total_price) AS DECIMAL(16,2)) as total_sale\");\n\t\t$this->db->select('CAST(sum(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) as total_supplier_rate', FALSE);\n\t\t$...
[ "0.6335459", "0.63336664", "0.60727787", "0.60360956", "0.6009968", "0.5867105", "0.58590573", "0.5818302", "0.5808124", "0.5747659", "0.57419354", "0.57367045", "0.57094973", "0.57031465", "0.56721336", "0.56671757", "0.56591326", "0.5657962", "0.56493896", "0.5646065", "0.5...
0.61444044
2
print options descriptions to stdout
function printOptions() { $lines = $this->outputOptions(); echo join( "\n" , $lines ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function print_options(){\n\t\tforeach ($this->options as $value) {\n\t\t\t$this->print_option($value);\n\t\t}\n\t}", "public function describe_debug_options() {\n echo '<p>The following options control logging of the plugin actions for debugging purposes.</p>';\n }", "public function show_options( a...
[ "0.7849274", "0.7490152", "0.7015235", "0.68278784", "0.6696799", "0.65354073", "0.65354073", "0.65354073", "0.65354073", "0.65354073", "0.653008", "0.6460849", "0.64299494", "0.63143253", "0.62900513", "0.62900424", "0.6269769", "0.62693894", "0.62645644", "0.62310714", "0.6...
0.81963897
0
A basic unit test example.
public function testExample() { $this->assertTrue(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExample()\n {\n }", "public function testBasicExample()\n {\n $this->assertTrue(true);\n }", "public function testBasicExample()\n {\n $this->assertEquals(1, 1);\n }", "function test_sample() {\n\n\t\t$this->assertTrue( true );\n\n\t}", "public function t...
[ "0.80752075", "0.7854537", "0.780656", "0.7760198", "0.7665438", "0.7644897", "0.76254654", "0.7589822", "0.75457186", "0.75257766", "0.75108504", "0.7400794", "0.7393162", "0.7393162", "0.7393162", "0.7393162", "0.7326179", "0.73256296", "0.72956586", "0.72758234", "0.726301...
0.7423434
55
bring to lower case
function clean_my_words($words) { return strtolower($words); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function downcase(){\n\t\treturn $this->_copy(Translate::Lower($this->toString(),$this->getEncoding()));\n\t}", "function isLower(){ return $this->length()>0 && $this->toString()===$this->downcase()->toString(); }", "function upcase(){\n\t\treturn $this->_copy(Translate::Upper($this->toString(),$this->getEncod...
[ "0.7638794", "0.7618862", "0.75051636", "0.73810834", "0.7244064", "0.7230835", "0.72223747", "0.71899253", "0.7079704", "0.70572776", "0.70481956", "0.70464975", "0.7028005", "0.6996523", "0.697005", "0.6951566", "0.69503766", "0.69244695", "0.6905487", "0.6888436", "0.68634...
0.6456404
74
Calculate estimated work time.
public static function calculateEstimatedWorkTime(int $id, float $estimatedWorkTime = 0): float { $progressInHours = 0; foreach (static::getChildren($id) as $child) { $estimatedWorkTime += static::calculateEstimatedWorkTime($child['id']); } static::calculateProgressOfMilestones($id, $estimatedWorkTime, $progressInHours); return $estimatedWorkTime; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWorkEstimated()\n {\n return $this->work_estimated;\n }", "public function getWorkedTime() {\n if (!isset($this->workedTime)) {\n $start = new DateTime($this->start);\n $end = new DateTime($this->end);\n $break = new DateTime($this->break);\...
[ "0.69083", "0.68906415", "0.68692595", "0.6798016", "0.6682655", "0.65193385", "0.64568835", "0.6439987", "0.6342504", "0.6326465", "0.62884706", "0.62709713", "0.6232144", "0.6189705", "0.61846775", "0.6144584", "0.61179185", "0.6063779", "0.60584486", "0.6020902", "0.598594...
0.6244584
12
Get children by parent ID.
protected static function getChildren(int $id): array { return (new \App\Db\Query()) ->select(['id' => 'vtiger_project.projectid', 'vtiger_project.progress']) ->from('vtiger_project') ->innerJoin('vtiger_crmentity', 'vtiger_project.projectid = vtiger_crmentity.crmid') ->where(['vtiger_crmentity.deleted' => [0, 2]]) ->andWhere(['vtiger_project.parentid' => $id])->all(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function children($id);", "public function getChildren($id){\n return $this->getTable()->where($this->treeParentRow,$id);\n }", "public function getChildren($idParent) {\r\n\t\t$entities = $this->find('all', array(\r\n\t\t\t'conditions' => array(\r\n\t\t\t\t'Entity.parent_id' => $idParent,\r\n...
[ "0.7717559", "0.74496675", "0.74465317", "0.7242641", "0.7186008", "0.7104887", "0.7023389", "0.7001036", "0.689334", "0.68109775", "0.68098044", "0.6789401", "0.6751281", "0.67488575", "0.6703984", "0.6650695", "0.6639337", "0.6637062", "0.66153586", "0.6595408", "0.65929997...
0.67333883
14
Calculate the progress of milestones.
protected static function calculateProgressOfMilestones(int $id, float &$estimatedWorkTime, float &$progressInHours) { $dataReader = (new \App\Db\Query()) ->select([ 'id' => 'vtiger_projectmilestone.projectmilestoneid', 'projectmilestonename' => 'vtiger_projectmilestone.projectmilestonename', 'projectmilestone_progress' => 'vtiger_projectmilestone.projectmilestone_progress', ]) ->from('vtiger_projectmilestone') ->innerJoin('vtiger_crmentity', 'vtiger_projectmilestone.projectmilestoneid = vtiger_crmentity.crmid') ->where(['vtiger_crmentity.deleted' => [0, 2]]) ->andWhere(['vtiger_projectmilestone.projectid' => $id]) ->andWhere(['or', ['vtiger_projectmilestone.parentid' => 0], ['vtiger_projectmilestone.parentid' => null]]) ->createCommand()->query(); while ($row = $dataReader->read()) { $milestoneEstimatedWorkTime = ProjectMilestone_Module_Model::calculateEstimatedWorkTime($row['id']); $estimatedWorkTime += $milestoneEstimatedWorkTime; $progressInHours += ($milestoneEstimatedWorkTime * (float) $row['projectmilestone_progress']) / 100; } $dataReader->close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMilestones()\n\t{\n\t\tif ($this->milestones == null) {\n\t\t\t$this->milestones = $this->getProjects(false, 1);\n\t\t}\n\n\t\treturn $this->milestones;\n\t}", "public function moduleProgress() {\n\n\t\t// Gather database data\n\t\t$sections = Section::all();\n\t\t$secProg = SectionProgress::w...
[ "0.5764011", "0.57565916", "0.55694425", "0.5561926", "0.5517932", "0.54719764", "0.54611886", "0.5359197", "0.5357128", "0.53413886", "0.53340393", "0.5311622", "0.5305437", "0.5276466", "0.519984", "0.5177781", "0.5160432", "0.511939", "0.51152295", "0.50356656", "0.5014305...
0.6367428
0
Update progress in project.
public static function updateProgress(int $id, float $estimatedWorkTime = 0, float $progressInHours = 0, ?int $callerId = null): array { $recordModel = Vtiger_Record_Model::getInstanceById($id); foreach (static::getChildren($id) as $child) { if ($callerId !== $child['id']) { $childEstimatedWorkTime = static::calculateEstimatedWorkTime($child['id']); $estimatedWorkTime += $childEstimatedWorkTime; $progressInHours += ($childEstimatedWorkTime * $child['progress'] / 100); } } static::calculateProgressOfMilestones($id, $estimatedWorkTime, $progressInHours); $projectProgress = $estimatedWorkTime ? round((100 * $progressInHours) / $estimatedWorkTime) : 0; $recordModel->set('progress', $projectProgress); $recordModel->set('estimated_work_time', $estimatedWorkTime); $recordModel->save(); if (!$recordModel->isEmpty('parentid') && $recordModel->get('parentid') !== $callerId) { static::updateProgress( $recordModel->get('parentid'), $estimatedWorkTime, $progressInHours, $id ); } return [ 'estimatedWorkTime' => $estimatedWorkTime, 'projectProgress' => $projectProgress ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateProjectProgress($projectId, $projectProgress)\n {\n $project = Tomproject::find()->where(['id' => $projectId])->one();\n if ($project->progress_bar < $projectProgress) {\n $project->progress_bar = $projectProgress;\n $project->save();\n }\n }",...
[ "0.6974844", "0.6939961", "0.64752346", "0.64355856", "0.64136857", "0.63809067", "0.6366779", "0.6332696", "0.63171774", "0.62686294", "0.6258832", "0.6210513", "0.6194052", "0.6184844", "0.61649466", "0.61467254", "0.61283517", "0.6116889", "0.6100441", "0.6031681", "0.5995...
0.0
-1
$code = str_replace('', '%20', $code);
public function getProductByCode($code) { //echo $code; $product = $this->Product->getProductByCode($code); $json = json_encode($product); $this->set(compact('json')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init_code(&$code)\n\n{\n\n $code .= \"\\n\";\n\n \n\n // code not allowed to contain our special characters\n\n return ($code = strtr($code, array(\"\\x00\" => '', \"\\x01\" => '')));\n\n}", "function raw_u($string=\"\"){\r\n //\"?\"前部分语句 空格 = %20\r\n return rawurlencode($string);\r\n}...
[ "0.6890622", "0.6532879", "0.6411644", "0.62913877", "0.6246051", "0.6210987", "0.61858726", "0.6167378", "0.6143396", "0.61240834", "0.6114848", "0.60663474", "0.60246855", "0.60122496", "0.6011403", "0.5982957", "0.5974583", "0.5935859", "0.5897044", "0.58821154", "0.586495...
0.0
-1
Display a listing of the resource.
public function index() { $videos = $this->video->orderBy('id', 'desc')->paginate(10); $data = ['videos' => $videos, 'title' => $this->title]; return view('admin.videos.index')->with($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
Show the form for creating a new resource.
public function create() { $data = ['title' => $this->title, 'subtitle' => 'Adicionar notícia']; return view('admin.videos.form')->with($data); }
{ "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.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.717428...
0.0
-1
Store a newly created resource in storage.
public function store(VideoFormRequest $request) { $dataForm = $request->all(); if(valid_file($request)) { $upload = upload_file($request, 'videos'); if($upload){ $dataForm['file'] = $upload; } } $video = $this->video->create($dataForm)->id; if(!$video) return redirect('/admin/videos')->with('fail', 'Falha ao salvar o vídeo!'); return redirect('/admin/videos')->with('success', 'Vídeo criado com sucesso!'); }
{ "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) { $video = $this->video->findOrFail($id); $data = ['video' => $video, 'title' => $this->title, 'subtitle' => 'Editar notícias']; return view('admin.videos.form')->with($data); }
{ "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(VideoUpdateRequest $request, $id) { $video = $this->video->findOrFail($id); $dataForm = $request->all(); if(valid_file($request)) { $upload = upload_file($request, 'videos'); if($upload){ $dataForm['file'] = $upload; } } $updated = $video->update($dataForm); if(!$updated) return redirect('/admin/videos')->with('fail', 'Falha ao editar o vídeo!'); return redirect('/admin/videos')->with('success', 'Vídeo editado com sucesso!'); }
{ "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) { $deleted = $this->video->destroy($id); if(!$deleted) return redirect('/admin/videos')->with('fail', 'Falha ao excluir o vídeo!'); return redirect('/admin/videos')->with('success', 'Vídeo excluído com sucesso!'); }
{ "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
Plugin Name: email Description: A plugin that includes custom code snippets Version: 1.0.0 Author: ofek gabay
function sv_unrequire_wc_phone_field( $fields ) { $fields['billing_email']['required'] = false; return $fields; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function email() {\n\t\trequire( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/email.php' );\n\t}", "function svbk_mandrill_emails_init() {\n\tload_plugin_textdomain( 'svbk-mandrill-emails', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\n}", "function get_entry_points()\n\...
[ "0.671602", "0.63443494", "0.6056569", "0.6018305", "0.5967194", "0.59329575", "0.593226", "0.59307045", "0.59172344", "0.5898389", "0.58303136", "0.58228725", "0.58195823", "0.57880956", "0.57465345", "0.57047236", "0.5685005", "0.56809986", "0.5654249", "0.5652745", "0.5637...
0.0
-1
Run the database seeds.
public function run() { DB::table('users')->insert([ [ 'email' => 'tuti@gmail.com', 'nick' => 'Tuti', 'password' => bcrypt('tuti') ], [ 'email' => 'admin@gmail.com', 'nick' => 'Admin', 'password' => bcrypt('admin'), ] ]); }
{ "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
Stubbed out instead of making a DB call
public static function find($id) { return new static($id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setUpAndReturnDatabaseStub() {}", "protected function setUpDatabaseConnectionMock() {}", "private function setUpDatabaseMockForDeterminePageId() {}", "public function getFromDB() {}", "protected function getStub()\n {\n //\n }", "protected function getStub()\n {\n }", ...
[ "0.77180743", "0.6970749", "0.6400718", "0.61044645", "0.61017376", "0.6099842", "0.60459334", "0.60313255", "0.60307956", "0.58866453", "0.58591336", "0.5822337", "0.5746937", "0.5733085", "0.5730609", "0.5715901", "0.5693191", "0.5693184", "0.567435", "0.566929", "0.5668213...
0.0
-1
Stubbed out instead of making a DB call
public function __construct($id) { $this->id = $id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setUpAndReturnDatabaseStub() {}", "protected function setUpDatabaseConnectionMock() {}", "private function setUpDatabaseMockForDeterminePageId() {}", "public function getFromDB() {}", "protected function getStub()\n {\n //\n }", "protected function getStub()\n {\n }", ...
[ "0.77180743", "0.6970749", "0.6400718", "0.61044645", "0.61017376", "0.6099842", "0.60459334", "0.60313255", "0.60307956", "0.58866453", "0.58591336", "0.5822337", "0.5746937", "0.5733085", "0.5730609", "0.5715901", "0.5693191", "0.5693184", "0.567435", "0.566929", "0.5668213...
0.0
-1
Instantiate a new instance.
public function __construct(Query $query) { $this->query = $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newInstance();", "public function newInstance();", "public function newInstance(): object;", "public static abstract function createInstance();", "public static function newInstance()\n {\n $instance = new self;\n return $instance;\n }", "public static function create(...
[ "0.82330155", "0.82330155", "0.7947312", "0.7813835", "0.7781056", "0.76204854", "0.76204854", "0.76204854", "0.7602299", "0.7602299", "0.7488867", "0.7482665", "0.7367584", "0.7348924", "0.7266192", "0.7265874", "0.72329414", "0.72329414", "0.72031885", "0.72031885", "0.7203...
0.0
-1
Find query with given id or throw an error.
public function findOrFail($id) { $query = $this->query->find($id); if (! $query) { throw ValidationException::withMessages(['message' => trans('query.could_not_find')]); } return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function find($id);", "public function findOrThrowException($id);", "public function findOrThrowException($id);", "public static function find($id);", "public static function findById($id)\n {\n }", "public static function findById($id);", "public static function findById($id)\n\t...
[ "0.7463708", "0.746342", "0.746342", "0.7410756", "0.7404514", "0.7344994", "0.7315719", "0.7276912", "0.7276912", "0.7276912", "0.72376156", "0.7157132", "0.71555614", "0.71425545", "0.71425545", "0.71425545", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", ...
0.69178104
48
Paginate all queries using given params.
public function paginate($params) { $sort_by = isset($params['sort_by']) ? $params['sort_by'] : 'created_at'; $order = isset($params['order']) ? $params['order'] : 'desc'; $page_length = isset($params['page_length']) ? $params['page_length'] : config('config.page_length'); $first_name = isset($params['first_name']) ? $params['first_name'] : null; $last_name = isset($params['last_name']) ? $params['last_name'] : null; $email = isset($params['email']) ? $params['email'] : null; $phone = isset($params['phone']) ? $params['phone'] : null; $keyword = isset($params['keyword']) ? $params['keyword'] : null; $start_date = isset($params['start_date']) ? $params['start_date'] : null; $end_date = isset($params['end_date']) ? $params['end_date'] : null; $status = isset($params['status']) ? $params['status'] : null; $query = $this->query->filterByFirstName($first_name)->filterByLastName($last_name)->filterByEmail($email)->filterByPhone($phone)->filterByStatus($status)->filterBySubjectOrBody($keyword)->dateBetween([ 'start_date' => $start_date, 'end_date' => $end_date ]); return $query->orderBy($sort_by, $order)->paginate($page_length); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function paginate($params) {\n\t\t$page_length = gv($params, 'page_length', config('config.page_length'));\n\n\t\treturn $this->getData($params)->paginate($page_length);\n\t}", "public function paginate($params) {\n\t\t$page_length = gv($params, 'page_length', config('config.page_length'));\n\n\t\treturn ...
[ "0.7607716", "0.7607716", "0.75328", "0.7376875", "0.7256248", "0.7111465", "0.70188504", "0.6985799", "0.6945684", "0.6871767", "0.68443006", "0.6799342", "0.67953503", "0.6780006", "0.67693454", "0.66703606", "0.6651802", "0.66419655", "0.6583402", "0.6583402", "0.6557721",...
0.70028245
7
Retrieves a list of models based on the current search/filter conditions. Typical usecase: Initialize the model fields with values from filter form. Execute this method to get CActiveDataProvider instance which will filter models according to data in model fields. Pass data provider to CGridView, CListView or any similar widget.
public function search() { // @todo Please modify the following code to remove attributes that should not be searched. $criteria=new CDbCriteria; $criteria->compare('doc_id',$this->doc_id); $criteria->compare('doc_url',$this->doc_url,true); $criteria->compare('doc_name',$this->doc_name,true); $criteria->compare('doc_scribd_id',$this->doc_scribd_id,true); $criteria->compare('doc_description',$this->doc_description,true); $criteria->compare('doc_title',$this->doc_title,true); $criteria->compare('doc_status',$this->doc_status,true); $criteria->compare('doc_author',$this->doc_author,true); $criteria->compare('doc_type',$this->doc_type); $criteria->compare('doc_path',$this->doc_path,true); $criteria->compare('subject_dept',$this->subject_dept); $criteria->compare('subject_type',$this->subject_type); $criteria->compare('subject_faculty',$this->subject_faculty); $criteria->compare('doc_author_name',$this->doc_author_name,true); $criteria->compare('doc_publisher',$this->doc_publisher,true); $criteria->compare('subject_general_faculty_id',$this->subject_general_faculty_id); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object...
[ "0.7212205", "0.7136089", "0.709311", "0.7093049", "0.69849986", "0.6960436", "0.69469506", "0.6941555", "0.6933617", "0.69236004", "0.69113576", "0.6902701", "0.68982255", "0.6897759", "0.689175", "0.6882377", "0.68796957", "0.68736434", "0.68490034", "0.6848714", "0.6835229...
0.0
-1
Returns the static model of the specified AR class. Please note that you should have this exact method in all your CActiveRecord descendants!
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function model() {\n return parent::model(get_called_class());\n }", "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className=__CLA...
[ "0.7574381", "0.7529001", "0.72717786", "0.7270387", "0.7262305", "0.7214525", "0.7213965", "0.71321", "0.7129096", "0.7129096", "0.710298", "0.710298", "0.71026886", "0.7074855", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005"...
0.0
-1
Gets the private 'App\Repository\FirstNameRepository' shared autowired service.
public static function do($container, $lazyLoad = true) { include_once \dirname(__DIR__, 4).'/vendor/doctrine/persistence/lib/Doctrine/Persistence/ObjectRepository.php'; include_once \dirname(__DIR__, 4).'/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Selectable.php'; include_once \dirname(__DIR__, 4).'/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php'; include_once \dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Repository/ServiceEntityRepositoryInterface.php'; include_once \dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Repository/ServiceEntityRepository.php'; include_once \dirname(__DIR__, 4).'/src/Repository/FirstNameRepository.php'; return $container->privates['App\\Repository\\FirstNameRepository'] = new \App\Repository\FirstNameRepository(($container->services['doctrine'] ?? $container->getDoctrineService())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getRepository()\n {\n return $this->repository;\n }", "protected function getRepositoryClassName()\n {\n return get_class($this);\n }", "public function getRepositoryFactory()\n {\n return $this->repositoryFactory;\n }", "protected function getReposit...
[ "0.56136507", "0.55899537", "0.5563185", "0.55624044", "0.55539024", "0.5547275", "0.55410933", "0.54890364", "0.5483894", "0.5456893", "0.5454754", "0.54434025", "0.5443245", "0.54352236", "0.5429165", "0.54054886", "0.54054886", "0.54054886", "0.54054886", "0.54054886", "0....
0.55900276
1
This SHOULD be used always to receive any kind of value from _GET _POST _REQUEST if it will be used on SQL staments.
function check_single_incomming_var($var, $request = FALSE, $url_decode = FALSE) { if ((is_string($var) || is_numeric($var)) && !is_array($var)) { if (($request == TRUE) && isset($_REQUEST[$var])) { $value = $_REQUEST[$var]; } elseif ($request == FALSE) { $value = $var; } else { $value = NULL; } if ($value === '') { return NULL; } elseif (($value === 0)) { return 0; } elseif (($value === '0')) { return '0'; } else { // $value = htmlspecialchars($value); } if ($url_decode) { $value = urldecode($value); } if (\json_decode($value) === NULL) { // $search = ['\\', "\0", "\n", "\r", "'", '"', "\x1a"]; // $replace = ['\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z']; // $value = str_replace($search, $replace, $value); // $value = @mysql_real_escape_string($value); } return $value; } else { return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getValue($fieldName) {\r\n $value = '';\r\n if (isset($_REQUEST[$fieldName])) { \r\n $value = $_REQUEST[$fieldName];\r\n }\r\n return $value;\r\n }", "function usingRequest()\r\n{ echo \"<br>\";\r\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\")\r\n {\r\n...
[ "0.62607914", "0.6141487", "0.5925994", "0.59006715", "0.58506", "0.5821578", "0.5811759", "0.5756871", "0.57425547", "0.5740756", "0.57388294", "0.5688158", "0.5685656", "0.56782216", "0.5655908", "0.5631245", "0.5623955", "0.5621073", "0.5616557", "0.5591623", "0.5589732", ...
0.5383954
47
Prevents SQL injection from any ARRAY, at the same time serialize the var into save_name. This uses check_single_incomming_var() on each array item. Is recursive.
function check_all_incomming_vars($request_array, $save_name = null) { //checks all the incomming vars // V0.8 forces the use of an non empty array // if (empty($request_array)) { // $request_array = $_REQUEST; // } else { if (!is_array($request_array)) { die(__FUNCTION__ . " need an array to work"); } // } $form = array(); foreach ($request_array as $index => $value) { if (!is_array($value)) { $form[$index] = \k1lib\forms\check_single_incomming_var($value); } else { $form[$index] = check_all_incomming_vars($value); } } if (!empty($save_name)) { \k1lib\common\serialize_var($form, $save_name); } return $form; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sanitizeArray(&$array)\n{\n $excludeListForSanitization = array('query');\n// $excludeListForSanitization = array();\n\n foreach ($array as $k => $v) {\n\n // split to key and value\n list($key, $val) = preg_split(\"/=/\", $v, 2);\n if (!isset($val)) {\n continue;\...
[ "0.63248557", "0.597724", "0.5937407", "0.56931216", "0.5691686", "0.5639601", "0.56013626", "0.5469584", "0.5468918", "0.54580635", "0.54506594", "0.54496884", "0.5412455", "0.5401266", "0.53577787", "0.5340551", "0.5321999", "0.5320253", "0.524443", "0.5211405", "0.520682",...
0.6002798
1
Get a single value from a serialized var if is an array, this one do not echo erros only return FALSE is there is not stored
function get_form_field_from_serialized($form_name, $field_name, $default = "", $compare = "--FALSE--") { if (!is_string($form_name) || empty($form_name)) { die(__FUNCTION__ . " form_name should be an non empty string"); } if (empty($field_name)) { die(__FUNCTION__ . " field_name should be an non empty string"); } $field_value = ""; //FORM EXISTS if (isset($_SESSION['serialized_vars'][$form_name])) { // FIELD EXISTS if (isset($_SESSION['serialized_vars'][$form_name][$field_name])) { $field_value = $_SESSION['serialized_vars'][$form_name][$field_name]; if ($compare !== "--FALSE--") { if ($field_value === $compare) { return TRUE; } else { return FALSE; } } } else { if ($compare !== "--FALSE--") { if ($default === $compare) { return TRUE; } else { return FALSE; } } else { $field_value = $default; } } } else { $field_value = FALSE; // die(__FUNCTION__ . " serialized var '$form_name' do not exist! "); } return $field_value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function value_get(){\n\t\t\n\t\tif ( is_serialized( $this->value ) ) {\n\t\t\t$this->value = unserialize( $this->value );\n\t\t} elseif ( is_string( $this->value ) && 0 === strpos( $this->value, '{' ) && is_object( $_value = json_decode( $this->value ) ) ) {\n\t\t\t$this->value = (array) $_value;\n\t\t}...
[ "0.61651754", "0.5997657", "0.5992752", "0.5936389", "0.5921317", "0.59181947", "0.5822902", "0.5775115", "0.576075", "0.5738339", "0.56807953", "0.5680771", "0.56492805", "0.5646076", "0.5639817", "0.56263596", "0.5619642", "0.55840766", "0.55831033", "0.55686903", "0.553221...
0.5138928
68
Checks with this function if a received value matchs with a item on a ENUM field on a table
function check_enum_value_type($received_value, $table_name, $table_field, \PDO $db) { $options = \k1lib\sql\get_db_table_enum_values($db, $table_name, $table_field); $options_fliped = array_flip($options); if (!isset($options_fliped[$received_value])) { $error_type = print_r($options_fliped, TRUE) . " value: '$received_value'"; // d($received_value, TRUE); } else { $error_type = FALSE; } return $error_type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testEnumField()\n {\n $field = $this->table->getField('yeahnay'); // An enum column\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Enumerated',\n $field);\n $enumValues = $field->getValues();\n $this->assertCount(2, $enum...
[ "0.7060546", "0.6680646", "0.65644604", "0.6361918", "0.6262062", "0.6207098", "0.6184239", "0.59848225", "0.5960027", "0.5918518", "0.5864401", "0.5653974", "0.5652215", "0.5639529", "0.5626257", "0.55962676", "0.5573999", "0.5549936", "0.5548334", "0.55311066", "0.55299455"...
0.77748305
0
File validations with DB Table Config directives
function form_file_upload_handle($file_data, $field_config, $table_name = null) { $file_max_size = $field_config['file-max-size'] + 0; $file_type = $field_config['file-type']; if (strstr($file_data['type'], $file_type) === FALSE) { return "The file type is {$file_data['type']} not {$file_type}"; } if ($file_data['size'] > $file_max_size) { return "Size is bigger than " . $file_max_size / 1024 . "k"; } /** * ALL ok? then place the file and let it go... let it goooo! (my daughter Allison fault! <3 ) */ if (file_uploads::place_upload_file($file_data['tmp_name'], $file_data['name'], $table_name)) { return TRUE; } else { return file_uploads::get_last_error(); } // $file_location = file_uploads::get_uploaded_file_path($file_data['name']); // $file_location_url = file_uploads::get_uploaded_file_url($file_data['name']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validateDatabaseConfig(Database_Config $databaseConfig);", "public function isValidConfigFile($file);", "public function validateConfig()\n\t{\n\t\t$schemaContent = @file_get_contents(Config::$schemaFile);\n\t\tif($schemaContent === FALSE) {\n\t\t\t$this->errors['File not found'][] = [\n\t\t\t\...
[ "0.6250753", "0.62448406", "0.6236518", "0.58566236", "0.5837511", "0.5771383", "0.576261", "0.5757838", "0.5601796", "0.5567498", "0.5549463", "0.55373466", "0.5509063", "0.5500643", "0.54878914", "0.5486325", "0.548267", "0.54695153", "0.5462006", "0.54435194", "0.54195225"...
0.0
-1
Sets notification owner component
public function setOwner(NotificationManager $owner) { $this->owner = $owner; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOwner(NotificationManager $owner);", "function set_owner($owner)\n {\n $this->set_default_property(self :: PROPERTY_OWNER, $owner);\n }", "public function setOwner($owner) {\n\t\t$this->owner = $owner;\n\t}", "public function setOwner($owner) {\n\t\t$this->owner = $owner;\n\t}...
[ "0.78671986", "0.68298733", "0.6621755", "0.6621755", "0.64518267", "0.6439909", "0.63252306", "0.5952486", "0.58814526", "0.58814526", "0.5719567", "0.5717477", "0.57099646", "0.56984365", "0.56136274", "0.56136274", "0.56136274", "0.56134266", "0.5607051", "0.55967706", "0....
0.78097594
2