_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q10900
EloquentPeriod.byOrganizationWithYear
train
public function byOrganizationWithYear($id) { // return $this->Period->where('organization_id', '=', $id)->with('year')->get(); -> Evitar los with $periods = $this->DB->connection($this->databaseConnectionName) ->table('ACCT_Period As p') ->join('ACCT_Fiscal_Year AS f', 'f.id', '=', 'p.fiscal_yea...
php
{ "resource": "" }
q10901
EloquentPeriod.lastPeriodbyOrganizationAndByFiscalYear
train
public function lastPeriodbyOrganizationAndByFiscalYear($organizationId, $fiscalYearId) { $Period = $this->Period->selectRaw('id, end_date, max(month) as month') ->where('organization_id', '=', $organizationId) ->where('fiscal_year_id', '=', $fiscalYearId) ->orderBy('month', 'desc') ->grou...
php
{ "resource": "" }
q10902
EloquentPeriod.create
train
public function create(array $data) { $Period = new Period(); $Period->setConnection($this->databaseConnectionName); $Period->fill($data)->save(); return $Period; }
php
{ "resource": "" }
q10903
EloquentPeriod.update
train
public function update(array $data, $Period = null) { if(empty($Period)) { $Period = $this->byId($data['id']); } foreach ($data as $key => $value) { $Period->$key = $value; } return $Period->save(); }
php
{ "resource": "" }
q10904
File.setModificationDate
train
private function setModificationDate(array $ftpInfo) { $modDate = !empty($ftpInfo['modify']) ? DateTimeImmutable::createFromFormat('YmdHis', $ftpInfo['modify']) : false; $this->modify = !empty($modDate) ? $modDate : new DateTimeImmutable(); }
php
{ "resource": "" }
q10905
XmlnukeMediaGallery.addIFrame
train
public function addIFrame($src, $windowWidth, $windowHeight, $thumb="", $title = "", $caption="", $width="", $height="") { $this->addXmlnukeObject(XmlnukeMediaItem::IFrameFactory($src, $windowWidth, $windowHeight, $thumb, $title, $caption, $width, $height)); }
php
{ "resource": "" }
q10906
Render.buildAttrs
train
public function buildAttrs(array $attrs = array()) { $result = ' '; foreach ($attrs as $key => $param) { $param = (array) $param; if ($key === 'data') { $result .= $this->_buildDataAttrs($param); continue; } $value = im...
php
{ "resource": "" }
q10907
Render._buildAttr
train
protected function _buildAttr($key, $val) { $return = null; if (!empty($val) || $val === '0' || $key === 'value') { $return = ' ' . $key . '="' . $val . '"'; } return $return; }
php
{ "resource": "" }
q10908
Render._buildDataAttrs
train
protected function _buildDataAttrs(array $param = array()) { $return = ''; foreach ($param as $data => $val) { $dKey = 'data-' . trim($data); if (is_object($val)) { $val = (array) $val; } if (is_array($val)) { $val = s...
php
{ "resource": "" }
q10909
Render._cleanAttrs
train
protected function _cleanAttrs(array $attrs = array()) { foreach ($attrs as $key => $val) { if (Arr::in($key, $this->_disallowAttr)) { unset($attrs[$key]); } } return $attrs; }
php
{ "resource": "" }
q10910
Render._cleanValue
train
protected function _cleanValue($value, $trim = false) { $value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8'); return ($trim) ? trim($value) : $value; }
php
{ "resource": "" }
q10911
Render._mergeAttr
train
protected function _mergeAttr(array $attrs = array(), $val = null, $key = 'class') { if (Arr::key($key, $attrs)) { $attrs[$key] .= ' ' . $val; } else { $attrs[$key] = $val; } return $attrs; }
php
{ "resource": "" }
q10912
MenuContentFactory.createTabsMenu
train
protected function createTabsMenu(ManialinkInterface $manialink, ParentItem $rootItem, $openId) { /** @var Frame $tabsFrame */ $tabsFrame = $manialink->getData('tabs_frame'); $tabsFrame->removeAllChildren(); $this->menuTabsFactory->createTabsMenu($manialink, $tabsFrame, $rootItem, [...
php
{ "resource": "" }
q10913
MenuContentFactory.callbackClose
train
public function callbackClose( ManialinkInterface $manialink, $login, $params, $args ) { $this->destroy($manialink->getUserGroup()); }
php
{ "resource": "" }
q10914
FloatValueHolder.almostEqual
train
public static function almostEqual($a, $b, $epsilon = 0.0000000001) { $diff = abs($a - $b); if ($a === $b) { // just compare values, handles e.g. INF return true; } elseif ($a === 0.0 || $b === 0.0 || $diff < self::FLOAT_MIN) { // a or b is zero or both a...
php
{ "resource": "" }
q10915
CheckInForm.doCheckIn
train
public function doCheckIn($data, CheckInForm $form) { /** @var CheckInController $controller */ $controller = $form->getController(); $validator = CheckInValidator::create(); $result = $validator->validate($data['TicketCode']); switch ($result['Code']) { case Chec...
php
{ "resource": "" }
q10916
ExtendQueuedTask.getLengthQueue
train
public function getLengthQueue($jobType = null) { $jobType = (string)$jobType; $queueLength = 0; $pendingStats = $this->getPendingStats(); if (empty($pendingStats)) { return $queueLength; } foreach ($pendingStats as $pendingStatsItem) { if ((!empty($jobType) && (strcmp($pendingStatsItem[$this->alias]...
php
{ "resource": "" }
q10917
ExtendQueuedTask.getPendingJob
train
public function getPendingJob($jobType = null, $includeFinished = false, $timestamp = null) { if (empty($jobType)) { return false; } if (empty($timestamp) || (!is_int($timestamp) || !ctype_digit($timestamp))) { $timestamp = strtotime('-15 minute'); } $fetchedTime = date('Y-m-d H:i:s', $timestamp); $...
php
{ "resource": "" }
q10918
ExtendQueuedTask.updateMessage
train
public function updateMessage($id = null, $message = null) { if (empty($id) || !$this->exists($id)) { return false; } $message = (string)$message; if (empty($message)) { $message = null; } $this->id = (int)$id; return (bool)$this->saveField('failure_message', $message); }
php
{ "resource": "" }
q10919
ExtendQueuedTask.updateTaskProgress
train
public function updateTaskProgress($id, &$step, $maxStep = 0) { if (empty($id) || !$this->exists($id) || ($maxStep < 1) || ($maxStep < $step)) { return false; } $step++; $progress = $step / $maxStep; return $this->updateProgress($id, $progress); }
php
{ "resource": "" }
q10920
ExtendQueuedTask.updateTaskErrorMessage
train
public function updateTaskErrorMessage($id = null, $errorMessage = null, $keepExistingMessage = false) { if (empty($id) || !$this->exists($id) || empty($errorMessage)) { return false; } if ($keepExistingMessage) { $this->id = $id; $message = $this->field('failure_message'); if (!empty($message)) { ...
php
{ "resource": "" }
q10921
ExtendQueuedTask.deleteTasks
train
public function deleteTasks($data = null) { if (empty($data) || !is_array($data)) { return false; } $excludeFields = [ 'data', 'failure_message', 'workerkey', ]; $data = array_diff_key($data, array_flip($excludeFields)); $conditions = []; foreach ($data as $field => $value) { $conditions[$...
php
{ "resource": "" }
q10922
ConnectionManager.findConnection
train
public function findConnection(string $name=null) { if ( empty($name) ) { # Take first available connection $connection = \reset($this->connections); if ($connection === false) return null; } else { # Attempt to find the connection from the pool $connection = ( $this->con...
php
{ "resource": "" }
q10923
ConnectionManager.addConnection
train
public function addConnection(PdoConnectionInterface $connection) { $this->connections[\strtolower($connection->getName())] = $connection; return $connection; }
php
{ "resource": "" }
q10924
MimeType.register
train
public static function register(string $guesser): void { if (\in_array(MimeTypeGuesserContract::class, \class_implements($guesser), true)) { \array_unshift(self::$guessers, $guesser); } throw new RuntimeException(\sprintf('You guesser [%s] should implement the [\%s].', $guesser,...
php
{ "resource": "" }
q10925
MimeType.guess
train
public static function guess(string $guess): ?string { $guessers = self::getGuessers(); if (\count($guessers) === 0) { $msg = 'Unable to guess the mime type as no guessers are available'; if (! MimeTypeFileInfoGuesser::isSupported()) { $msg .= ' (Did you ena...
php
{ "resource": "" }
q10926
MimeType.getGuessers
train
private static function getGuessers(): array { if (! self::$nativeGuessersLoaded) { if (MimeTypeFileExtensionGuesser::isSupported()) { self::$guessers[] = MimeTypeFileExtensionGuesser::class; } if (MimeTypeFileInfoGuesser::isSupported()) { ...
php
{ "resource": "" }
q10927
View.get_block_template
train
public static function get_block_template( $url ) { $template = static::get_template( $url ); $template = str_replace( '<a ', '<span ', $template ); $template = str_replace( '</a>', '</span>', $template ); // @codingStandardsIgnoreStart $template .= sprintf( '<link rel="stylesheet" href="%1$s">', esc_u...
php
{ "resource": "" }
q10928
View.get_pre_blog_card_template
train
public static function get_pre_blog_card_template( $url ) { if ( ! $url ) { return; } if ( 0 === strpos( $url, home_url() ) ) { $target = '_self'; } else { $target = '_blank'; } return static::_strip_newlines( sprintf( '<div class="js-wp-oembed-blog-card"> <a class="js-wp-oembed-blog-...
php
{ "resource": "" }
q10929
Path.combine
train
public static function combine($part1, $part2) { if ($part1 && $part2) { return sprintf("%s/%s", rtrim($part1, '/'), ltrim($part2, '/')); } throw new InvalidArgumentException("All parts must be filled"); }
php
{ "resource": "" }
q10930
Path.getRoot
train
public static function getRoot($rootForPath = null, $rootHasDir = 'lib') { if (!$rootForPath) { $includes = get_included_files(); $rootForPath = $includes[0]; } $rootForPath = rtrim($rootForPath, DIRECTORY_SEPARATOR); $rootHasDir = ltrim($rootHasDir, DIRE...
php
{ "resource": "" }
q10931
Path.purge
train
public static function purge($path, $fileFilterRegex = null, $dirFilterRegex = null) { Path::validatePath($path); $iterator = new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS); $iterator = new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST); ...
php
{ "resource": "" }
q10932
ExtendedRequest.getIp
train
public function getIp() { $keys = ['X_FORWARDED_FOR', 'HTTP_X_FORWARDED_FOR', 'CLIENT_IP', 'REMOTE_ADDR']; foreach ($keys as $key) { $ip = $this->getServerParam($key); if (!$ip) { continue; } $ip = preg_replace('/,.*$/u', '', $ip); ...
php
{ "resource": "" }
q10933
ExtendedRequest.getRequestTargetWithParams
train
public function getRequestTargetWithParams($params) { $target = $this->getFullPath(); if ($params) { $target .= '?' . http_build_query($params); } return $target; }
php
{ "resource": "" }
q10934
ExtendedRequest.withHost
train
public function withHost($host) { $uri = $this->getUri()->withHost($host); /** @var static $clone */ $clone = $this->withUri($uri); return $clone; }
php
{ "resource": "" }
q10935
Pearify.getTempDir
train
protected static function getTempDir() { $name = tempnam(sys_get_temp_dir(), 'tmp'); unlink($name); mkdir($name, 0777, true); return $name; }
php
{ "resource": "" }
q10936
Player.initRecords
train
public function initRecords($overrideExisting = true) { if (null !== $this->collRecords && !$overrideExisting) { return; } $collectionClassName = RecordTableMap::getTableMap()->getCollectionClassName(); $this->collRecords = new $collectionClassName; $this->collR...
php
{ "resource": "" }
q10937
Player.getRecords
train
public function getRecords(Criteria $criteria = null, ConnectionInterface $con = null) { $partial = $this->collRecordsPartial && !$this->isNew(); if (null === $this->collRecords || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collRecords) { // ...
php
{ "resource": "" }
q10938
Player.countRecords
train
public function countRecords(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collRecordsPartial && !$this->isNew(); if (null === $this->collRecords || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collRecords) {...
php
{ "resource": "" }
q10939
Player.addRecord
train
public function addRecord(Record $l) { if ($this->collRecords === null) { $this->initRecords(); $this->collRecordsPartial = true; } if (!$this->collRecords->contains($l)) { $this->doAddRecord($l); if ($this->recordsScheduledForDeletion and $t...
php
{ "resource": "" }
q10940
EloquentAccount.byIds
train
public function byIds(array $ids, $databaseConnectionName = null) { if(empty($databaseConnectionName)) { $databaseConnectionName = $this->databaseConnectionName; } return $this->Account->setConnection($databaseConnectionName) ->whereIn('id',$ids) ->get(); }
php
{ "resource": "" }
q10941
EloquentAccount.byOrganizationAndByKey
train
public function byOrganizationAndByKey($organizationId, $key) { if(empty($databaseConnectionName)) { $databaseConnectionName = $this->databaseConnectionName; } return $this->Account->setConnection($databaseConnectionName) ->where('organization_id', '=', $organizationId) ->where('key...
php
{ "resource": "" }
q10942
EloquentAccount.byParent
train
public function byParent($id, $databaseConnectionName = null) { if(empty($databaseConnectionName)) { $databaseConnectionName = $this->databaseConnectionName; } return $this->Account->setConnection($databaseConnectionName) ->where('parent_account_id', '=', $id) ->orderBy('key', 'asc'...
php
{ "resource": "" }
q10943
PayeeVisitor.beforePayeeBankgiro
train
public function beforePayeeBankgiro(Node $node): void { if (!$this->payeeBg) { $this->payeeBg = (string)$node->getValueFrom('Number'); } if ($node->getValueFrom('Number') != $this->payeeBg) { $this->getErrorObject()->addError( "Non-matching payee bank...
php
{ "resource": "" }
q10944
PayeeVisitor.beforePayeeBgcNumber
train
public function beforePayeeBgcNumber(Node $node): void { if (!$this->payeeBgcNr) { $this->payeeBgcNr = (string)$node->getValue(); } if ($node->getValue() != $this->payeeBgcNr) { $this->getErrorObject()->addError( "Non-matching payee BGC customer numbe...
php
{ "resource": "" }
q10945
Transactions.all
train
public static function all(array $arg_params) { //validate params $data = self::getParams($arg_params); $url = '/ecommerce/transactions'; $filters = ''; if(!empty($data['page'])&&ctype_digit($data['page'])){ $filters .= 'page='.$data['page']; } if(...
php
{ "resource": "" }
q10946
ModuleFactory.httpDigestParse
train
private static function httpDigestParse($txt) { // protect against missing data $needed_parts = array('nonce'=>1, 'nc'=>1, 'cnonce'=>1, 'qop'=>1, 'username'=>1, 'uri'=>1, 'response'=>1); $data = array(); $keys = implode('|', array_keys($needed_parts)); preg_match_all('@(' . $keys . ')=(?:([\'"])([^\2]+?)\2|...
php
{ "resource": "" }
q10947
Series.setOption
train
public function setOption( $name, $value ) { $this->jsWriter->setSeriesOption( $this->getTitle(), $name, $value ); return $this; }
php
{ "resource": "" }
q10948
Series.setLineWidth
train
public function setLineWidth( $val ) { if ( $this->jsWriter instanceof \Altamira\JsWriter\Ability\Lineable ) { $this->jsWriter->setSeriesLineWidth( $this->getTitle(), $val ); } return $this; }
php
{ "resource": "" }
q10949
SummaryField.Field
train
public function Field($properties = array()) { $context = $this; $properties['Editable'] = $this->editable; $properties['Reservation'] = $this->getReservation(); $properties['Attendees'] = $this->editable ? $this->getEditableAttendees() : $this->getReservation...
php
{ "resource": "" }
q10950
TcPdfFactory.create
train
public function create(array $options = array()) { $reflClass = $this->getReflectionClass($options); $options = array_merge(array( 'orientation' => 'P', 'unit' => 'mm', 'format' => 'USLETTER', 'unicode' => true, 'encoding' => 'UTF-8', ...
php
{ "resource": "" }
q10951
TcPdfFactory.getConstructorOptions
train
protected function getConstructorOptions(array &$options) { $ctorOptions = array( 'orientation' => isset($options['orientation']) ? $options['orientation'] : 'P', 'unit' => isset($options['unit']) ? $options['unit'] : 'mm', 'format' => isset($opt...
php
{ "resource": "" }
q10952
ReservationSession.start
train
public static function start(CalendarEvent $event) { $reservation = Reservation::create(); $reservation->EventID = $event->ID; $reservation->write(); self::set($reservation); return $reservation; }
php
{ "resource": "" }
q10953
ReservationSession.end
train
public static function end() { // If the session is ended while in cart or pending state, remove the reservation. // The session is only ended in these states when iffy business is going on. if (in_array(self::get()->Status, array('CART', 'PENDING'))) { self::get()->delete(); ...
php
{ "resource": "" }
q10954
Record.setPlayer
train
public function setPlayer(Player $v = null) { if ($v === null) { $this->setPlayerId(NULL); } else { $this->setPlayerId($v->getId()); } $this->aPlayer = $v; // Add binding for other direction of this n:n relationship. // If this object has alr...
php
{ "resource": "" }
q10955
Record.getPlayer
train
public function getPlayer(ConnectionInterface $con = null) { if ($this->aPlayer === null && ($this->player_id !== null)) { $this->aPlayer = PlayerQuery::create()->findPk($this->player_id, $con); /* The following can be used additionally to guarantee the related object...
php
{ "resource": "" }
q10956
TicketExtension.createDefaultFields
train
public function createDefaultFields() { $fields = Attendee::config()->get('default_fields'); if (!$this->owner->Fields()->exists()) { foreach ($fields as $fieldName => $config) { $field = UserField::createDefaultField($fieldName, $config); $this->owner->Fi...
php
{ "resource": "" }
q10957
TicketExtension.updateCMSActions
train
public function updateCMSActions(FieldList $actions) { $checkInButton = new LiteralField('StartCheckIn', "<a class='action ss-ui-button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only' id='Edit_StartCheckIn' role='button' hre...
php
{ "resource": "" }
q10958
TicketExtension.getTicketSaleStartDate
train
public function getTicketSaleStartDate() { $saleStart = null; if (($tickets = $this->owner->Tickets())) { /** @var Ticket $ticket */ foreach ($tickets as $ticket) { if (($date = $ticket->getAvailableFrom()) && strtotime($date) < strtotime($saleStart) || $saleS...
php
{ "resource": "" }
q10959
TicketExtension.getEventExpired
train
public function getEventExpired() { $expired = false; if (($tickets = $this->owner->Tickets()) && $expired = $tickets->exists()) { /** @var Ticket $ticket */ foreach ($tickets as $ticket) { $expired = (!$ticket->validateDate() && $expired); } ...
php
{ "resource": "" }
q10960
TicketExtension.getGuestList
train
public function getGuestList() { $reservationClass = Reservation::singleton()->getClassName(); $attendeeClass = Attendee::singleton()->getClassName(); return Attendee::get() ->leftJoin($reservationClass, "`$attendeeClass`.`ReservationID` = `$reservationClass`.`ID`") -...
php
{ "resource": "" }
q10961
TicketExtension.getSuccessContent
train
public function getSuccessContent() { if (!empty($this->owner->SuccessMessage)) { return $this->owner->dbObject('SuccessMessage'); } else { return SiteConfig::current_site_config()->dbObject('SuccessMessage'); } }
php
{ "resource": "" }
q10962
TicketExtension.getMailContent
train
public function getMailContent() { if (!empty($this->owner->SuccessMessageMail)) { return $this->owner->dbObject('SuccessMessageMail'); } else { return SiteConfig::current_site_config()->dbObject('SuccessMessageMail'); } }
php
{ "resource": "" }
q10963
TicketExtension.canCreateTickets
train
public function canCreateTickets() { $currentDate = $this->owner->getController()->CurrentDate(); if ($currentDate && $currentDate->exists()) { return $currentDate->dbObject('StartDate')->InFuture(); } return false; }
php
{ "resource": "" }
q10964
TicketExtension.getController
train
public function getController() { return $this->controller ? $this->controller : $this->controller = CalendarEvent_Controller::create($this->owner); }
php
{ "resource": "" }
q10965
CachedObjectHandler.getDataCacheKey
train
public static function getDataCacheKey($data, Context $context) { $group = $context->hasAttribute('groups') ? $context->getAttribute('groups') : '*'; $version = $context->hasAttribute('version') ? $context->getAttribute('version') : '*'; $dataArray = [ 'data' => $data, ...
php
{ "resource": "" }
q10966
MapQuery.filterByFilename
train
public function filterByFilename($filename = null, $comparison = null) { if (null === $comparison) { if (is_array($filename)) { $comparison = Criteria::IN; } } return $this->addUsingAlias(MapTableMap::COL_FILENAME, $filename, $comparison); }
php
{ "resource": "" }
q10967
MapQuery.filterByEnvironment
train
public function filterByEnvironment($environment = null, $comparison = null) { if (null === $comparison) { if (is_array($environment)) { $comparison = Criteria::IN; } } return $this->addUsingAlias(MapTableMap::COL_ENVIRONMENT, $environment, $compariso...
php
{ "resource": "" }
q10968
MapQuery.filterByMood
train
public function filterByMood($mood = null, $comparison = null) { if (null === $comparison) { if (is_array($mood)) { $comparison = Criteria::IN; } } return $this->addUsingAlias(MapTableMap::COL_MOOD, $mood, $comparison); }
php
{ "resource": "" }
q10969
MapQuery.filterByBronzetime
train
public function filterByBronzetime($bronzetime = null, $comparison = null) { if (is_array($bronzetime)) { $useMinMax = false; if (isset($bronzetime['min'])) { $this->addUsingAlias(MapTableMap::COL_BRONZETIME, $bronzetime['min'], Criteria::GREATER_EQUAL); ...
php
{ "resource": "" }
q10970
MapQuery.filterBySilvertime
train
public function filterBySilvertime($silvertime = null, $comparison = null) { if (is_array($silvertime)) { $useMinMax = false; if (isset($silvertime['min'])) { $this->addUsingAlias(MapTableMap::COL_SILVERTIME, $silvertime['min'], Criteria::GREATER_EQUAL); ...
php
{ "resource": "" }
q10971
MapQuery.filterByGoldtime
train
public function filterByGoldtime($goldtime = null, $comparison = null) { if (is_array($goldtime)) { $useMinMax = false; if (isset($goldtime['min'])) { $this->addUsingAlias(MapTableMap::COL_GOLDTIME, $goldtime['min'], Criteria::GREATER_EQUAL); $useMinMa...
php
{ "resource": "" }
q10972
MapQuery.filterByAuthortime
train
public function filterByAuthortime($authortime = null, $comparison = null) { if (is_array($authortime)) { $useMinMax = false; if (isset($authortime['min'])) { $this->addUsingAlias(MapTableMap::COL_AUTHORTIME, $authortime['min'], Criteria::GREATER_EQUAL); ...
php
{ "resource": "" }
q10973
MapQuery.filterByCopperprice
train
public function filterByCopperprice($copperprice = null, $comparison = null) { if (is_array($copperprice)) { $useMinMax = false; if (isset($copperprice['min'])) { $this->addUsingAlias(MapTableMap::COL_COPPERPRICE, $copperprice['min'], Criteria::GREATER_EQUAL); ...
php
{ "resource": "" }
q10974
MapQuery.filterByLaprace
train
public function filterByLaprace($laprace = null, $comparison = null) { if (is_string($laprace)) { $laprace = in_array(strtolower($laprace), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; } return $this->addUsingAlias(MapTableMap::COL_LAPRACE, $laprace, $comparis...
php
{ "resource": "" }
q10975
MapQuery.filterByNblaps
train
public function filterByNblaps($nblaps = null, $comparison = null) { if (is_array($nblaps)) { $useMinMax = false; if (isset($nblaps['min'])) { $this->addUsingAlias(MapTableMap::COL_NBLAPS, $nblaps['min'], Criteria::GREATER_EQUAL); $useMinMax = true; ...
php
{ "resource": "" }
q10976
MapQuery.filterByNpcheckpoints
train
public function filterByNpcheckpoints($npcheckpoints = null, $comparison = null) { if (is_array($npcheckpoints)) { $useMinMax = false; if (isset($npcheckpoints['min'])) { $this->addUsingAlias(MapTableMap::COL_NPCHECKPOINTS, $npcheckpoints['min'], Criteria::GREATER_EQU...
php
{ "resource": "" }
q10977
MapQuery.filterByMapstyle
train
public function filterByMapstyle($mapstyle = null, $comparison = null) { if (null === $comparison) { if (is_array($mapstyle)) { $comparison = Criteria::IN; } } return $this->addUsingAlias(MapTableMap::COL_MAPSTYLE, $mapstyle, $comparison); }
php
{ "resource": "" }
q10978
MapQuery.filterByMxmap
train
public function filterByMxmap($mxmap, $comparison = null) { if ($mxmap instanceof \eXpansion\Bundle\Maps\Model\Mxmap) { return $this ->addUsingAlias(MapTableMap::COL_MAPUID, $mxmap->getTrackuid(), $comparison); } elseif ($mxmap instanceof ObjectCollection) { r...
php
{ "resource": "" }
q10979
MapQuery.useMxmapQuery
train
public function useMxmapQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinMxmap($relationAlias, $joinType) ->useQuery($relationAlias ? $relationAlias : 'Mxmap', '\eXpansion\Bundle\Maps\Model\MxmapQuery'); }
php
{ "resource": "" }
q10980
CommandHandlerResolver.resolveHandlingMethod
train
protected function resolveHandlingMethod($commandType) { // Remove namespace $pos = strrpos($commandType, '\\'); if ($pos !== false) { $commandType = substr($commandType, $pos + 1); } // Remove "Command" suffix if (substr($commandType, -7) === 'Command') ...
php
{ "resource": "" }
q10981
LogWrapper.getLogger
train
public static function getLogger($logName = 'default') { $filename = new LogConfigFilenameProcessor('log4php'); if (!$filename->Exists()) throw new NotFoundException('Log4php config file not found.'); else \Logger::configure($filename->FullQualifiedNameAndPath()); return \Logger::getLogger($logName);...
php
{ "resource": "" }
q10982
ChartDatumAbstract.offsetGet
train
public function offsetGet ($offset) { return isset($this->datumData[$offset]) ? $this->datumData[$offset] : false; }
php
{ "resource": "" }
q10983
AccessCheckFactory.create
train
public function create(array $data = array()) { if (!isset($data["configPathPrefix"])) { $data["configPathPrefix"] = $this->configPathPrefix; } return $this->_objectManager->create($this->_instanceName, $data); }
php
{ "resource": "" }
q10984
GameDataStorage.getServerOs
train
public function getServerOs() { if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { return self::OS_WINDOWS; } else { if (strtoupper(substr(PHP_OS, 0, 3)) === 'MAC') { return self::OS_MAC; } else { return self::OS_LINUX; }...
php
{ "resource": "" }
q10985
SummaryController.SummaryForm
train
public function SummaryForm() { $summary = new SummaryForm($this, 'SummaryForm', ReservationSession::get()); $summary->setNextStep(CheckoutSteps::nextStep($this->step)); return $summary; }
php
{ "resource": "" }
q10986
Collection.offsetExists
train
public function offsetExists($offset) { if (!is_int($offset) && !is_string($offset)) { throw new RuntimeException('Invalid array offset type: '. gettype($offset)); } return array_key_exists($offset, $this->items); }
php
{ "resource": "" }
q10987
Collection.getItems
train
public function getItems(array $keys = []) { $items = []; foreach ($keys as $key) { $items[] = $this->offsetGet($key); } if (empty($keys)) { $items = $this->items; } return $items; }
php
{ "resource": "" }
q10988
Collection.removeItem
train
public function removeItem($item) { $key = $this->getKey($item); if ($key !== false) { $this->offsetUnset($key); } }
php
{ "resource": "" }
q10989
Collection.addListener
train
public function addListener(ListenerInterface $listener) { if (!in_array($listener, $this->collection_listeners, true)) { $this->collection_listeners[] = $listener; } }
php
{ "resource": "" }
q10990
Collection.removeListener
train
public function removeListener(ListenerInterface $listener) { if (false !== ($pos = array_search($listener, $this->collection_listeners, true))) { array_splice($this->collection_listeners, $pos, 1); } }
php
{ "resource": "" }
q10991
Collection.toArray
train
public function toArray() { $data = []; foreach ($this->items as $key => $value) { if ($value instanceof BaseObjectInterface) { $value = $value->toArray(); } $data[$key] = $value; } return $data; }
php
{ "resource": "" }
q10992
Collection.propagateCollectionChangedEvent
train
protected function propagateCollectionChangedEvent(CollectionChangedEvent $event) { foreach ($this->collection_listeners as $listener) { $listener->onCollectionChanged($event); } }
php
{ "resource": "" }
q10993
EloquentJournalVoucherGridRepository.numToLetter
train
protected function numToLetter($num, $uppercase = FALSE) { $num -= 1; $letter = chr(($num % 26) + 97); $letter .= (floor($num/26) > 0) ? str_repeat($letter, floor($num/26)) : ''; return ($uppercase ? strtoupper($letter) : $letter); }
php
{ "resource": "" }
q10994
EloquentJournalVoucherGridRepository.utf8ize
train
protected function utf8ize($mixed) { if (is_array($mixed)) { foreach ($mixed as $key => $value) { $mixed[$key] = self::utf8ize($value); } } else if (is_string ($mixed)) { return utf8_encode($mixed); } return $mixed; }
php
{ "resource": "" }
q10995
OAuthClient20.handle
train
public function handle() { // Get Var Elements $accessToken = $this->getAccessToken(); $state = $this->getVar("state"); // Initiate OAuth Client with Specific server configuration $to = new $this->_className(); // Try to Handle the Authentication Process if ($accessToken == "") { $code = $this-...
php
{ "resource": "" }
q10996
ChatCommands.registerPlugin
train
public function registerPlugin($pluginId, ChatCommandPluginInterface $pluginService) { $commands = $pluginService->getChatCommands(); foreach ($commands as $command) { $this->addCommand($pluginId, $command->getCommand(), $command); foreach ($command->getAliases() as $alias)...
php
{ "resource": "" }
q10997
ChatCommands.deletePlugin
train
public function deletePlugin($pluginId) { if (!isset($this->commandPlugin[$pluginId])) { return; } foreach ($this->commandPlugin[$pluginId] as $cmdTxt => $command) { unset($this->commands[$cmdTxt]); } unset($this->commandPlugin[$pluginId]); }
php
{ "resource": "" }
q10998
ChatCommands.getChatCommands
train
public function getChatCommands() { $chatCommands = []; foreach ($this->commands as $chatCommand => $data) { $chatCommands[$data->getCommand()] = clone $data; } return $chatCommands; }
php
{ "resource": "" }
q10999
ChatCommands.findChatCommand
train
protected function findChatCommand($cmdAndArgs, $depth, $orig = null) { if ($depth == 0) { return [null, []]; } if ($orig == null) { $orig = $cmdAndArgs; } $cmdAndArgs = array_splice($cmdAndArgs, 0, $depth); $parameters = array_diff($orig, $c...
php
{ "resource": "" }