_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q24200 | Collection.getAreaCustomStyle | train | public function getAreaCustomStyle($area, $force = false)
{
$areac = $area->getAreaCollectionObject();
if ($areac instanceof Stack) {
// this fixes the problem of users applying design to the main area on the page, and then that trickling into any
// stacks that have been add... | php | {
"resource": ""
} |
q24201 | Collection.setCustomStyleSet | train | public function setCustomStyleSet($area, $set)
{
$db = Loader::db();
$db->Replace(
'CollectionVersionAreaStyles',
[
'cID' => $this->getCollectionID(),
'cvID' => $this->getVersionID(),
| php | {
"resource": ""
} |
q24202 | Collection.resetAreaCustomStyle | train | public function resetAreaCustomStyle($area)
{
$db = Loader::db();
$db->Execute(
'delete from CollectionVersionAreaStyles where cID = ? and cvID = ? and arHandle = ?',
[
| php | {
"resource": ""
} |
q24203 | Collection.relateVersionEdits | train | public function relateVersionEdits($oc)
{
$db = Loader::db();
$v = [
$this->getCollectionID(),
$this->getVersionID(),
$oc->getCollectionID(),
$oc->getVersionID(),
];
$r = $db->GetOne(
'select count(*) from CollectionVers... | php | {
"resource": ""
} |
q24204 | Collection.getGlobalBlocks | train | public function getGlobalBlocks()
{
$db = Loader::db();
$v = [Stack::ST_TYPE_GLOBAL_AREA];
$rs = $db->GetCol('select stName from Stacks where Stacks.stType = ?', $v);
$blocks = [];
if (count($rs) > 0) {
$pcp = new Permissions($this);
foreach ($rs as $g... | php | {
"resource": ""
} |
q24205 | Collection.addBlock | train | public function addBlock($bt, $a, $data)
{
$db = Loader::db();
// first we add the block to the system
$nb = $bt->add($data, $this, $a);
// now that we have a block, we add it to the collectionversions table
$arHandle = (is_object($a)) ? $a->getAreaHandle() : $a;
$... | php | {
"resource": ""
} |
q24206 | Collection.addFeature | train | public function addFeature(Feature $fe)
{
$db = Loader::db();
$db->Replace(
'CollectionVersionFeatures',
| php | {
"resource": ""
} |
q24207 | Collection.delete | train | public function delete()
{
if ($this->cID > 0) {
$db = Loader::db();
// First we delete all versions
$vl = new VersionList($this);
$vl->setItemsPerPage(-1);
$vlArray = $vl->getPage();
foreach ($vlArray as $v) {
$v->del... | php | {
"resource": ""
} |
q24208 | Collection.duplicateCollection | train | public function duplicateCollection()
{
$app = Application::getFacadeApplication();
$cloner = $app->make(Cloner::class);
$clonerOptions = $app->build(ClonerOptions::class)->setKeepOriginalAuthor(true);
| php | {
"resource": ""
} |
q24209 | Collection.cloneVersion | train | public function cloneVersion($versionComments, $createEmpty = false)
{
$app = Application::getFacadeApplication();
$cloner = $app->make(Cloner::class);
$clonerOptions = $app->make(ClonerOptions::class)
->setVersionComments($versionComments)
->setCopyContents($createEm... | php | {
"resource": ""
} |
q24210 | PackageEntities.addEntityManager | train | public function addEntityManager(EntityManagerInterface $em)
{
if (!in_array($em, $this->entityManagers, | php | {
"resource": ""
} |
q24211 | ValidationService.image | train | public function image($pathToImage)
{
/* compatibility if exif functions not available (--enable-exif) */
if (!function_exists('exif_imagetype')) {
function exif_imagetype($filename)
{
if ((list($width, $height, $type, $attr) = getimagesize($filename)) !== fa... | php | {
"resource": ""
} |
q24212 | ValidationService.extension | train | public function extension($filename, $extensions = null)
{
$f = Loader::helper('file');
$ext = strtolower($f->getExtension($filename));
if (isset($extensions) && is_array($extensions) && count($extensions)) {
$allowed_extensions = $extensions;
} else { // pull from consta... | php | {
"resource": ""
} |
q24213 | ResponseCookieJar.addCookie | train | public function addCookie($name, $value = null, $expire = 0, $path = '/', $domain = null, $secure = false, $httpOnly = true)
{
$cookie = new | php | {
"resource": ""
} |
q24214 | ResponseCookieJar.addCookieObject | train | public function addCookieObject(Cookie $cookie)
{
$name = $cookie->getName();
$isNew = true;
foreach ($this->cookies as $index => $value) {
if ($value->getName() === $name) {
$this->cookies[$index] = $cookie;
$isNew = false;
}
}... | php | {
"resource": ""
} |
q24215 | ResponseCookieJar.getCookieByName | train | public function getCookieByName($name)
{
foreach ($this->cookies as $cookie) {
| php | {
"resource": ""
} |
q24216 | ResponseCookieJar.clear | train | public function clear($name)
{
if (!in_array($name, $this->clearedCookies, true)) {
$this->clearedCookies[] = $name;
foreach ($this->cookies as $index => $value) {
if ($value->getName() === $name) {
| php | {
"resource": ""
} |
q24217 | GeolocatorService.getByID | train | public function getByID($id)
{
$id = (int) $id;
| php | {
"resource": ""
} |
q24218 | GeolocatorService.getByHandle | train | public function getByHandle($handle)
{
$handle = (string) $handle; | php | {
"resource": ""
} |
q24219 | GeolocatorService.setCurrent | train | public function setCurrent(Geolocator $geolocator = null)
{
$currentGeolocator = $this->getCurrent();
if ($currentGeolocator !== $geolocator) {
if ($currentGeolocator !== null) {
$currentGeolocator->setIsActive(false);
if ($currentGeolocator->getGeolocator... | php | {
"resource": ""
} |
q24220 | GeolocatorService.getList | train | public function getList()
{
$result = $this->repo->findAll();
$comparer = new Comparer();
usort($result, function (Geolocator $a, Geolocator $b) use ($comparer) {
| php | {
"resource": ""
} |
q24221 | ErrorHandler.addDetails | train | protected function addDetails()
{
/*
* General
*/
$this->addDataTable(
'Concrete5',
[
'Version' => Config::get('concrete.version'),
'Installed Version' => Config::get('concrete.version_installed'),
]
| php | {
"resource": ""
} |
q24222 | Marketplace.get | train | private function get($url)
{
try {
$result = $this->fileHelper->getContents(
$url,
$this->config->get('concrete.marektplace.request_timeout'));
} catch (TimeoutException $e) {
// Catch a timeout
$this->connectionError = self::E_CONN... | php | {
"resource": ""
} |
q24223 | Marketplace.checkPackageUpdates | train | public static function checkPackageUpdates()
{
$em = \ORM::entityManager();
$items = self::getAvailableMarketplaceItems(false);
foreach ($items as $i) {
$p = Package::getByHandle($i->getHandle());
| php | {
"resource": ""
} |
q24224 | WriterFactory.createFromPath | train | public function createFromPath($path, $open_mode = 'r+')
{
$class = $this->writerClass;
| php | {
"resource": ""
} |
q24225 | File.getByID | train | public static function getByID($fID)
{
return $fID ? Application::getFacadeApplication()->make(E | php | {
"resource": ""
} |
q24226 | Version.add | train | public static function add(File $file, $filename, $prefix, $data = [])
{
$data += [
'uID' => 0,
'fvTitle' => '',
'fvDescription' => '',
'fvTags' => '',
'fvIsApproved' => true,
];
$app = Application::getFacadeApplication();
... | php | {
"resource": ""
} |
q24227 | Version.cleanTags | train | public static function cleanTags($tagsStr)
{
$tagsArray = explode("\n", str_replace(["\r", ','], "\n", $tagsStr));
$cleanTags = [];
foreach ($tagsArray as $tag) {
$tag = trim($tag);
if ($tag !== '') {
$cleanTags[] = $tag;
}
}
| php | {
"resource": ""
} |
q24228 | Version.updateFile | train | public function updateFile($filename, $prefix)
{
$this->fvFilename = $filename;
$this->fvPrefix = $prefix;
| php | {
"resource": ""
} |
q24229 | Version.deny | train | public function deny()
{
$app = Application::getFacadeApplication();
$this->fvIsApproved = false;
$this->save();
$fve = new FileVersionEvent($this);
| php | {
"resource": ""
} |
q24230 | Version.updateTitle | train | public function updateTitle($title)
{
$app = Application::getFacadeApplication();
$this->fvTitle = $title;
$this->save();
$this->logVersionUpdate(self::UT_TITLE);
$fve | php | {
"resource": ""
} |
q24231 | Version.updateDescription | train | public function updateDescription($descr)
{
$app = Application::getFacadeApplication();
$this->fvDescription = $descr;
$this->save();
$this->logVersionUpdate(self::UT_DESCRIPTION);
$fve | php | {
"resource": ""
} |
q24232 | Version.updateTags | train | public function updateTags($tags)
{
$app = Application::getFacadeApplication();
$tags = self::cleanTags($tags);
$this->fvTags = $tags; | php | {
"resource": ""
} |
q24233 | Version.getMimeType | train | public function getMimeType()
{
try {
$fre = $this->getFileResource();
$result = $fre->getMimetype();
} | php | {
"resource": ""
} |
q24234 | Version.getTypeObject | train | public function getTypeObject()
{
$app = Application::getFacadeApplication();
$fh = $app->make('helper/file');
| php | {
"resource": ""
} |
q24235 | Version.logVersionUpdate | train | public function logVersionUpdate($updateTypeID, $updateTypeAttributeID = 0)
{
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
$db->executeQuery(
'INSERT INTO FileVersionLog (fID, fvID, fvUpdateTypeID, fvUpdateTypeAttributeID) VALUES (?, ?, ?, ?)',... | php | {
"resource": ""
} |
q24236 | Version.getVersionLogComments | train | public function getVersionLogComments()
{
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
$updates = [];
$ga = $db->fetchAll(
'SELECT fvUpdateTypeID, fvUpdateTypeAttributeID FROM FileVersionLog WHERE fID = ? AND fvID = ? ORDER BY fvlID ASC... | php | {
"resource": ""
} |
q24237 | Version.getDownloadURL | train | public function getDownloadURL()
{
$app = Application::getFacadeApplication();
$urlResolver = $app->make(ResolverManagerInterface::class);
$c = Page::getCurrentPage();
| php | {
"resource": ""
} |
q24238 | Version.buildForceDownloadResponse | train | public function buildForceDownloadResponse()
{
$fre = $this->getFileResource();
$fs = $this->getFile()->getFileStorageLocationObject()->getFileSystemObject();
$response = new FlysystemFileResponse($fre->getPath(), $fs);
| php | {
"resource": ""
} |
q24239 | Version.duplicateUnderlyingFile | train | public function duplicateUnderlyingFile()
{
$app = Application::getFacadeApplication();
$importer = new Importer();
$cf = $app->make('helper/concrete/file');
$filesystem = $this->getFile()->getFileStorageLocationObject()->getFileSystemObject();
$fileName = $this->getFileName(... | php | {
"resource": ""
} |
q24240 | Version.delete | train | public function delete($deleteFilesAndThumbnails = false)
{
$app = Application::getFacadeApplication();
$db = $app->make(Connection::class);
$em = $app->make(EntityManagerInterface::class);
$category = $this->getObjectAttributeCategory();
foreach ($this->getAttributes() as $... | php | {
"resource": ""
} |
q24241 | Version.updateContents | train | public function updateContents($contents, $rescanThumbnails = true)
{
$this->releaseImagineImage();
$storage = $this->getFile()->getFileStorageLocationObject();
if ($storage !== null) {
$app = Application::getFacadeApplication();
$cf = $app->make('helper/concrete/file... | php | {
"resource": ""
} |
q24242 | Version.getFileContents | train | public function getFileContents()
{
$result = null;
$fsl = $this->getFile()->getFileStorageLocationObject();
if ($fsl !== null) {
$app = Application::getFacadeApplication();
$cf = $app->make('helper/concrete/file');
try {
$result = $fsl->ge... | php | {
"resource": ""
} |
q24243 | Version.refreshAttributes | train | public function refreshAttributes($rescanThumbnails = true)
{
$app = Application::getFacadeApplication();
$storage = $this->getFile()->getFileStorageLocationObject();
if ($storage !== null) {
$fs = $storage->getFileSystemObject();
$adapter = $fs->getAdapter();
... | php | {
"resource": ""
} |
q24244 | Version.getImagineImage | train | public function getImagineImage()
{
if (null === $this->imagineImage) {
$app = Application::getFacadeApplication();
$resource = $this->getFileResource();
$mimetype = $resource->getMimeType();
$imageLibrary = $app->make(ImagineInterface::class);
sw... | php | {
"resource": ""
} |
q24245 | Version.releaseImagineImage | train | public function releaseImagineImage()
{
$doGarbageCollection = $this->imagineImage ? true : false;
$this->imagineImage = null;
| php | {
"resource": ""
} |
q24246 | Version.importThumbnail | train | public function importThumbnail(ThumbnailTypeVersion $version, $path)
{
$app = Application::getFacadeApplication();
$config = $app->make('config');
$thumbnailPath = $version->getFilePath($this);
$filesystem = $this->getFile()
->getFileStorageLocationObject()
-... | php | {
"resource": ""
} |
q24247 | Version.getThumbnails | train | public function getThumbnails()
{
$thumbnails = [];
$imageWidth = (int) $this->getAttribute('width');
$imageHeight = (int) $this->getAttribute('height');
if ($imageWidth < 1 || $imageHeight < 1) {
throw new InvalidDimensionException($this->getFile(), $this, t('Invalid dim... | php | {
"resource": ""
} |
q24248 | Version.deleteThumbnail | train | public function deleteThumbnail($type)
{
$app = Application::getFacadeApplication();
$config = $app->make('config');
if (!($type instanceof ThumbnailTypeVersion)) {
$type = ThumbnailTypeVersion::getByHandle($type);
}
$fsl = $this->getFile()->getFileStorageLocation... | php | {
"resource": ""
} |
q24249 | Version.updateThumbnailStorageLocation | train | public function updateThumbnailStorageLocation($type, StorageLocation $location)
{
if (!($type instanceof ThumbnailTypeVersion)) {
$type = ThumbnailTypeVersion::getByHandle($type);
}
$fsl = $this->getFile()->getFileStorageLocationObject()->getFileSystemObject();
$path = $... | php | {
"resource": ""
} |
q24250 | Version.getJSONObject | train | public function getJSONObject()
{
$app = Application::getFacadeApplication();
$urlResolver = $app->make(ResolverManagerInterface::class);
$r = new stdClass();
$fp = new Permissions($this->getFile());
$r->canCopyFile = $fp->canCopyFile();
$r->canEditFileProperties = $f... | php | {
"resource": ""
} |
q24251 | Version.save | train | protected function save($flush = true)
{
$app = Application::getFacadeApplication();
| php | {
"resource": ""
} |
q24252 | Urls.getPackageIconURL | train | public function getPackageIconURL($pkg)
{
if ($pkg && file_exists($pkg->getPackagePath() . '/' . FILENAME_BLOCK_ICON)) {
return $this->getPackageURL($pkg) . '/' . | php | {
"resource": ""
} |
q24253 | Urls.getBlockTypeIconURL | train | public function getBlockTypeIconURL($bt)
{
$url = $this->getBlockTypeAssetsURL($bt, FILENAME_BLOCK_ICON);
if ($url != false) {
| php | {
"resource": ""
} |
q24254 | Urls.getBlockTypeAssetsURL | train | public function getBlockTypeAssetsURL($bt, $file = false)
{
$ff = '';
if ($file != false) {
$ff = '/' . $file;
}
$url = '';
$packageHandle = null;
if (file_exists(DIR_FILES_BLOCK_TYPES . '/' . $bt->getBlockTypeHandle() . $ff)) {
$url = REL_DIR... | php | {
"resource": ""
} |
q24255 | BlockView.constructView | train | protected function constructView($mixed)
{
if ($mixed instanceof Block) {
$this->blockType = $mixed->getBlockTypeObject();
$this->block = $mixed;
$this->area = $mixed->getBlockAreaObject();
} else {
$this->blockType = $mixed;
if ($this->blo... | php | {
"resource": ""
} |
q24256 | BlockView.renderViewContents | train | public function renderViewContents($scopeItems)
{
$shouldRender = function() {
$app = Application::getFacadeApplication();
// If you hook into this event and use `preventRendering()`,
// you can prevent the block from being displayed.
$event = new BlockBefore... | php | {
"resource": ""
} |
q24257 | BlockView.getBlockPath | train | public function getBlockPath($filename = null)
{
$obj = $this->blockType;
if (file_exists(DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . $filename)) {
$base = DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle();
} else {
if ($obj->getPackageID()... | php | {
"resource": ""
} |
q24258 | BlockView.getBlockURL | train | public function getBlockURL($filename = null)
{
$obj = $this->blockType;
if ($obj->getPackageID() > 0) {
if (is_dir(DIR_PACKAGES_CORE . '/' . $obj->getPackageHandle())) {
$base = ASSETS_URL . '/' . DIRNAME_PACKAGES . '/' . $obj->getPackageHandle(
) . '... | php | {
"resource": ""
} |
q24259 | BlockView.fireOnBlockOutputEvent | train | private function fireOnBlockOutputEvent()
{
$event = new BlockOutput($this->block);
$event->setContents($this->outputContent);
$app = Application::getFacadeApplication();
| php | {
"resource": ""
} |
q24260 | FileFolder.getChildFolderByName | train | public function getChildFolderByName($name, $create = false)
{
$typeHandle = $this->getTreeNodeTypeHandle();
if ($this->childNodesLoaded) {
$childNodes = $this->childNodes;
} else {
$childNodesData = $this->getHierarchicalNodesOfType($typeHandle, 1, true, false, 1);
... | php | {
"resource": ""
} |
q24261 | FileFolder.getChildFolderByPath | train | public function getChildFolderByPath(array $names, $create = false)
{
if (count($names) === 0) {
$result = $this;
} else {
$childName = array_shift($names); | php | {
"resource": ""
} |
q24262 | JsonFormatter.asArray | train | public function asArray()
{
$error = $this->error;
if ($error->has()) {
$o = [
'error' => true,
'errors' => [],
'htmlErrorIndexes' => [],
];
$index = 0;
foreach ($error->getList() as $error) {
| php | {
"resource": ""
} |
q24263 | Configuration.getApiKey | train | public function getApiKey($apiKeyIdentifier)
{
return isset($this->apiKeys[$apiKeyIdentifier]) ? | php | {
"resource": ""
} |
q24264 | Configuration.getApiKeyPrefix | train | public function getApiKeyPrefix($apiKeyIdentifier)
{
return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? | php | {
"resource": ""
} |
q24265 | Configuration.addDefaultHeader | train | public function addDefaultHeader($headerName, $headerValue)
{
if (!is_string($headerName)) {
throw new \InvalidArgumentException('Header name must be a string.');
| php | {
"resource": ""
} |
q24266 | Configuration.setCurlTimeout | train | public function setCurlTimeout($seconds)
{
if (!is_numeric($seconds) || $seconds < 0) {
throw new \InvalidArgumentException('Timeout value must be numeric and a non-negative | php | {
"resource": ""
} |
q24267 | ApiClient.getV1BatchTokenFromHeaders | train | public static function getV1BatchTokenFromHeaders($http_headers) {
if (is_array($http_headers) && isset($http_headers['Link']))
{
$connect_link_regexp = "/^<([^>]+)>;rel='next'$/";
if (preg_match($connect_link_regexp, $http_headers['Link'], $match) === 1)
{
... | php | {
"resource": ""
} |
q24268 | ObjectSerializer.serializeCollection | train | public function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti=false)
{
if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) {
// http_build_query() almost does the job for us. We just
// need to fix the result of multidimensional... | php | {
"resource": ""
} |
q24269 | TimeoutConnector.handler | train | private static function handler($uri)
{
return function (\Exception $e) use ($uri) {
if ($e instanceof TimeoutException) {
throw new \RuntimeException(
'Connection to ' . $uri . ' timed out after ' . $e->getTimeout() . ' seconds', | php | {
"resource": ""
} |
q24270 | Dataset.getValues | train | protected function getValues(array $labels)
{
if (in_array(strtolower($this->type), $this->specialDatasets)) {
return Collection::make($this->values)
| php | {
"resource": ""
} |
q24271 | BaseChart.dataset | train | public function dataset(string $name, string $type, $data)
{
if ($data instanceof Collection) {
$data = $data->toArray();
}
| php | {
"resource": ""
} |
q24272 | BaseChart.labels | train | public function labels($labels)
{
if ($labels instanceof Collection) {
$labels = $labels->toArray();
| php | {
"resource": ""
} |
q24273 | BaseChart.options | train | public function options($options, bool $overwrite = false)
{
if (!empty($options['plugins'])) {
$options['plugins'] = new Raw(trim(preg_replace('/\s\s+/', ' ', $options['plugins'])));
| php | {
"resource": ""
} |
q24274 | BaseChart.plugins | train | public function plugins($plugins, bool $overwrite = true)
{
if ($plugins instanceof Collection) {
$plugins = $plugins->toArray();
}
if ($overwrite) {
$this->plugins = $plugins;
| php | {
"resource": ""
} |
q24275 | BaseChart.container | train | public function container(string $container = null)
{
if (!$container) {
| php | {
"resource": ""
} |
q24276 | BaseChart.script | train | public function script(string $script = null)
{
if (count($this->datasets) == 0 && !$this->api_url) {
throw new \Exception('No datasets provided, please provide at least one dataset to generate a chart');
}
if (!$script) {
| php | {
"resource": ""
} |
q24277 | BaseChart.formatOptions | train | public function formatOptions(bool $strict = false, bool $noBraces = false)
{
if (!$strict && count($this->options) === 0) {
return '';
}
$options | php | {
"resource": ""
} |
q24278 | BaseChart.formatPlugins | train | public function formatPlugins(bool $strict = false, bool $noBraces = false)
{
if (!$strict && count($this->plugins) === 0) {
return '';
}
$plugins | php | {
"resource": ""
} |
q24279 | BaseChart.formatDatasets | train | public function formatDatasets()
{
// This little boy was commented because it's not compatible
// in laravel < 5.4
//
// return Collection::make($this->datasets)
// ->each
// ->matchValues(count($this->labels))
// ->map
// ->format($th... | php | {
"resource": ""
} |
q24280 | BaseChart.setScriptAttribute | train | public function setScriptAttribute(string $key, string $value)
{
| php | {
"resource": ""
} |
q24281 | BaseChart.formatContainerOptions | train | public function formatContainerOptions(string $type = 'css', bool $maxIfNull = false)
{
$options = '';
$height = ($maxIfNull && !$this->height) ? '100%' : $this->height;
$width = ($maxIfNull && !$this->width) ? '100%' : $this->width;
switch ($type) {
case 'css':
... | php | {
"resource": ""
} |
q24282 | Dataset.format | train | public function format(array $labels = [])
{
return array_merge($this->options, [
'data' => $this->formatValues($labels),
| php | {
"resource": ""
} |
q24283 | Dataset.formatValues | train | protected function formatValues(array $labels)
{
$values = Collection::make($this->values);
if (in_array(strtolower($this->type), $this->specialDatasets)) {
$colors = $this->getColors($labels);
return $values->map(function ($value, $key) use ($colors, $labels) {
| php | {
"resource": ""
} |
q24284 | Dataset.getColors | train | protected function getColors(array $labels)
{
$colors = Collection::make(array_key_exists('color', $this->options) ? $this->options['color'] : []);
while ($colors->count() < count($labels)) { | php | {
"resource": ""
} |
q24285 | Chart.export | train | public function export(bool $export, bool $client = true)
{
return $this->options([ | php | {
"resource": ""
} |
q24286 | DatasetClass.values | train | public function values($values)
{
if ($values instanceof Collection) {
$values = $values->toArray();
| php | {
"resource": ""
} |
q24287 | DatasetClass.options | train | public function options($options, bool $overwrite = false)
{
if ($overwrite) {
$this->options = $options;
} else {
| php | {
"resource": ""
} |
q24288 | DatasetClass.matchValues | train | public function matchValues(int $values, bool $strict = false)
{
while (count($this->values) < $values) {
array_push($this->values, 0);
}
if ($strict) { | php | {
"resource": ""
} |
q24289 | Chart.minimalist | train | public function minimalist(bool $minimalist = true)
{
$this->displayAxes(!$minimalist);
$this->displayLegend(!$minimalist);
return $this->options([
'xAxis' => [
'axisLabel' => [
'show' => !$minimalist,
],
'split... | php | {
"resource": ""
} |
q24290 | Chart.displayAxes | train | public function displayAxes(bool $display)
{
return $this->options([
'xAxis' => [
'show' => $display,
'axisLine' => [
'show' => $display,
],
'axisTick' => [
'show' => $display,
... | php | {
"resource": ""
} |
q24291 | Chart.export | train | public function export(bool $export = true, string $title = ' ')
{
return $this->options([
'toolbox' => [
| php | {
"resource": ""
} |
q24292 | Chart.formatDatasets | train | public function formatDatasets()
{
$datasets = Collection::make($this->datasets);
return json_encode([
'columns' => Collection::make($this->datasets)
->each(function ($dataset) {
$dataset->matchValues(count($this->labels));
})
... | php | {
"resource": ""
} |
q24293 | Chart.displayAxes | train | public function displayAxes(bool $axes, bool $strict = false)
{
if ($strict) {
return $this->options([
'scale' => [
'display' => $axes,
],
]);
}
return $this->options([
'scales' => [
'xAx... | php | {
"resource": ""
} |
q24294 | Chart.minimalist | train | public function minimalist(bool $display = false)
{
$this->displayLegend(!$display);
| php | {
"resource": ""
} |
q24295 | Dataset.color | train | public function color($color)
{
if ($color instanceof Collection) {
$color = $color->toArray();
| php | {
"resource": ""
} |
q24296 | Chart.formatOptions | train | public function formatOptions(bool $strict = false, bool $noBraces = false)
{
$this->options([
| php | {
"resource": ""
} |
q24297 | Chart.formatOptions | train | public function formatOptions(bool $strict = false, bool $noBraces = false)
{
$colors = [];
$default = 0;
foreach ($this->datasets as $dataset) {
$color = $this->default_colors[$default];
if (array_key_exists('color', $dataset->options)) {
$color = $da... | php | {
"resource": ""
} |
q24298 | Dataset.format | train | public function format()
{
return array_merge($this->options, [
'data' => $this->values,
| php | {
"resource": ""
} |
q24299 | Plugin.onPreFileDownload | train | public function onPreFileDownload(CPlugin\PreFileDownloadEvent $ev)
{
if ($this->disabled) {
return;
}
$scheme = parse_url($ev->getProcessedUrl(), PHP_URL_SCHEME);
if (!in_array($scheme, self::$supportedSchemes, true)) {
return;
}
| php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.