_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q253800 | ToolsController.fixFile | validation | public function fixFile($file)
{
$contents = preg_split("/\\r\\n|\\r|\\n/", file_get_contents($file));
$changed = false;
if ($this->fixFileSlashes($file, $contents)) {
$changed = true;
}
// if ($this->fixDocBlockPlaceholder($file, $contents)) {
// $cha... | php | {
"resource": ""
} |
q253801 | ToolsController.fixFileSlashes | validation | public function fixFileSlashes($file, &$contents)
{
$changed = false;
foreach ($contents as $lineNumber => $line) {
if (preg_match('/(psesd|canis|cascade)\\\\\\\/', $line) === 1) {
$fixedLine = preg_replace('/\\\\\\\/', '\\', $line);
if ($fixedLine !== $li... | php | {
"resource": ""
} |
q253802 | Broadcast.send | validation | public function send($msgType, $message, $to = null)
{
$message = (new MessageBuilder())->msgType($msgType)->message($message)->to($to)->build();
$api = is_array($to) ? self::API_SEND_BY_OPENID : self::API_SEND_BY_GROUP;
return $this->post($api, $message);
} | php | {
"resource": ""
} |
q253803 | Broadcast.sendText | validation | public function sendText($message, $to = null)
{
return $this->send(self::MSG_TYPE_TEXT, $message, $to);
} | php | {
"resource": ""
} |
q253804 | Broadcast.sendNews | validation | public function sendNews($message, $to = null)
{
return $this->send(self::MSG_TYPE_NEWS, $message, $to);
} | php | {
"resource": ""
} |
q253805 | Broadcast.sendVoice | validation | public function sendVoice($message, $to = null)
{
return $this->send(self::MSG_TYPE_VOICE, $message, $to);
} | php | {
"resource": ""
} |
q253806 | Broadcast.sendImage | validation | public function sendImage($message, $to = null)
{
return $this->send(self::MSG_TYPE_IMAGE, $message, $to);
} | php | {
"resource": ""
} |
q253807 | Broadcast.sendVideo | validation | public function sendVideo($message, $to = null)
{
return $this->send(self::MSG_TYPE_VIDEO, $message, $to);
} | php | {
"resource": ""
} |
q253808 | Broadcast.sendCard | validation | public function sendCard($message, $to = null)
{
return $this->send(self::MSG_TYPE_CARD, $message, $to);
} | php | {
"resource": ""
} |
q253809 | Broadcast.preview | validation | public function preview($msgType, $message, $to, $by = self::PREVIEW_BY_OPENID)
{
$message = (new MessageBuilder())->msgType($msgType)->message($message)->to($to)->buildPreview($by);
return $this->post(self::API_PREVIEW, $message);
} | php | {
"resource": ""
} |
q253810 | Broadcast.previewText | validation | public function previewText($message, $to, $by = self::PREVIEW_BY_OPENID)
{
return $this->preview(self::MSG_TYPE_TEXT, $message, $to, $by);
} | php | {
"resource": ""
} |
q253811 | Broadcast.previewNews | validation | public function previewNews($message, $to, $by = self::PREVIEW_BY_OPENID)
{
return $this->preview(self::MSG_TYPE_NEWS, $message, $to, $by);
} | php | {
"resource": ""
} |
q253812 | Broadcast.previewVoice | validation | public function previewVoice($message, $to, $by = self::PREVIEW_BY_OPENID)
{
return $this->preview(self::MSG_TYPE_VOICE, $message, $to, $by);
} | php | {
"resource": ""
} |
q253813 | Broadcast.previewImage | validation | public function previewImage($message, $to, $by = self::PREVIEW_BY_OPENID)
{
return $this->preview(self::MSG_TYPE_IMAGE, $message, $to, $by);
} | php | {
"resource": ""
} |
q253814 | Broadcast.previewVideo | validation | public function previewVideo($message, $to, $by = self::PREVIEW_BY_OPENID)
{
return $this->preview(self::MSG_TYPE_VIDEO, $message, $to, $by);
} | php | {
"resource": ""
} |
q253815 | Broadcast.previewCard | validation | public function previewCard($message, $to, $by = self::PREVIEW_BY_OPENID)
{
return $this->preview(self::MSG_TYPE_CARD, $message, $to, $by);
} | php | {
"resource": ""
} |
q253816 | Broadcast.previewByName | validation | public function previewByName($msgType, $message, $to)
{
return $this->preview($msgType, $message, $to, self::PREVIEW_BY_NAME);
} | php | {
"resource": ""
} |
q253817 | Broadcast.previewTextByName | validation | public function previewTextByName($message, $to)
{
return $this->preview(self::MSG_TYPE_TEXT, $message, $to, self::PREVIEW_BY_NAME);
} | php | {
"resource": ""
} |
q253818 | Broadcast.previewNewsByName | validation | public function previewNewsByName($message, $to)
{
return $this->preview(self::MSG_TYPE_NEWS, $message, $to, self::PREVIEW_BY_NAME);
} | php | {
"resource": ""
} |
q253819 | Broadcast.previewVoiceByName | validation | public function previewVoiceByName($message, $to)
{
return $this->preview(self::MSG_TYPE_VOICE, $message, $to, self::PREVIEW_BY_NAME);
} | php | {
"resource": ""
} |
q253820 | Broadcast.previewImageByName | validation | public function previewImageByName($message, $to)
{
return $this->preview(self::MSG_TYPE_IMAGE, $message, $to, self::PREVIEW_BY_NAME);
} | php | {
"resource": ""
} |
q253821 | Broadcast.previewVideoByName | validation | public function previewVideoByName($message, $to)
{
return $this->preview(self::MSG_TYPE_VIDEO, $message, $to, self::PREVIEW_BY_NAME);
} | php | {
"resource": ""
} |
q253822 | Broadcast.previewCardByName | validation | public function previewCardByName($message, $to)
{
return $this->preview(self::MSG_TYPE_CARD, $message, $to, self::PREVIEW_BY_NAME);
} | php | {
"resource": ""
} |
q253823 | Grid.setTranslator | validation | public function setTranslator($translator, $translatorDomain = null, $translatorLocale = null) {
$this->translator = $translator;
$this->setTranslatorDomain($translatorDomain);
$this->setTranslatorLocale($translatorLocale);
$this->setCaption($this->translate($this->getCaption()));
} | php | {
"resource": ""
} |
q253824 | GenericTasks.run_tool_version | validation | static function run_tool_version( $task=null, $args=array(), $cliopts=array() )
{
pake_echo( "eZ Extension Builder ver." . self::VERSION . "\nRunning on pake " . pakeApp::VERSION );
} | php | {
"resource": ""
} |
q253825 | GenericTasks.run_generate_extension_config | validation | static function run_generate_extension_config( $task=null, $args=array(), $cliopts=array() )
{
self::setConfigDir( $cliopts );
$overwrite = @$cliopts['overwrite-existing'];
if ( count( $args ) == 0 )
{
throw new pakeException( "Missing extension name" );
}
... | php | {
"resource": ""
} |
q253826 | GenericTasks.run_convert_configuration | validation | static function run_convert_configuration( $task=null, $args=array(), $cliopts=array() )
{
self::setConfigDir( $cliopts );
$extname = @$args[0];
if ( $extname == '' )
{
$extname = dirname( __FILE__ );
}
while ( !is_file( "ant/$extname.properties" )... | php | {
"resource": ""
} |
q253827 | WebCtrlResolver.createCtrl | validation | protected function createCtrl(): AbstractCtrl
{
$view = ViewFactory::createView(
str_replace('action', '', $this->actionName),
$this->ctrlName
);
$componentsRootMap = AppHelper::getInstance()->getConfig('componentsRootMap');
if (!isset($components... | php | {
"resource": ""
} |
q253828 | ETokenManager.init | validation | public function init()
{
parent::init();
$db = $this->getDbConnection();
$db->setActive(true);
if ($this->autoCreateTokenTable) {
$sql = "DELETE FROM {$this->tokenTableName} WHERE (expires>0 AND expires<" . time() . ") OR (uses_allowed>0 AND uses_remaining<1)";
... | php | {
"resource": ""
} |
q253829 | ETokenManager.createTokenTable | validation | protected function createTokenTable($db, $tableName)
{
$driver = $db->getDriverName();
$file = dirname(__DIR__) . '/migrations/' . $this->tokenTableName . '.' . $db->getDriverName();
$pdo = $this->getDbConnection()->pdoInstance;
$sql = file_get_contents($file);
$sql = rtrim($... | php | {
"resource": ""
} |
q253830 | ContactFormController.sendEmails | validation | protected function sendEmails(ContactInquiry $inquiry)
{
$recipients = $this->container->getParameter('c33s_contact_form.email.recipients');
if ($this->container->getParameter('c33s_contact_form.email.send_copy_to_user') && $inquiry->hasSenderEmail()) {
$recipients[] = $inquiry->getSende... | php | {
"resource": ""
} |
q253831 | DefaultController.getDataTablesI18nAction | validation | public function getDataTablesI18nAction()
{
$locale = $this->get('request_stack')->getCurrentRequest()->getLocale();
$format = $this->get('request_stack')->getCurrentRequest()->getRequestFormat();
return $this->render(
'AdminBundle:Default/DataTables_i18n:'.$locale.'.txt.'.$form... | php | {
"resource": ""
} |
q253832 | Web2All_Table_MultiValueOperator.checkParams | validation | protected function checkParams($params,$operator)
{
if (!is_array($params)) {
throw new Exception('Web2All_Table_MultiValueOperator: first param must be an array');
}
if ($operator=='IN') {
if (count($params)<1) {
throw new Exception('Web2All_Table_MultiValueOperator: IN operator requ... | php | {
"resource": ""
} |
q253833 | Web2All_Table_MultiValueOperator.toSQLString | validation | public function toSQLString() {
if ($this->operator=='IN') {
$sql = '(';
$komma = '';
for ($i=0;$i<count($this->operation);$i++)
{
$sql.= $komma.'?';
$komma = ',';
}
$sql.= ')';
return $sql;
} elseif ($this->operator=='BETWEEN') {
return '? AND ?... | php | {
"resource": ""
} |
q253834 | Web2All_Table_MultiValueOperator.setOperator | validation | public function setOperator($operator)
{
$this->checkParams($this->operation,$operator);
$this->operator=$operator;
} | php | {
"resource": ""
} |
q253835 | CreateDirectoriesCompiler.makeDir | validation | protected function makeDir($dirName, LoggerInterface $logger) {
$dn = explode(getcwd(), $dirName)[1] ?? $dirName;
if(@mkdir($dirName)) {
$logger->logText("Created directory <fg=green>%s</>", LoggerInterface::VERBOSITY_NORMAL, NULL, $dn);
} else {
$logger->logWarning("Cre... | php | {
"resource": ""
} |
q253836 | Base.getMinifier | validation | protected function getMinifier(SplFileInfo $file, string $source): Minifier
{
$minifier = '\Gears\Asset\Minifiers\\';
$minifier .= ucfirst($this->destination->getExtension());
if (!class_exists($minifier))
{
throw new RuntimeException
(
'Minif... | php | {
"resource": ""
} |
q253837 | Base.doWeNeedToMinify | validation | protected function doWeNeedToMinify(SplFileInfo $file): bool
{
return
(
!$this->debug &&
!Str::s($file->getFilename())->contains('.min.')
);
} | php | {
"resource": ""
} |
q253838 | CacheManager.getCacheAdapter | validation | public function getCacheAdapter($namespace)
{
// caching is not enabled for a namespace
if (!$this->isCacheable($namespace)) {
return null;
}
// user wants to implements different adapter for different namespaces
if (is_array($this->cacheOptions->getAdapter())) {... | php | {
"resource": ""
} |
q253839 | CacheManager.isCacheable | validation | public function isCacheable($namespace)
{
if (!$this->cacheOptions->isEnabled()) {
return false;
}
$namespaces = $this->cacheOptions->getNamespaces();
// user has enabled caching but has not specified namespaces to cache,
// so we cache all the namespaces
... | php | {
"resource": ""
} |
q253840 | Config.get | validation | public function get($key, $default = null)
{
return array_key_exists($key, $this->configs) ? $this->configs[$key] : $default;
} | php | {
"resource": ""
} |
q253841 | File.copy | validation | public static function copy($src, $dest, $force=true)
{
$src = Path::clean($src);
$dest = Path::clean($dest);
if ( !Folder::exists(dirname($dest)) ){
Folder::create(dirname($dest));
}
$fs = new Filesystem();
try {
$fs->copy($src, $dest, $force);
} catch(IOExcept... | php | {
"resource": ""
} |
q253842 | File.write | validation | public static function write($filename, $buffer)
{
$fs = new Filesystem();
try {
$fs->dumpFile($filename, $buffer);
}
catch(IOExceptionInterface $e){
throw new Exception($e->getMessage());
}
return true;
} | php | {
"resource": ""
} |
q253843 | File.delete | validation | public static function delete($path)
{
$path = Path::clean($path);
$fs = new Filesystem();
try {
$fs->remove($path);
}
catch(IOExceptionInterface $e){
throw new Exception(Helper::getTranslation('FAILED_DELETING').' - ('.$e->getMessage().')');
}
return true;
} | php | {
"resource": ""
} |
q253844 | File.read | validation | public static function read($path)
{
$path = Path::clean($path);
if ( !File::exists($path) ){
return '';
}
return file_get_contents($path);
} | php | {
"resource": ""
} |
q253845 | File.upload | validation | public static function upload($src, $dest)
{
$dest = Path::clean($dest);
$baseDir = dirname($dest);
try {
if ( !Folder::exists($baseDir) ){
Folder::create($baseDir);
}
}
catch(Exception $e){
throw $e;
}
if ( is_writeable($baseDir) && move_uploaded_file($src,... | php | {
"resource": ""
} |
q253846 | File.getName | validation | public static function getName($file)
{
$file = str_replace('\\', '/', $file);
$slash = strrpos($file, '/');
if ( $slash !== false ){
return substr($file, $slash + 1);
}
return $file;
} | php | {
"resource": ""
} |
q253847 | File.getPath | validation | public static function getPath(string $file)
{
$parts = explode('/', $file);
array_pop($parts);
return implode('/', $parts);
} | php | {
"resource": ""
} |
q253848 | File.makeSafe | validation | public static function makeSafe($file)
{
$regex = [
'#(\.){2,}#',
'#[^A-Za-z0-9\.\_\- ]#', '#^\.#',
];
$file = rtrim($file, '.');
$clean = preg_replace($regex, ' ', $file);
$clean = preg_replace("/[ \_]/", '-', $clean);
$clean = preg_replace("/[\-]+/", '-', $clean);
retu... | php | {
"resource": ""
} |
q253849 | Item.getChild | validation | public function getChild($type)
{
if (isset($this->_children[$type])) {
return $this->_children[$type];
}
return false;
} | php | {
"resource": ""
} |
q253850 | Item.getParent | validation | public function getParent($type)
{
if (isset($this->_parents[$type])) {
return $this->_parents[$type];
}
return false;
} | php | {
"resource": ""
} |
q253851 | Item.getParents | validation | public function getParents()
{
$parents = [];
foreach ($this->_parents as $key => $parent) {
if (!$parent->active) {
continue;
}
$parents[$key] = $parent;
}
return $parents;
} | php | {
"resource": ""
} |
q253852 | Item.getChecked | validation | public function getChecked()
{
if (is_null($this->object) || !$this->object) {
return false;
}
if (is_null($this->_checked)) {
$this->_checked = true;
foreach ($this->object->dependencies() as $dep) {
if (!$this->collector->has($dep, false)... | php | {
"resource": ""
} |
q253853 | Host.getIP | validation | public function getIP() {
$ip = "UNKNOWN";
if (getenv("HTTP_CLIENT_IP")) {
$ip = getenv("HTTP_CLIENT_IP");
} else if(getenv("HTTP_X_FORWARDED_FOR")) {
$ip = getenv("HTTP_X_FORWARDED_FOR");
} else if(getenv("REMOTE_ADDR")) {
$ip = getenv("REMOTE_ADDR")... | php | {
"resource": ""
} |
q253854 | App.checkOptions | validation | private function checkOptions($options)
{
foreach ($this->required as $req) {
if (!array_key_exists($req, $options)) {
throw new \Exception('"' . $req . '" option has not been defined');
}
}
} | php | {
"resource": ""
} |
q253855 | WP_Enqueue_Options.have_required_properties | validation | public function have_required_properties() {
return (
! empty( $this->handle )
&& ! empty( $this->relative_path )
&& ! empty( $this->filename )
);
} | php | {
"resource": ""
} |
q253856 | AttributeCollection.addAttribute | validation | public function addAttribute(AttributeInterface $attribute) {
if(isset($this->attributes[$attribute->getName()]))
trigger_error("Attribute " . $attribute->getName() . " already exists", E_USER_NOTICE);
$this->attributes[ $attribute->getName() ] = $attribute;
} | php | {
"resource": ""
} |
q253857 | AttributeCollection.setAttributes | validation | public function setAttributes(array $attributes) {
foreach($attributes as $key => $attribute) {
if(!($attribute instanceof AttributeInterface)) {
if(is_array($attribute)) {
$attr = new AttributeCollection($key);
$attr->setAttributes($attribute)... | php | {
"resource": ""
} |
q253858 | AttributeCollection.removeAttribute | validation | public function removeAttribute(string $attributeName) {
if(isset($this->attributes[$attributeName]))
unset($this->attributes[$attributeName]);
} | php | {
"resource": ""
} |
q253859 | DataSource.setFileSource | validation | public function setFileSource($value)
{
if (isset($this->module->sourceFiles[$value])) {
$this->_fileSource = $this->module->sourceFiles[$value];
} else {
$this->_fileSource = false;
}
} | php | {
"resource": ""
} |
q253860 | DataSource.loadForeignDataItems | validation | protected function loadForeignDataItems()
{
if (!$this->fileSource) {
\d("boom");
return false;
}
$foreignModelClass = $this->foreignModelClass;
$lines = $this->fileSource->getLines($this->lazyForeign);
$lineCount = 0;
foreach ($lines as $id ... | php | {
"resource": ""
} |
q253861 | DataSource.createModel | validation | public function createModel($id, $attributes)
{
return Yii::createObject(['class' => $this->foreignModelClass, 'tableName' => $this->fileSource->id, 'interface' => $this->module, 'id' => $id, 'attributes' => $attributes]);
} | php | {
"resource": ""
} |
q253862 | Repository.set | validation | public function set($key, $value)
{
ArrayDot::set($_SESSION[$this->root], $key, $value);
} | php | {
"resource": ""
} |
q253863 | EventManager.register | validation | public function register($event,$obj,$methodName){
$this->events+=[
$event=>[
]
];
$this->events[$event][]=[
'object'=>$obj,
'methodName'=>$methodName,
];
} | php | {
"resource": ""
} |
q253864 | EventManager.fire | validation | public function fire($eventName,$infoClass=null){
if(isset($this->events[$eventName])){
foreach($this->events[$eventName] as $bind=>$data){
call_user_func_array([$data['object'], $data['methodName']], [$infoClass]);
}
}
//FIXME throw exception?
} | php | {
"resource": ""
} |
q253865 | GuzzleHelper.useHeaders | validation | public function useHeaders($name)
{
$headers = $this->httpHeaders->getHeaders($name);
$this->mergeOptions(array('headers' => $headers));
} | php | {
"resource": ""
} |
q253866 | GuzzleHelper.get | validation | public function get($url, $data = array())
{
$client = $this->getClient();
return $client->request('GET', $url, array('query' => $data));
} | php | {
"resource": ""
} |
q253867 | GuzzleHelper.post | validation | public function post($url, $data = array())
{
$client = $this->getClient();
return $client->request('POST', $url, array('form_params' => $data));
} | php | {
"resource": ""
} |
q253868 | Benri_Util_DateTime.format | validation | public function format($format = null)
{
if (null === $format) {
$format = $this->_format;
}
return parent::format($format);
} | php | {
"resource": ""
} |
q253869 | YamlConfigServiceProvider.register | validation | public function register(Application $app)
{
if (is_null($this->filename)) {
throw new \RuntimeException('You must provide a valid config filename');
}
if (!file_exists($this->filename)) {
throw new \RuntimeException(sprintf('Config path \'%s\' is not valid', $this->f... | php | {
"resource": ""
} |
q253870 | Device.sendToDevice | validation | public function sendToDevice($deviceId, $openId, $content)
{
$params = [
'device_type' => $this->deviceType,
'device_id' => $deviceId,
'open_id' => $openId,
'content' => base64_encode($content),
];
return $this->parseJSON('json', [self::API_TR... | php | {
"resource": ""
} |
q253871 | API.pay | validation | public function pay(Order $order)
{
return $this->request($this->wrapApi(self::API_PAY_ORDER), $order->all());
} | php | {
"resource": ""
} |
q253872 | API.prepare | validation | public function prepare(Order $order)
{
$order->notify_url = $order->get('notify_url', $this->merchant->notify_url);
if (is_null($order->spbill_create_ip)) {
$order->spbill_create_ip = ($order->trade_type === Order::NATIVE) ? get_server_ip() : get_client_ip();
}
return $... | php | {
"resource": ""
} |
q253873 | API.query | validation | public function query($orderNo, $type = self::OUT_TRADE_NO)
{
$params = [
$type => $orderNo,
];
return $this->request($this->wrapApi(self::API_QUERY), $params);
} | php | {
"resource": ""
} |
q253874 | API.close | validation | public function close($tradeNo)
{
$params = [
'out_trade_no' => $tradeNo,
];
return $this->request($this->wrapApi(self::API_CLOSE), $params);
} | php | {
"resource": ""
} |
q253875 | API.reverse | validation | public function reverse($orderNo, $type = self::OUT_TRADE_NO)
{
$params = [
$type => $orderNo,
];
return $this->safeRequest($this->wrapApi(self::API_REVERSE), $params);
} | php | {
"resource": ""
} |
q253876 | API.getSignkey | validation | protected function getSignkey($api)
{
return $this->sandboxEnabled && $api !== self::API_SANDBOX_SIGN_KEY ? $this->getSandboxSignKey() : $this->merchant->key;
} | php | {
"resource": ""
} |
q253877 | API.getSandboxSignKey | validation | protected function getSandboxSignKey()
{
if ($this->sandboxSignKey) {
return $this->sandboxSignKey;
}
// Try to get sandbox_signkey from cache
$cacheKey = 'sandbox_signkey.'.$this->merchant->merchant_id.$this->merchant->sub_merchant_id;
/** @var \Doctrine\Common... | php | {
"resource": ""
} |
q253878 | Database.connect | validation | public static function connect(string $host = "", int $port = 0, string $dbname = "", string $user = "",
string $pass = "", bool $reconnect = false): ?\PDO
{
// IF the connection already exists AND a reconnect was not requested...
if(self::$pdo !== null && !$reconnect)
// THEN re... | php | {
"resource": ""
} |
q253879 | Database.select | validation | public static function select(string $table, array $columns = [], string $orderBy = ""): array
{
// Get a connection to the database.
$pdo = self::connect();
// Generate a SQL statement, given the provided parameters.
$sql =
"SELECT ".($columns === [] ? "*" : "\"".implod... | php | {
"resource": ""
} |
q253880 | Container.rethrowExceptions | validation | protected function rethrowExceptions(callable $callable) {
try {
return $callable();
} catch (ImplementationNotFoundException $ex) {
throw new ImplementationNotFoundException($ex->getMessage());
} catch (TypeMismatchException $ex) {
throw new TypeMismatchExcep... | php | {
"resource": ""
} |
q253881 | Factory.init | validation | public function init($adapter, $client = null)
{
// set the server adapter
$this->adapter = $adapter;
// for ease of use we can fallback to a default http client
if (!$client) {
$client = new \PeterColes\Cluster\HttpClients\GuzzleHttp;
}
// initialise th... | php | {
"resource": ""
} |
q253882 | Container.add | validation | public function add($key, $value)
{
try
{
$this->getRecursive($key, $this->data);
}
catch (ElementNotFoundException $e)
{
$this->set($key, $value);
}
} | php | {
"resource": ""
} |
q253883 | Container.set | validation | public function set($key, $value)
{
if (!is_string($key))
throw new InvalidArgumentException('First parameter has to be a string');
if (!$this->isTypeSupported(gettype($value)))
throw new UnsupportedException('First parameter has to be an int, a double, a bool or a string');
try
{
// try to find the... | php | {
"resource": ""
} |
q253884 | BaseWidget.getWidgetId | validation | public function getWidgetId()
{
if (!is_null($this->_widgetId)) {
return $this->_widgetId;
}
return $this->_widgetId = 'ic-widget-' . md5(microtime() . mt_rand());
} | php | {
"resource": ""
} |
q253885 | BaseWidget.getSystemId | validation | public function getSystemId()
{
if (!isset($this->_systemId)) {
if (isset($this->collectorItem) && isset($this->collectorItem->systemId)) {
$this->_systemId = $this->collectorItem->systemId;
}
}
return $this->_systemId;
} | php | {
"resource": ""
} |
q253886 | FormRow.render | validation | public function render(ElementInterface $element)
{
$label = $element->getLabel();
if (isset($label) && '' !== $label) {
// Translate the label
if (null !== ($translator = $this->getTranslator())) {
$label = $translator->translate(
$label, $this->getTranslatorTextDomain()
);
$element->setLa... | php | {
"resource": ""
} |
q253887 | ResultStore.setTrue | validation | public function setTrue($obData = null)
{
$this->bStatus = true;
$this->obData = $obData;
return $this;
} | php | {
"resource": ""
} |
q253888 | ResultStore.setFalse | validation | public function setFalse($obData = null)
{
$this->bStatus = false;
$this->obData = $obData;
return $this;
} | php | {
"resource": ""
} |
q253889 | ResultStore.get | validation | public function get()
{
$arResult = [
'status' => $this->status(),
'data' => $this->data(),
'message' => $this->message(),
'code' => $this->code(),
];
return $arResult;
} | php | {
"resource": ""
} |
q253890 | AsseticFactoryBuilder.build | validation | public function build()
{
$assetManager = new AssetManager();
$filterManager = new FilterManager();
foreach ($this->filters as $filterName => $filter) {
$filterManager->set($filterName, $filter);
}
$assetsFactory = new AssetFactory($this->configurationHandler->web... | php | {
"resource": ""
} |
q253891 | Text.readFileContents | validation | protected function readFileContents($language)
{
$fileName = $this->getFileName($language);
$fs = $this->env->getFileSystem();
if (!$fs->fileExists($fileName)) {
return array();
}
$content = json_decode(preg_replace('/^.*?define\((.*)\);\s*/s', '$1', $fs->getFile(... | php | {
"resource": ""
} |
q253892 | Text.writeTextsToFile | validation | private function writeTextsToFile($language)
{
$textInfo = array();
$outdateInfo = array();
foreach ($this->contents[$language] as $id => $info) {
$textInfo[$id] = $info['content'];
$outdateInfo[$id] = $info['outdated'];
}
if ($language === $this->base... | php | {
"resource": ""
} |
q253893 | Text.getPageTexts | validation | public function getPageTexts($language)
{
if (!isset($this->contents[$language])) {
$this->contents[$language] = $this->readFileContents($language);
}
return $this->contents[$language];
} | php | {
"resource": ""
} |
q253894 | Text.getTextsWithBaseTexts | validation | public function getTextsWithBaseTexts($language)
{
$texts = $this->getPageTexts($language);
if ($language !== $this->baseLang) {
$baseTexts = $this->getPageTexts($this->baseLang);
$texts = array_map(
function ($text, $baseText) {
return $... | php | {
"resource": ""
} |
q253895 | Text.getText | validation | public function getText($name, $language)
{
$allTexts = $this->getPageTexts($language);
if (isset($allTexts[$name])) {
return $allTexts[$name];
} else {
return null;
}
} | php | {
"resource": ""
} |
q253896 | Text.addTextContainer | validation | public function addTextContainer($name, $content, $language)
{
$allTexts = $this->getPageTexts($language);
if (isset($allTexts[$name])) {
throw new \Exception("Text container name already used.");
}
$this->contents[$language][$name] = array(
'id' => $nam... | php | {
"resource": ""
} |
q253897 | Text.modifyTextContainer | validation | public function modifyTextContainer($oldName, $newName, $content, $language)
{
foreach ($this->languages as $lang) {
$modified = false;
$allTexts = $this->getPageTexts($lang);
if (!isset($allTexts[$oldName])) {
throw new \Exception("Text container unknown.... | php | {
"resource": ""
} |
q253898 | Text.deleteTextContainer | validation | public function deleteTextContainer($name)
{
foreach ($this->languages as $lang) {
$this->getPageTexts($lang);
unset($this->contents[$lang][$name]);
$this->writeTextsToFile($lang);
}
} | php | {
"resource": ""
} |
q253899 | Text.getFileName | validation | private function getFileName($language)
{
if ($language === $this->baseLang) {
return $this->baseDir . $this->pageName . '.js';
} else {
return $this->baseDir . $language . '/' . $this->pageName . '.js';
}
} | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.