├── LICENSE.md ├── README.md ├── images └── icon.png ├── kirby-snippets-4.2.0.vsix ├── kirby-snippets-4.3.0.vsix ├── package.json └── snippets └── snippets.json /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Thomas Günther 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Kirby snippets for Visual Studio Code 2 | 3 | Kirby snippets for Visual Studio Code containing the following methods you can find in the Kirby Reference: 4 | 5 | - [Field methods](https://getkirby.com/docs/reference/templates/field-methods) 6 | - [Kirby methods](https://getkirby.com/docs/reference/objects/cms/app) 7 | - [Site methods](https://getkirby.com/docs/reference/objects/cms/site) 8 | - [Page methods](https://getkirby.com/docs/reference/objects/cms/page) 9 | - [Pages methods](https://getkirby.com/docs/reference/objects/cms/pages) 10 | - [File methods](https://getkirby.com/docs/reference/objects/cms/file) 11 | - [Files methods](https://getkirby.com/docs/reference/objects/cms/files) 12 | - [User methods](https://getkirby.com/docs/reference/objects/cms/user) 13 | - [Users methods](https://getkirby.com/docs/reference/objects/cms/users) 14 | - [Blocks methods](https://getkirby.com/docs/reference/objects/cms/blocks) 15 | - [Blocks methods](https://getkirby.com/docs/reference/objects/cms/block) 16 | - [Layouts methods](https://getkirby.com/docs/reference/objects/cms/layouts) 17 | - [Layout methods](https://getkirby.com/docs/reference/objects/cms/layout) 18 | - [Language methods](https://getkirby.com/docs/reference/objects/cms/language) 19 | - [Languages methods](https://getkirby.com/docs/reference/objects/cms/languages) 20 | - [Pagination methods](https://getkirby.com/docs/reference/objects/cms/pagination) 21 | - [Request methods](https://getkirby.com/docs/reference/objects/http/request) 22 | - [Session methods](https://getkirby.com/docs/reference/objects/session/session-data) 23 | 24 | I've added tabs stops for every parameter and included the corresponding description for every snippet. 25 | 26 | ![Kirby snippets](https://user-images.githubusercontent.com/7975568/51969158-fdd5d880-2473-11e9-80f7-836f98975a2c.gif) 27 | 28 | ### [→ Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=medienbaecker.kirby-snippets) 29 | -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medienbaecker/vs-code-kirby-snippets/fdcae6110bd6086b82907a53043a34d01707a64f/images/icon.png -------------------------------------------------------------------------------- /kirby-snippets-4.2.0.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medienbaecker/vs-code-kirby-snippets/fdcae6110bd6086b82907a53043a34d01707a64f/kirby-snippets-4.2.0.vsix -------------------------------------------------------------------------------- /kirby-snippets-4.3.0.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medienbaecker/vs-code-kirby-snippets/fdcae6110bd6086b82907a53043a34d01707a64f/kirby-snippets-4.3.0.vsix -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kirby-snippets", 3 | "displayName": "Kirby Cheatsheet Snippets", 4 | "description": "https://getkirby.com/docs", 5 | "version": "4.3.0", 6 | "publisher": "medienbaecker", 7 | "author": { 8 | "name": "Thomas Günther", 9 | "email": "mail@medienbaecker.com", 10 | "url": "https://medienbaecker.com" 11 | }, 12 | "homepage": "https://github.com/medienbaecker/vs-code-kirby-snippets", 13 | "bugs": { 14 | "url": "https://github.com/medienbaecker/vs-code-kirby-snippets/issues" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "https://github.com/medienbaecker/vs-code-kirby-snippets.git" 19 | }, 20 | "icon": "images/icon.png", 21 | "galleryBanner": { 22 | "color": "#212020", 23 | "theme": "dark" 24 | }, 25 | "keywords": [ 26 | "getkirby", 27 | "kirbycms", 28 | "snippets", 29 | "snippet", 30 | "vscode" 31 | ], 32 | "engines": { 33 | "vscode": "^1.5.0" 34 | }, 35 | "categories": [ 36 | "Snippets" 37 | ], 38 | "contributes": { 39 | "snippets": [ 40 | { 41 | "language": "php", 42 | "path": "./snippets/snippets.json" 43 | } 44 | ] 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /snippets/snippets.json: -------------------------------------------------------------------------------- 1 | { 2 | "$field->callback()": { 3 | "prefix": "->callback()", 4 | "body": "->callback(${1:\\$callback})", 5 | "description": "Applies the callback function to the field", 6 | "scope": "php" 7 | }, 8 | "$field->escape()": { 9 | "prefix": "->escape()", 10 | "body": "->escape(${1:\\$context = 'html'})", 11 | "description": "Escapes the field value to be safely used in HTML templates without the risk of XSS attacks", 12 | "scope": "php" 13 | }, 14 | "$field->excerpt()": { 15 | "prefix": "->excerpt()", 16 | "body": "->excerpt(${1:\\$chars = 0}, ${2:\\$strip = true}, ${3:\\$rep = ' \u2026'})", 17 | "description": "Creates an excerpt of the field value without html or any other formatting.", 18 | "scope": "php" 19 | }, 20 | "$field->exists()": { 21 | "prefix": "->exists()", 22 | "body": "->exists()", 23 | "description": "Checks if the field exists in the content data array", 24 | "scope": "php" 25 | }, 26 | "$field->html()": { 27 | "prefix": "->html()", 28 | "body": "->html()", 29 | "description": "Converts the field content to valid HTML", 30 | "scope": "php" 31 | }, 32 | "$field->inline()": { 33 | "prefix": "->inline()", 34 | "body": "->inline()", 35 | "description": "Strips all block-level HTML elements from the field value, it can be safely placed inside of other inline elements without the risk of breaking the HTML structure.", 36 | "scope": "php" 37 | }, 38 | "$field->isEmpty()": { 39 | "prefix": "->isEmpty()", 40 | "body": "->isEmpty()", 41 | "description": "Checks if the field content is empty", 42 | "scope": "php" 43 | }, 44 | "$field->isFalse()": { 45 | "prefix": "->isFalse()", 46 | "body": "->isFalse()", 47 | "description": "Converts the field value into a proper boolean and inverts it", 48 | "scope": "php" 49 | }, 50 | "$field->isNotEmpty()": { 51 | "prefix": "->isNotEmpty()", 52 | "body": "->isNotEmpty()", 53 | "description": "Checks if the field content is not empty", 54 | "scope": "php" 55 | }, 56 | "$field->isTrue()": { 57 | "prefix": "->isTrue()", 58 | "body": "->isTrue()", 59 | "description": "Converts the field value into a proper boolean", 60 | "scope": "php" 61 | }, 62 | "$field->isValid()": { 63 | "prefix": "->isValid()", 64 | "body": "->isValid(${1:\\$validator}, ${2:\\$arguments = null})", 65 | "description": "Validates the field content with the given validator and parameters", 66 | "scope": "php" 67 | }, 68 | "$field->key()": { 69 | "prefix": "->key()", 70 | "body": "->key()", 71 | "description": "Returns the name of the field", 72 | "scope": "php" 73 | }, 74 | "$field->kirbytags()": { 75 | "prefix": "->kirbytags()", 76 | "body": "->kirbytags()", 77 | "description": "Parses all KirbyTags without also parsing Markdown", 78 | "scope": "php" 79 | }, 80 | "$field->kirbytext()": { 81 | "prefix": "->kirbytext()", 82 | "body": "->kirbytext(${1:\\$options = [ ]})", 83 | "description": "Converts the field content from Markdown/Kirbytext to valid HTML", 84 | "scope": "php" 85 | }, 86 | "$field->kirbytextinline()": { 87 | "prefix": "->kirbytextinline()", 88 | "body": "->kirbytextinline(${1:\\$options = [ ]})", 89 | "description": "Converts the field content from inline Markdown/Kirbytext to valid HTML", 90 | "scope": "php" 91 | }, 92 | "$field->length()": { 93 | "prefix": "->length()", 94 | "body": "->length()", 95 | "description": "Returns the length of the field content", 96 | "scope": "php" 97 | }, 98 | "$field->lower()": { 99 | "prefix": "->lower()", 100 | "body": "->lower()", 101 | "description": "Converts the field content to lowercase", 102 | "scope": "php" 103 | }, 104 | "$field->markdown()": { 105 | "prefix": "->markdown()", 106 | "body": "->markdown(${1:\\$options = [ ]})", 107 | "description": "Converts markdown to valid HTML", 108 | "scope": "php" 109 | }, 110 | "$field->model()": { 111 | "prefix": "->model()", 112 | "body": "->model()", 113 | "description": "", 114 | "scope": "php" 115 | }, 116 | "$field->nl2br()": { 117 | "prefix": "->nl2br()", 118 | "body": "->nl2br()", 119 | "description": "Converts all line breaks in the field content to `<br>` tags.", 120 | "scope": "php" 121 | }, 122 | "$field->or()": { 123 | "prefix": "->or()", 124 | "body": "->or(${1:\\$fallback = null})", 125 | "description": "Provides a fallback if the field value is empty", 126 | "scope": "php" 127 | }, 128 | "$field->parent()": { 129 | "prefix": "->parent()", 130 | "body": "->parent()", 131 | "description": "Returns the parent object of the field", 132 | "scope": "php" 133 | }, 134 | "$field->permalinksToUrls()": { 135 | "prefix": "->permalinksToUrls()", 136 | "body": "->permalinksToUrls()", 137 | "description": "Parses the field value as DOM and replaces any permalinks in href/src attributes with the regular url", 138 | "scope": "php" 139 | }, 140 | "$field->query()": { 141 | "prefix": "->query()", 142 | "body": "->query(${1:\\$expect = null})", 143 | "description": "Uses the field value as Kirby query", 144 | "scope": "php" 145 | }, 146 | "$field->replace()": { 147 | "prefix": "->replace()", 148 | "body": "->replace(${1:\\$data = [ ]}, ${2:\\$fallback = ''})", 149 | "description": "It parses any queries found in the field value.", 150 | "scope": "php" 151 | }, 152 | "$field->short()": { 153 | "prefix": "->short()", 154 | "body": "->short(${1:\\$length}, ${2:\\$appendix = '\u2026'})", 155 | "description": "Cuts the string after the given length and adds "\u2026" if it is longer", 156 | "scope": "php" 157 | }, 158 | "$field->slug()": { 159 | "prefix": "->slug()", 160 | "body": "->slug()", 161 | "description": "Converts the field content to a slug", 162 | "scope": "php" 163 | }, 164 | "$field->smartypants()": { 165 | "prefix": "->smartypants()", 166 | "body": "->smartypants()", 167 | "description": "Applies SmartyPants to the field", 168 | "scope": "php" 169 | }, 170 | "$field->split()": { 171 | "prefix": "->split()", 172 | "body": "->split(${1:\\$separator = ','})", 173 | "description": "Splits the field content into an array", 174 | "scope": "php" 175 | }, 176 | "$field->toArray()": { 177 | "prefix": "->toArray()", 178 | "body": "->toArray()", 179 | "description": "Converts the Field object to an array", 180 | "scope": "php" 181 | }, 182 | "$field->toBlocks()": { 183 | "prefix": "->toBlocks()", 184 | "body": "->toBlocks()", 185 | "description": "Converts a yaml or json field to a Blocks object", 186 | "scope": "php" 187 | }, 188 | "$field->toBool()": { 189 | "prefix": "->toBool()", 190 | "body": "->toBool(${1:\\$default = false})", 191 | "description": "Converts the field value into a proper boolean", 192 | "scope": "php" 193 | }, 194 | "$field->toData()": { 195 | "prefix": "->toData()", 196 | "body": "->toData(${1:\\$method = ','})", 197 | "description": "Parses the field value with the given method", 198 | "scope": "php" 199 | }, 200 | "$field->toDate()": { 201 | "prefix": "->toDate()", 202 | "body": "->toDate(${1:\\$format = null}, ${2:\\$fallback = null})", 203 | "description": "Converts the field value to a timestamp or a formatted date", 204 | "scope": "php" 205 | }, 206 | "$field->toFile()": { 207 | "prefix": "->toFile()", 208 | "body": "->toFile()", 209 | "description": "Returns a file object from a filename in the field", 210 | "scope": "php" 211 | }, 212 | "$field->toFiles()": { 213 | "prefix": "->toFiles()", 214 | "body": "->toFiles(${1:\\$separator = 'yaml'})", 215 | "description": "Returns a file collection from a yaml list of filenames in the field", 216 | "scope": "php" 217 | }, 218 | "$field->toFloat()": { 219 | "prefix": "->toFloat()", 220 | "body": "->toFloat(${1:\\$default = 0.0})", 221 | "description": "Converts the field value into a proper float", 222 | "scope": "php" 223 | }, 224 | "$field->toInt()": { 225 | "prefix": "->toInt()", 226 | "body": "->toInt(${1:\\$default = 0})", 227 | "description": "Converts the field value into a proper integer", 228 | "scope": "php" 229 | }, 230 | "$field->toLayouts()": { 231 | "prefix": "->toLayouts()", 232 | "body": "->toLayouts()", 233 | "description": "Parse layouts and turn them into Layout objects", 234 | "scope": "php" 235 | }, 236 | "$field->toLink()": { 237 | "prefix": "->toLink()", 238 | "body": "->toLink(${1:\\$attr1 = null}, ${2:\\$attr2 = null})", 239 | "description": "Wraps a link tag around the field value. The field value is used as the link text", 240 | "scope": "php" 241 | }, 242 | "$field->toObject()": { 243 | "prefix": "->toObject()", 244 | "body": "->toObject()", 245 | "description": "Parse yaml data and convert it to a content object", 246 | "scope": "php" 247 | }, 248 | "$field->toPage()": { 249 | "prefix": "->toPage()", 250 | "body": "->toPage()", 251 | "description": "Returns a page object from a page id in the field", 252 | "scope": "php" 253 | }, 254 | "$field->toPages()": { 255 | "prefix": "->toPages()", 256 | "body": "->toPages(${1:\\$separator = 'yaml'})", 257 | "description": "Returns a pages collection from a yaml list of page ids in the field", 258 | "scope": "php" 259 | }, 260 | "$field->toQrCode()": { 261 | "prefix": "->toQrCode()", 262 | "body": "->toQrCode()", 263 | "description": "Turns the field value into an QR code object", 264 | "scope": "php" 265 | }, 266 | "$field->toString()": { 267 | "prefix": "->toString()", 268 | "body": "->toString()", 269 | "description": "Returns the field value as string", 270 | "scope": "php" 271 | }, 272 | "$field->toStructure()": { 273 | "prefix": "->toStructure()", 274 | "body": "->toStructure()", 275 | "description": "Converts a yaml field to a Structure object", 276 | "scope": "php" 277 | }, 278 | "$field->toTimestamp()": { 279 | "prefix": "->toTimestamp()", 280 | "body": "->toTimestamp()", 281 | "description": "Converts the field value to a Unix timestamp", 282 | "scope": "php" 283 | }, 284 | "$field->toUrl()": { 285 | "prefix": "->toUrl()", 286 | "body": "->toUrl()", 287 | "description": "Turns the field value into an absolute Url", 288 | "scope": "php" 289 | }, 290 | "$field->toUser()": { 291 | "prefix": "->toUser()", 292 | "body": "->toUser()", 293 | "description": "Converts a user email address to a user object", 294 | "scope": "php" 295 | }, 296 | "$field->toUsers()": { 297 | "prefix": "->toUsers()", 298 | "body": "->toUsers(${1:\\$separator = 'yaml'})", 299 | "description": "Returns a users collection from a yaml list of user email addresses in the field", 300 | "scope": "php" 301 | }, 302 | "$field->upper()": { 303 | "prefix": "->upper()", 304 | "body": "->upper()", 305 | "description": "Converts the field content to uppercase", 306 | "scope": "php" 307 | }, 308 | "$field->value()": { 309 | "prefix": "->value()", 310 | "body": "->value(${1:\\$value = null})", 311 | "description": "Returns the field content. If a new value is passed, the modified field will be returned. Otherwise it will return the field value.", 312 | "scope": "php" 313 | }, 314 | "$field->widont()": { 315 | "prefix": "->widont()", 316 | "body": "->widont()", 317 | "description": "Avoids typographical widows in strings by replacing the last space with `&nbsp;`", 318 | "scope": "php" 319 | }, 320 | "$field->words()": { 321 | "prefix": "->words()", 322 | "body": "->words()", 323 | "description": "Returns the number of words in the text", 324 | "scope": "php" 325 | }, 326 | "$field->xml()": { 327 | "prefix": "->xml()", 328 | "body": "->xml()", 329 | "description": "Converts the field content to valid XML", 330 | "scope": "php" 331 | }, 332 | "$field->yaml()": { 333 | "prefix": "->yaml()", 334 | "body": "->yaml()", 335 | "description": "Parses yaml in the field content and returns an array", 336 | "scope": "php" 337 | }, 338 | "$kirby->apply()": { 339 | "prefix": "->apply()", 340 | "body": "->apply(${1:\\$name}, ${2:\\$args}, ${3:\\$modify}, ${4:\\$originalEvent = null})", 341 | "description": "Applies a hook to the given value", 342 | "scope": "php" 343 | }, 344 | "$kirby->blueprints()": { 345 | "prefix": "->blueprints()", 346 | "body": "->blueprints(${1:\\$type = 'pages'})", 347 | "description": "Returns all available blueprints for this installation", 348 | "scope": "php" 349 | }, 350 | "$kirby->cache()": { 351 | "prefix": "->cache()", 352 | "body": "->cache(${1:\\$key})", 353 | "description": "Returns a cache instance by key", 354 | "scope": "php" 355 | }, 356 | "$kirby->call()": { 357 | "prefix": "->call()", 358 | "body": "->call(${1:\\$path = null}, ${2:\\$method = null})", 359 | "description": "Calls any Kirby route", 360 | "scope": "php" 361 | }, 362 | "$kirby->clone()": { 363 | "prefix": "->clone()", 364 | "body": "->clone(${1:\\$props = [ ]}, ${2:\\$setInstance = true})", 365 | "description": "Creates an instance with the same initial properties", 366 | "scope": "php" 367 | }, 368 | "$kirby->collection()": { 369 | "prefix": "->collection()", 370 | "body": "->collection(${1:\\$name}, ${2:\\$options = [ ]})", 371 | "description": "Returns a specific user-defined collection by name. All relevant dependencies are automatically injected", 372 | "scope": "php" 373 | }, 374 | "$kirby->collections()": { 375 | "prefix": "->collections()", 376 | "body": "->collections()", 377 | "description": "Returns all user-defined collections", 378 | "scope": "php" 379 | }, 380 | "$kirby->contentToken()": { 381 | "prefix": "->contentToken()", 382 | "body": "->contentToken(${1:\\$model}, ${2:\\$value})", 383 | "description": "Generates a non-guessable token based on model data and a configured salt", 384 | "scope": "php" 385 | }, 386 | "$kirby->controller()": { 387 | "prefix": "->controller()", 388 | "body": "->controller(${1:\\$name}, ${2:\\$arguments = [ ]}, ${3:\\$contentType = 'html'})", 389 | "description": "Calls a page controller by name and with the given arguments", 390 | "scope": "php" 391 | }, 392 | "$kirby->core()": { 393 | "prefix": "->core()", 394 | "body": "->core()", 395 | "description": "Get access to object that lists all parts of Kirby core", 396 | "scope": "php" 397 | }, 398 | "$kirby->csrf()": { 399 | "prefix": "->csrf()", 400 | "body": "->csrf(${1:\\$check = null})", 401 | "description": "Checks/returns a CSRF token", 402 | "scope": "php" 403 | }, 404 | "$kirby->currentLanguage()": { 405 | "prefix": "->currentLanguage()", 406 | "body": "->currentLanguage()", 407 | "description": "Returns the current language, if set by `static::setCurrentLanguage`", 408 | "scope": "php" 409 | }, 410 | "$kirby->defaultLanguage()": { 411 | "prefix": "->defaultLanguage()", 412 | "body": "->defaultLanguage()", 413 | "description": "Returns the default language object", 414 | "scope": "php" 415 | }, 416 | "$kirby->detectedLanguage()": { 417 | "prefix": "->detectedLanguage()", 418 | "body": "->detectedLanguage()", 419 | "description": "Detect the preferred language from the visitor object", 420 | "scope": "php" 421 | }, 422 | "$kirby->email()": { 423 | "prefix": "->email()", 424 | "body": "->email(${1:\\$preset = [ ]}, ${2:\\$props = [ ]})", 425 | "description": "Returns the Email singleton", 426 | "scope": "php" 427 | }, 428 | "$kirby->environment()": { 429 | "prefix": "->environment()", 430 | "body": "->environment()", 431 | "description": "Returns the environment object with access to the detected host, base url and dedicated options", 432 | "scope": "php" 433 | }, 434 | "$kirby->file()": { 435 | "prefix": "->file()", 436 | "body": "->file(${1:\\$path}, ${2:\\$parent = null}, ${3:\\$drafts = true})", 437 | "description": "Finds any file in the content directory", 438 | "scope": "php" 439 | }, 440 | "$kirby->image()": { 441 | "prefix": "->image()", 442 | "body": "->image(${1:\\$path = null})", 443 | "description": "Return an image from any page specified by the path", 444 | "scope": "php" 445 | }, 446 | "$kirby->impersonate()": { 447 | "prefix": "->impersonate()", 448 | "body": "->impersonate(${1:\\$who = null}, ${2:\\$callback = null})", 449 | "description": "Become any existing user or disable the current user", 450 | "scope": "php" 451 | }, 452 | "$kirby->isNativeComponent()": { 453 | "prefix": "->isNativeComponent()", 454 | "body": "->isNativeComponent(${1:\\$component})", 455 | "description": "Checks if a native component was extended", 456 | "scope": "php" 457 | }, 458 | "$kirby->language()": { 459 | "prefix": "->language()", 460 | "body": "->language(${1:\\$code = null})", 461 | "description": "Returns the language by code or shortcut (`default`, `current`).", 462 | "scope": "php" 463 | }, 464 | "$kirby->languages()": { 465 | "prefix": "->languages()", 466 | "body": "->languages(${1:\\$clone = true})", 467 | "description": "Returns all available site languages", 468 | "scope": "php" 469 | }, 470 | "$kirby->load()": { 471 | "prefix": "->load()", 472 | "body": "->load()", 473 | "description": "Access Kirby's part loader", 474 | "scope": "php" 475 | }, 476 | "$kirby->locks()": { 477 | "prefix": "->locks()", 478 | "body": "->locks()", 479 | "description": "Returns the app's locks object", 480 | "scope": "php" 481 | }, 482 | "$kirby->models()": { 483 | "prefix": "->models()", 484 | "body": "->models()", 485 | "description": "Yields all models (site, pages, files and users) of this site", 486 | "scope": "php" 487 | }, 488 | "$kirby->multilang()": { 489 | "prefix": "->multilang()", 490 | "body": "->multilang()", 491 | "description": "Check for a multilang setup", 492 | "scope": "php" 493 | }, 494 | "$kirby->nativeComponent()": { 495 | "prefix": "->nativeComponent()", 496 | "body": "->nativeComponent(${1:\\$component})", 497 | "description": "Returns the native implementation of a core component", 498 | "scope": "php" 499 | }, 500 | "$kirby->nonce()": { 501 | "prefix": "->nonce()", 502 | "body": "->nonce()", 503 | "description": "Returns the nonce, which is used in the panel for inline scripts", 504 | "scope": "php" 505 | }, 506 | "$kirby->option()": { 507 | "prefix": "->option()", 508 | "body": "->option(${1:\\$key}, ${2:\\$default = null})", 509 | "description": "Load a specific configuration option", 510 | "scope": "php" 511 | }, 512 | "$kirby->options()": { 513 | "prefix": "->options()", 514 | "body": "->options()", 515 | "description": "Returns all configuration options", 516 | "scope": "php" 517 | }, 518 | "$kirby->page()": { 519 | "prefix": "->page()", 520 | "body": "->page(${1:\\$id = null}, ${2:\\$parent = null}, ${3:\\$drafts = true})", 521 | "description": "Returns any page from the content folder", 522 | "scope": "php" 523 | }, 524 | "$kirby->panelLanguage()": { 525 | "prefix": "->panelLanguage()", 526 | "body": "->panelLanguage()", 527 | "description": "Returns the language code that will be used for the Panel if no user is logged in or if no language is configured for the user", 528 | "scope": "php" 529 | }, 530 | "$kirby->path()": { 531 | "prefix": "->path()", 532 | "body": "->path()", 533 | "description": "Returns the request path", 534 | "scope": "php" 535 | }, 536 | "$kirby->render()": { 537 | "prefix": "->render()", 538 | "body": "->render(${1:\\$path = null}, ${2:\\$method = null})", 539 | "description": "Returns the Response object for the current request", 540 | "scope": "php" 541 | }, 542 | "$kirby->request()": { 543 | "prefix": "->request()", 544 | "body": "->request()", 545 | "description": "Returns the Request singleton", 546 | "scope": "php" 547 | }, 548 | "$kirby->response()": { 549 | "prefix": "->response()", 550 | "body": "->response()", 551 | "description": "Response configuration", 552 | "scope": "php" 553 | }, 554 | "$kirby->roles()": { 555 | "prefix": "->roles()", 556 | "body": "->roles()", 557 | "description": "Returns all user roles", 558 | "scope": "php" 559 | }, 560 | "$kirby->root()": { 561 | "prefix": "->root()", 562 | "body": "->root(${1:\\$type = 'index'})", 563 | "description": "Returns a system root", 564 | "scope": "php" 565 | }, 566 | "$kirby->roots()": { 567 | "prefix": "->roots()", 568 | "body": "->roots()", 569 | "description": "Returns the directory structure", 570 | "scope": "php" 571 | }, 572 | "$kirby->route()": { 573 | "prefix": "->route()", 574 | "body": "->route()", 575 | "description": "Returns the currently active route", 576 | "scope": "php" 577 | }, 578 | "$kirby->session()": { 579 | "prefix": "->session()", 580 | "body": "->session(${1:\\$options = [ ]})", 581 | "description": "Returns the current session object", 582 | "scope": "php" 583 | }, 584 | "$kirby->sessionHandler()": { 585 | "prefix": "->sessionHandler()", 586 | "body": "->sessionHandler()", 587 | "description": "Returns the session handler", 588 | "scope": "php" 589 | }, 590 | "$kirby->site()": { 591 | "prefix": "->site()", 592 | "body": "->site()", 593 | "description": "Initializes and returns the Site object", 594 | "scope": "php" 595 | }, 596 | "$kirby->snippet()": { 597 | "prefix": "->snippet()", 598 | "body": "->snippet(${1:\\$name}, ${2:\\$data = [ ]}, ${3:\\$return = true}, ${4:\\$slots = false})", 599 | "description": "Uses the snippet component to create and return a template snippet", 600 | "scope": "php" 601 | }, 602 | "$kirby->system()": { 603 | "prefix": "->system()", 604 | "body": "->system()", 605 | "description": "System check class", 606 | "scope": "php" 607 | }, 608 | "$kirby->thumb()": { 609 | "prefix": "->thumb()", 610 | "body": "->thumb(${1:\\$src}, ${2:\\$dst}, ${3:\\$options = [ ]})", 611 | "description": "Thumbnail creator", 612 | "scope": "php" 613 | }, 614 | "$kirby->translation()": { 615 | "prefix": "->translation()", 616 | "body": "->translation(${1:\\$locale = null})", 617 | "description": "Load a specific translation by locale", 618 | "scope": "php" 619 | }, 620 | "$kirby->translations()": { 621 | "prefix": "->translations()", 622 | "body": "->translations()", 623 | "description": "Returns all available translations", 624 | "scope": "php" 625 | }, 626 | "$kirby->trigger()": { 627 | "prefix": "->trigger()", 628 | "body": "->trigger(${1:\\$name}, ${2:\\$args = [ ]}, ${3:\\$originalEvent = null})", 629 | "description": "Trigger a hook by name", 630 | "scope": "php" 631 | }, 632 | "$kirby->url()": { 633 | "prefix": "->url()", 634 | "body": "->url(${1:\\$type = 'index'}, ${2:\\$object = false})", 635 | "description": "Returns a system url", 636 | "scope": "php" 637 | }, 638 | "$kirby->urls()": { 639 | "prefix": "->urls()", 640 | "body": "->urls()", 641 | "description": "Returns the url structure", 642 | "scope": "php" 643 | }, 644 | "$kirby->user()": { 645 | "prefix": "->user()", 646 | "body": "->user(${1:\\$id = null}, ${2:\\$allowImpersonation = true})", 647 | "description": "Returns a specific user by id or the current user if no id is given", 648 | "scope": "php" 649 | }, 650 | "$kirby->users()": { 651 | "prefix": "->users()", 652 | "body": "->users()", 653 | "description": "Returns all users", 654 | "scope": "php" 655 | }, 656 | "$kirby->visitor()": { 657 | "prefix": "->visitor()", 658 | "body": "->visitor()", 659 | "description": "Returns the visitor object", 660 | "scope": "php" 661 | }, 662 | "$site->audio()": { 663 | "prefix": "->audio()", 664 | "body": "->audio()", 665 | "description": "Filters the Files collection by type audio", 666 | "scope": "php" 667 | }, 668 | "$site->blueprint()": { 669 | "prefix": "->blueprint()", 670 | "body": "->blueprint()", 671 | "description": "Returns the blueprint object", 672 | "scope": "php" 673 | }, 674 | "$site->blueprints()": { 675 | "prefix": "->blueprints()", 676 | "body": "->blueprints(${1:\\$inSection = null})", 677 | "description": "Returns an array with all blueprints that are available", 678 | "scope": "php" 679 | }, 680 | "$site->breadcrumb()": { 681 | "prefix": "->breadcrumb()", 682 | "body": "->breadcrumb()", 683 | "description": "Builds a breadcrumb collection", 684 | "scope": "php" 685 | }, 686 | "$site->changeTitle()": { 687 | "prefix": "->changeTitle()", 688 | "body": "->changeTitle(${1:\\$title}, ${2:\\$languageCode = null})", 689 | "description": "Change the site title", 690 | "scope": "php" 691 | }, 692 | "$site->children()": { 693 | "prefix": "->children()", 694 | "body": "->children()", 695 | "description": "Returns all published children", 696 | "scope": "php" 697 | }, 698 | "$site->childrenAndDrafts()": { 699 | "prefix": "->childrenAndDrafts()", 700 | "body": "->childrenAndDrafts()", 701 | "description": "Returns all published and draft children at the same time", 702 | "scope": "php" 703 | }, 704 | "$site->clone()": { 705 | "prefix": "->clone()", 706 | "body": "->clone(${1:\\$props = [ ]})", 707 | "description": "Creates a new instance with the same initial properties", 708 | "scope": "php" 709 | }, 710 | "$site->code()": { 711 | "prefix": "->code()", 712 | "body": "->code()", 713 | "description": "Filters the Files collection by type code", 714 | "scope": "php" 715 | }, 716 | "$site->content()": { 717 | "prefix": "->content()", 718 | "body": "->content(${1:\\$languageCode = null})", 719 | "description": "Returns the content", 720 | "scope": "php" 721 | }, 722 | "$site->contentFiles()": { 723 | "prefix": "->contentFiles()", 724 | "body": "->contentFiles()", 725 | "description": "Returns an array with all content files; NOTE: only supports the published content file (use `$model->storage()->contentFiles()` for other versions)", 726 | "scope": "php" 727 | }, 728 | "$site->createChild()": { 729 | "prefix": "->createChild()", 730 | "body": "->createChild(${1:\\$props})", 731 | "description": "Creates a main page", 732 | "scope": "php" 733 | }, 734 | "$site->createFile()": { 735 | "prefix": "->createFile()", 736 | "body": "->createFile(${1:\\$props}, ${2:\\$move = false})", 737 | "description": "Creates a new file", 738 | "scope": "php" 739 | }, 740 | "$site->decrement()": { 741 | "prefix": "->decrement()", 742 | "body": "->decrement(${1:\\$field}, ${2:\\$by = 1}, ${3:\\$min = 0})", 743 | "description": "Decrement a given field value", 744 | "scope": "php" 745 | }, 746 | "$site->documents()": { 747 | "prefix": "->documents()", 748 | "body": "->documents()", 749 | "description": "Filters the Files collection by type documents", 750 | "scope": "php" 751 | }, 752 | "$site->draft()": { 753 | "prefix": "->draft()", 754 | "body": "->draft(${1:\\$path})", 755 | "description": "Searches for a draft child by ID", 756 | "scope": "php" 757 | }, 758 | "$site->drafts()": { 759 | "prefix": "->drafts()", 760 | "body": "->drafts()", 761 | "description": "Returns all draft children", 762 | "scope": "php" 763 | }, 764 | "$site->errorPage()": { 765 | "prefix": "->errorPage()", 766 | "body": "->errorPage()", 767 | "description": "Returns the error page object", 768 | "scope": "php" 769 | }, 770 | "$site->errors()": { 771 | "prefix": "->errors()", 772 | "body": "->errors()", 773 | "description": "Returns all content validation errors", 774 | "scope": "php" 775 | }, 776 | "$site->exists()": { 777 | "prefix": "->exists()", 778 | "body": "->exists()", 779 | "description": "Checks if the site exists on disk", 780 | "scope": "php" 781 | }, 782 | "$site->file()": { 783 | "prefix": "->file()", 784 | "body": "->file(${1:\\$filename = null}, ${2:\\$in = 'files'})", 785 | "description": "Returns a specific file by filename or the first one", 786 | "scope": "php" 787 | }, 788 | "$site->files()": { 789 | "prefix": "->files()", 790 | "body": "->files()", 791 | "description": "Returns the Files collection", 792 | "scope": "php" 793 | }, 794 | "$site->find()": { 795 | "prefix": "->find()", 796 | "body": "->find(${1:\\$arguments = null})", 797 | "description": "Finds one or multiple published children by ID", 798 | "scope": "php" 799 | }, 800 | "$site->findPageOrDraft()": { 801 | "prefix": "->findPageOrDraft()", 802 | "body": "->findPageOrDraft(${1:\\$path})", 803 | "description": "Finds a single published or draft child", 804 | "scope": "php" 805 | }, 806 | "$site->grandChildren()": { 807 | "prefix": "->grandChildren()", 808 | "body": "->grandChildren()", 809 | "description": "Returns a collection of all published children of published children", 810 | "scope": "php" 811 | }, 812 | "$site->hardcopy()": { 813 | "prefix": "->hardcopy()", 814 | "body": "->hardcopy()", 815 | "description": "Creates a clone and fetches all lazy-loaded getters to get a full copy", 816 | "scope": "php" 817 | }, 818 | "$site->hasAudio()": { 819 | "prefix": "->hasAudio()", 820 | "body": "->hasAudio()", 821 | "description": "Checks if the Files collection has any audio files", 822 | "scope": "php" 823 | }, 824 | "$site->hasChildren()": { 825 | "prefix": "->hasChildren()", 826 | "body": "->hasChildren()", 827 | "description": "Checks if the model has any published children", 828 | "scope": "php" 829 | }, 830 | "$site->hasCode()": { 831 | "prefix": "->hasCode()", 832 | "body": "->hasCode()", 833 | "description": "Checks if the Files collection has any code files", 834 | "scope": "php" 835 | }, 836 | "$site->hasDocuments()": { 837 | "prefix": "->hasDocuments()", 838 | "body": "->hasDocuments()", 839 | "description": "Checks if the Files collection has any document files", 840 | "scope": "php" 841 | }, 842 | "$site->hasDrafts()": { 843 | "prefix": "->hasDrafts()", 844 | "body": "->hasDrafts()", 845 | "description": "Checks if the model has any draft children", 846 | "scope": "php" 847 | }, 848 | "$site->hasFiles()": { 849 | "prefix": "->hasFiles()", 850 | "body": "->hasFiles()", 851 | "description": "Checks if the Files collection has any files", 852 | "scope": "php" 853 | }, 854 | "$site->hasImages()": { 855 | "prefix": "->hasImages()", 856 | "body": "->hasImages()", 857 | "description": "Checks if the Files collection has any images", 858 | "scope": "php" 859 | }, 860 | "$site->hasListedChildren()": { 861 | "prefix": "->hasListedChildren()", 862 | "body": "->hasListedChildren()", 863 | "description": "Checks if the page has any listed children", 864 | "scope": "php" 865 | }, 866 | "$site->hasUnlistedChildren()": { 867 | "prefix": "->hasUnlistedChildren()", 868 | "body": "->hasUnlistedChildren()", 869 | "description": "Checks if the page has any unlisted children", 870 | "scope": "php" 871 | }, 872 | "$site->hasVideos()": { 873 | "prefix": "->hasVideos()", 874 | "body": "->hasVideos()", 875 | "description": "Checks if the Files collection has any videos", 876 | "scope": "php" 877 | }, 878 | "$site->homePage()": { 879 | "prefix": "->homePage()", 880 | "body": "->homePage()", 881 | "description": "Returns the home page object", 882 | "scope": "php" 883 | }, 884 | "$site->id()": { 885 | "prefix": "->id()", 886 | "body": "->id()", 887 | "description": "Each model must return a unique id", 888 | "scope": "php" 889 | }, 890 | "$site->image()": { 891 | "prefix": "->image()", 892 | "body": "->image(${1:\\$filename = null})", 893 | "description": "Returns a specific image by filename or the first one", 894 | "scope": "php" 895 | }, 896 | "$site->images()": { 897 | "prefix": "->images()", 898 | "body": "->images()", 899 | "description": "Filters the Files collection by type image", 900 | "scope": "php" 901 | }, 902 | "$site->increment()": { 903 | "prefix": "->increment()", 904 | "body": "->increment(${1:\\$field}, ${2:\\$by = 1}, ${3:\\$max = null})", 905 | "description": "Increment a given field value", 906 | "scope": "php" 907 | }, 908 | "$site->index()": { 909 | "prefix": "->index()", 910 | "body": "->index(${1:\\$drafts = false})", 911 | "description": "Creates a flat child index", 912 | "scope": "php" 913 | }, 914 | "$site->is()": { 915 | "prefix": "->is()", 916 | "body": "->is(${1:\\$site})", 917 | "description": "Compares the current object with the given site object", 918 | "scope": "php" 919 | }, 920 | "$site->isLocked()": { 921 | "prefix": "->isLocked()", 922 | "body": "->isLocked()", 923 | "description": "Checks if the model is locked for the current user", 924 | "scope": "php" 925 | }, 926 | "$site->isValid()": { 927 | "prefix": "->isValid()", 928 | "body": "->isValid()", 929 | "description": "Checks if the data has any errors", 930 | "scope": "php" 931 | }, 932 | "$site->kirby()": { 933 | "prefix": "->kirby()", 934 | "body": "->kirby()", 935 | "description": "Returns the parent Kirby instance", 936 | "scope": "php" 937 | }, 938 | "$site->lock()": { 939 | "prefix": "->lock()", 940 | "body": "->lock()", 941 | "description": "Returns the lock object for this model", 942 | "scope": "php" 943 | }, 944 | "$site->modified()": { 945 | "prefix": "->modified()", 946 | "body": "->modified(${1:\\$format = null}, ${2:\\$handler = null})", 947 | "description": "Gets the last modification date of all pages in the content folder.", 948 | "scope": "php" 949 | }, 950 | "$site->page()": { 951 | "prefix": "->page()", 952 | "body": "->page(${1:\\$path = null})", 953 | "description": "Returns the current page if `$path` is not specified. Otherwise it will try to find a page by the given path.", 954 | "scope": "php" 955 | }, 956 | "$site->pages()": { 957 | "prefix": "->pages()", 958 | "body": "->pages()", 959 | "description": "Alias for `Site::children()`", 960 | "scope": "php" 961 | }, 962 | "$site->panel()": { 963 | "prefix": "->panel()", 964 | "body": "->panel()", 965 | "description": "Returns the panel info object", 966 | "scope": "php" 967 | }, 968 | "$site->permissions()": { 969 | "prefix": "->permissions()", 970 | "body": "->permissions()", 971 | "description": "Returns the permissions object for this site", 972 | "scope": "php" 973 | }, 974 | "$site->purge()": { 975 | "prefix": "->purge()", 976 | "body": "->purge()", 977 | "description": "Clean internal caches", 978 | "scope": "php" 979 | }, 980 | "$site->root()": { 981 | "prefix": "->root()", 982 | "body": "->root()", 983 | "description": "Returns the absolute path to the content directory", 984 | "scope": "php" 985 | }, 986 | "$site->search()": { 987 | "prefix": "->search()", 988 | "body": "->search(${1:\\$query = null}, ${2:\\$params = [ ]})", 989 | "description": "Search all pages in the site", 990 | "scope": "php" 991 | }, 992 | "$site->site()": { 993 | "prefix": "->site()", 994 | "body": "->site()", 995 | "description": "Returns the parent Site instance", 996 | "scope": "php" 997 | }, 998 | "$site->toArray()": { 999 | "prefix": "->toArray()", 1000 | "body": "->toArray()", 1001 | "description": "Converts the most important site properties to an array", 1002 | "scope": "php" 1003 | }, 1004 | "$site->toSafeString()": { 1005 | "prefix": "->toSafeString()", 1006 | "body": "->toSafeString(${1:\\$template = null}, ${2:\\$data = [ ]}, ${3:\\$fallback = ''})", 1007 | "description": "String template builder with automatic HTML escaping", 1008 | "scope": "php" 1009 | }, 1010 | "$site->toString()": { 1011 | "prefix": "->toString()", 1012 | "body": "->toString(${1:\\$template = null}, ${2:\\$data = [ ]}, ${3:\\$fallback = ''}, ${4:\\$handler = 'template'})", 1013 | "description": "String template builder", 1014 | "scope": "php" 1015 | }, 1016 | "$site->translation()": { 1017 | "prefix": "->translation()", 1018 | "body": "->translation(${1:\\$languageCode = null})", 1019 | "description": "Returns a single translation by language code If no code is specified the current translation is returned", 1020 | "scope": "php" 1021 | }, 1022 | "$site->translations()": { 1023 | "prefix": "->translations()", 1024 | "body": "->translations()", 1025 | "description": "Returns the translations collection", 1026 | "scope": "php" 1027 | }, 1028 | "$site->update()": { 1029 | "prefix": "->update()", 1030 | "body": "->update(${1:\\$input = null}, ${2:\\$languageCode = null}, ${3:\\$validate = false})", 1031 | "description": "Updates the model data", 1032 | "scope": "php" 1033 | }, 1034 | "$site->url()": { 1035 | "prefix": "->url()", 1036 | "body": "->url(${1:\\$language = null})", 1037 | "description": "Returns the Url", 1038 | "scope": "php" 1039 | }, 1040 | "$site->uuid()": { 1041 | "prefix": "->uuid()", 1042 | "body": "->uuid()", 1043 | "description": "Returns the site's Unique ID which is always `site://`.", 1044 | "scope": "php" 1045 | }, 1046 | "$site->videos()": { 1047 | "prefix": "->videos()", 1048 | "body": "->videos()", 1049 | "description": "Filters the Files collection by type videos", 1050 | "scope": "php" 1051 | }, 1052 | "$site->wasModifiedAfter()": { 1053 | "prefix": "->wasModifiedAfter()", 1054 | "body": "->wasModifiedAfter(${1:\\$time})", 1055 | "description": "Checks if any content of the site has been modified after the given unix timestamp This is mainly used to auto-update the cache", 1056 | "scope": "php" 1057 | }, 1058 | "$page->audio()": { 1059 | "prefix": "->audio()", 1060 | "body": "->audio()", 1061 | "description": "Filters the Files collection by type audio", 1062 | "scope": "php" 1063 | }, 1064 | "$page->blueprint()": { 1065 | "prefix": "->blueprint()", 1066 | "body": "->blueprint()", 1067 | "description": "Returns the blueprint object", 1068 | "scope": "php" 1069 | }, 1070 | "$page->blueprints()": { 1071 | "prefix": "->blueprints()", 1072 | "body": "->blueprints(${1:\\$inSection = null})", 1073 | "description": "Returns an array with all blueprints that are available for the page", 1074 | "scope": "php" 1075 | }, 1076 | "$page->changeNum()": { 1077 | "prefix": "->changeNum()", 1078 | "body": "->changeNum(${1:\\$num = null})", 1079 | "description": "Changes the sorting number.", 1080 | "scope": "php" 1081 | }, 1082 | "$page->changeSlug()": { 1083 | "prefix": "->changeSlug()", 1084 | "body": "->changeSlug(${1:\\$slug}, ${2:\\$languageCode = null})", 1085 | "description": "Changes the slug/uid of the page", 1086 | "scope": "php" 1087 | }, 1088 | "$page->changeSort()": { 1089 | "prefix": "->changeSort()", 1090 | "body": "->changeSort(${1:\\$position = null})", 1091 | "description": "Change the position of the page in its siblings collection. Siblings will be resorted. If the page status isn't yet `listed`, it will be changed to it.", 1092 | "scope": "php" 1093 | }, 1094 | "$page->changeStatus()": { 1095 | "prefix": "->changeStatus()", 1096 | "body": "->changeStatus(${1:\\$status}, ${2:\\$position = null})", 1097 | "description": "Change the status of the current page to either draft, listed or unlisted.", 1098 | "scope": "php" 1099 | }, 1100 | "$page->changeTemplate()": { 1101 | "prefix": "->changeTemplate()", 1102 | "body": "->changeTemplate(${1:\\$template})", 1103 | "description": "Changes the page template", 1104 | "scope": "php" 1105 | }, 1106 | "$page->changeTitle()": { 1107 | "prefix": "->changeTitle()", 1108 | "body": "->changeTitle(${1:\\$title}, ${2:\\$languageCode = null})", 1109 | "description": "Change the page title", 1110 | "scope": "php" 1111 | }, 1112 | "$page->children()": { 1113 | "prefix": "->children()", 1114 | "body": "->children()", 1115 | "description": "Returns all published children", 1116 | "scope": "php" 1117 | }, 1118 | "$page->childrenAndDrafts()": { 1119 | "prefix": "->childrenAndDrafts()", 1120 | "body": "->childrenAndDrafts()", 1121 | "description": "Returns all published and draft children at the same time", 1122 | "scope": "php" 1123 | }, 1124 | "$page->clone()": { 1125 | "prefix": "->clone()", 1126 | "body": "->clone(${1:\\$props = [ ]})", 1127 | "description": "Creates a new instance with the same initial properties", 1128 | "scope": "php" 1129 | }, 1130 | "$page->code()": { 1131 | "prefix": "->code()", 1132 | "body": "->code()", 1133 | "description": "Filters the Files collection by type code", 1134 | "scope": "php" 1135 | }, 1136 | "$page->content()": { 1137 | "prefix": "->content()", 1138 | "body": "->content(${1:\\$languageCode = null})", 1139 | "description": "Returns the content", 1140 | "scope": "php" 1141 | }, 1142 | "$page->contentFiles()": { 1143 | "prefix": "->contentFiles()", 1144 | "body": "->contentFiles()", 1145 | "description": "Returns an array with all content files; NOTE: only supports the published content file (use `$model->storage()->contentFiles()` for other versions)", 1146 | "scope": "php" 1147 | }, 1148 | "$page->createChild()": { 1149 | "prefix": "->createChild()", 1150 | "body": "->createChild(${1:\\$props})", 1151 | "description": "Creates a child of the current page", 1152 | "scope": "php" 1153 | }, 1154 | "$page->createFile()": { 1155 | "prefix": "->createFile()", 1156 | "body": "->createFile(${1:\\$props}, ${2:\\$move = false})", 1157 | "description": "Creates a new file", 1158 | "scope": "php" 1159 | }, 1160 | "$page->createNum()": { 1161 | "prefix": "->createNum()", 1162 | "body": "->createNum(${1:\\$num = null})", 1163 | "description": "Create the sorting number for the page depending on the blueprint settings", 1164 | "scope": "php" 1165 | }, 1166 | "$page->decrement()": { 1167 | "prefix": "->decrement()", 1168 | "body": "->decrement(${1:\\$field}, ${2:\\$by = 1}, ${3:\\$min = 0})", 1169 | "description": "Decrement a given field value", 1170 | "scope": "php" 1171 | }, 1172 | "$page->delete()": { 1173 | "prefix": "->delete()", 1174 | "body": "->delete(${1:\\$force = false})", 1175 | "description": "Deletes the page", 1176 | "scope": "php" 1177 | }, 1178 | "$page->depth()": { 1179 | "prefix": "->depth()", 1180 | "body": "->depth()", 1181 | "description": "Returns a number indicating how deep the page is nested within the content folder", 1182 | "scope": "php" 1183 | }, 1184 | "$page->dirname()": { 1185 | "prefix": "->dirname()", 1186 | "body": "->dirname()", 1187 | "description": "Sorting number + Slug", 1188 | "scope": "php" 1189 | }, 1190 | "$page->diruri()": { 1191 | "prefix": "->diruri()", 1192 | "body": "->diruri()", 1193 | "description": "Sorting number + Slug", 1194 | "scope": "php" 1195 | }, 1196 | "$page->documents()": { 1197 | "prefix": "->documents()", 1198 | "body": "->documents()", 1199 | "description": "Filters the Files collection by type documents", 1200 | "scope": "php" 1201 | }, 1202 | "$page->draft()": { 1203 | "prefix": "->draft()", 1204 | "body": "->draft(${1:\\$path})", 1205 | "description": "Searches for a draft child by ID", 1206 | "scope": "php" 1207 | }, 1208 | "$page->drafts()": { 1209 | "prefix": "->drafts()", 1210 | "body": "->drafts()", 1211 | "description": "Returns all draft children", 1212 | "scope": "php" 1213 | }, 1214 | "$page->duplicate()": { 1215 | "prefix": "->duplicate()", 1216 | "body": "->duplicate(${1:\\$slug = null}, ${2:\\$options = [ ]})", 1217 | "description": "Duplicates the page with the given slug and optionally copies all files", 1218 | "scope": "php" 1219 | }, 1220 | "$page->errors()": { 1221 | "prefix": "->errors()", 1222 | "body": "->errors()", 1223 | "description": "Returns all content validation errors", 1224 | "scope": "php" 1225 | }, 1226 | "$page->exists()": { 1227 | "prefix": "->exists()", 1228 | "body": "->exists()", 1229 | "description": "Checks if the page exists on disk", 1230 | "scope": "php" 1231 | }, 1232 | "$page->file()": { 1233 | "prefix": "->file()", 1234 | "body": "->file(${1:\\$filename = null}, ${2:\\$in = 'files'})", 1235 | "description": "Returns a specific file by filename or the first one", 1236 | "scope": "php" 1237 | }, 1238 | "$page->files()": { 1239 | "prefix": "->files()", 1240 | "body": "->files()", 1241 | "description": "Returns the Files collection", 1242 | "scope": "php" 1243 | }, 1244 | "$page->find()": { 1245 | "prefix": "->find()", 1246 | "body": "->find(${1:\\$arguments = null})", 1247 | "description": "Finds one or multiple published children by ID", 1248 | "scope": "php" 1249 | }, 1250 | "$page->findPageOrDraft()": { 1251 | "prefix": "->findPageOrDraft()", 1252 | "body": "->findPageOrDraft(${1:\\$path})", 1253 | "description": "Finds a single published or draft child", 1254 | "scope": "php" 1255 | }, 1256 | "$page->go()": { 1257 | "prefix": "->go()", 1258 | "body": "->go(${1:\\$options = [ ]}, ${2:\\$code = 302})", 1259 | "description": "Redirects to this page, wrapper for the `go()` helper", 1260 | "scope": "php" 1261 | }, 1262 | "$page->grandChildren()": { 1263 | "prefix": "->grandChildren()", 1264 | "body": "->grandChildren()", 1265 | "description": "Returns a collection of all published children of published children", 1266 | "scope": "php" 1267 | }, 1268 | "$page->hardcopy()": { 1269 | "prefix": "->hardcopy()", 1270 | "body": "->hardcopy()", 1271 | "description": "Creates a clone and fetches all lazy-loaded getters to get a full copy", 1272 | "scope": "php" 1273 | }, 1274 | "$page->hasAudio()": { 1275 | "prefix": "->hasAudio()", 1276 | "body": "->hasAudio()", 1277 | "description": "Checks if the Files collection has any audio files", 1278 | "scope": "php" 1279 | }, 1280 | "$page->hasChildren()": { 1281 | "prefix": "->hasChildren()", 1282 | "body": "->hasChildren()", 1283 | "description": "Checks if the model has any published children", 1284 | "scope": "php" 1285 | }, 1286 | "$page->hasCode()": { 1287 | "prefix": "->hasCode()", 1288 | "body": "->hasCode()", 1289 | "description": "Checks if the Files collection has any code files", 1290 | "scope": "php" 1291 | }, 1292 | "$page->hasDocuments()": { 1293 | "prefix": "->hasDocuments()", 1294 | "body": "->hasDocuments()", 1295 | "description": "Checks if the Files collection has any document files", 1296 | "scope": "php" 1297 | }, 1298 | "$page->hasDrafts()": { 1299 | "prefix": "->hasDrafts()", 1300 | "body": "->hasDrafts()", 1301 | "description": "Checks if the model has any draft children", 1302 | "scope": "php" 1303 | }, 1304 | "$page->hasFiles()": { 1305 | "prefix": "->hasFiles()", 1306 | "body": "->hasFiles()", 1307 | "description": "Checks if the Files collection has any files", 1308 | "scope": "php" 1309 | }, 1310 | "$page->hasImages()": { 1311 | "prefix": "->hasImages()", 1312 | "body": "->hasImages()", 1313 | "description": "Checks if the Files collection has any images", 1314 | "scope": "php" 1315 | }, 1316 | "$page->hasListedChildren()": { 1317 | "prefix": "->hasListedChildren()", 1318 | "body": "->hasListedChildren()", 1319 | "description": "Checks if the page has any listed children", 1320 | "scope": "php" 1321 | }, 1322 | "$page->hasNext()": { 1323 | "prefix": "->hasNext()", 1324 | "body": "->hasNext(${1:\\$collection = null})", 1325 | "description": "Checks if there's a next item in the collection", 1326 | "scope": "php" 1327 | }, 1328 | "$page->hasNextListed()": { 1329 | "prefix": "->hasNextListed()", 1330 | "body": "->hasNextListed(${1:\\$collection = null})", 1331 | "description": "Checks if there's a next listed page in the siblings collection", 1332 | "scope": "php" 1333 | }, 1334 | "$page->hasNextUnlisted()": { 1335 | "prefix": "->hasNextUnlisted()", 1336 | "body": "->hasNextUnlisted(${1:\\$collection = null})", 1337 | "description": "Checks if there's a next unlisted page in the siblings collection", 1338 | "scope": "php" 1339 | }, 1340 | "$page->hasPrev()": { 1341 | "prefix": "->hasPrev()", 1342 | "body": "->hasPrev(${1:\\$collection = null})", 1343 | "description": "Checks if there's a previous item in the collection", 1344 | "scope": "php" 1345 | }, 1346 | "$page->hasPrevListed()": { 1347 | "prefix": "->hasPrevListed()", 1348 | "body": "->hasPrevListed(${1:\\$collection = null})", 1349 | "description": "Checks if there's a previous listed page in the siblings collection", 1350 | "scope": "php" 1351 | }, 1352 | "$page->hasPrevUnlisted()": { 1353 | "prefix": "->hasPrevUnlisted()", 1354 | "body": "->hasPrevUnlisted(${1:\\$collection = null})", 1355 | "description": "Checks if there's a previous unlisted page in the siblings collection", 1356 | "scope": "php" 1357 | }, 1358 | "$page->hasTemplate()": { 1359 | "prefix": "->hasTemplate()", 1360 | "body": "->hasTemplate()", 1361 | "description": "Checks if the intended template for the page exists.", 1362 | "scope": "php" 1363 | }, 1364 | "$page->hasUnlistedChildren()": { 1365 | "prefix": "->hasUnlistedChildren()", 1366 | "body": "->hasUnlistedChildren()", 1367 | "description": "Checks if the page has any unlisted children", 1368 | "scope": "php" 1369 | }, 1370 | "$page->hasVideos()": { 1371 | "prefix": "->hasVideos()", 1372 | "body": "->hasVideos()", 1373 | "description": "Checks if the Files collection has any videos", 1374 | "scope": "php" 1375 | }, 1376 | "$page->id()": { 1377 | "prefix": "->id()", 1378 | "body": "->id()", 1379 | "description": "Returns the Page Id", 1380 | "scope": "php" 1381 | }, 1382 | "$page->image()": { 1383 | "prefix": "->image()", 1384 | "body": "->image(${1:\\$filename = null})", 1385 | "description": "Returns a specific image by filename or the first one", 1386 | "scope": "php" 1387 | }, 1388 | "$page->images()": { 1389 | "prefix": "->images()", 1390 | "body": "->images()", 1391 | "description": "Filters the Files collection by type image", 1392 | "scope": "php" 1393 | }, 1394 | "$page->increment()": { 1395 | "prefix": "->increment()", 1396 | "body": "->increment(${1:\\$field}, ${2:\\$by = 1}, ${3:\\$max = null})", 1397 | "description": "Increment a given field value", 1398 | "scope": "php" 1399 | }, 1400 | "$page->index()": { 1401 | "prefix": "->index()", 1402 | "body": "->index(${1:\\$drafts = false})", 1403 | "description": "Creates a flat child index", 1404 | "scope": "php" 1405 | }, 1406 | "$page->indexOf()": { 1407 | "prefix": "->indexOf()", 1408 | "body": "->indexOf(${1:\\$collection = null})", 1409 | "description": "Returns the position / index in the collection", 1410 | "scope": "php" 1411 | }, 1412 | "$page->intendedTemplate()": { 1413 | "prefix": "->intendedTemplate()", 1414 | "body": "->intendedTemplate()", 1415 | "description": "Returns the template that should be loaded if it exists.", 1416 | "scope": "php" 1417 | }, 1418 | "$page->is()": { 1419 | "prefix": "->is()", 1420 | "body": "->is(${1:\\$page})", 1421 | "description": "Compares the current object with the given page object", 1422 | "scope": "php" 1423 | }, 1424 | "$page->isAccessible()": { 1425 | "prefix": "->isAccessible()", 1426 | "body": "->isAccessible()", 1427 | "description": "Checks if the page is accessible that accessible and listable.", 1428 | "scope": "php" 1429 | }, 1430 | "$page->isActive()": { 1431 | "prefix": "->isActive()", 1432 | "body": "->isActive()", 1433 | "description": "Checks if the page is the current page", 1434 | "scope": "php" 1435 | }, 1436 | "$page->isAncestorOf()": { 1437 | "prefix": "->isAncestorOf()", 1438 | "body": "->isAncestorOf(${1:\\$child})", 1439 | "description": "Checks if the page is a direct or indirect ancestor of the given $page object", 1440 | "scope": "php" 1441 | }, 1442 | "$page->isCacheable()": { 1443 | "prefix": "->isCacheable()", 1444 | "body": "->isCacheable()", 1445 | "description": "Checks if the page can be cached in the pages cache. This will also check if one of the ignore rules from the config kick in.", 1446 | "scope": "php" 1447 | }, 1448 | "$page->isChildOf()": { 1449 | "prefix": "->isChildOf()", 1450 | "body": "->isChildOf(${1:\\$parent})", 1451 | "description": "Checks if the page is a child of the given page", 1452 | "scope": "php" 1453 | }, 1454 | "$page->isDescendantOf()": { 1455 | "prefix": "->isDescendantOf()", 1456 | "body": "->isDescendantOf(${1:\\$parent})", 1457 | "description": "Checks if the page is a descendant of the given page", 1458 | "scope": "php" 1459 | }, 1460 | "$page->isDescendantOfActive()": { 1461 | "prefix": "->isDescendantOfActive()", 1462 | "body": "->isDescendantOfActive()", 1463 | "description": "Checks if the page is a descendant of the currently active page", 1464 | "scope": "php" 1465 | }, 1466 | "$page->isDraft()": { 1467 | "prefix": "->isDraft()", 1468 | "body": "->isDraft()", 1469 | "description": "Checks if the current page is a draft", 1470 | "scope": "php" 1471 | }, 1472 | "$page->isErrorPage()": { 1473 | "prefix": "->isErrorPage()", 1474 | "body": "->isErrorPage()", 1475 | "description": "Checks if the page is the error page", 1476 | "scope": "php" 1477 | }, 1478 | "$page->isFirst()": { 1479 | "prefix": "->isFirst()", 1480 | "body": "->isFirst(${1:\\$collection = null})", 1481 | "description": "Checks if the item is the first in the collection", 1482 | "scope": "php" 1483 | }, 1484 | "$page->isHomeOrErrorPage()": { 1485 | "prefix": "->isHomeOrErrorPage()", 1486 | "body": "->isHomeOrErrorPage()", 1487 | "description": "It's often required to check for the home and error page to stop certain actions. That's why there's a shortcut.", 1488 | "scope": "php" 1489 | }, 1490 | "$page->isHomePage()": { 1491 | "prefix": "->isHomePage()", 1492 | "body": "->isHomePage()", 1493 | "description": "Checks if the page is the home page", 1494 | "scope": "php" 1495 | }, 1496 | "$page->isLast()": { 1497 | "prefix": "->isLast()", 1498 | "body": "->isLast(${1:\\$collection = null})", 1499 | "description": "Checks if the item is the last in the collection", 1500 | "scope": "php" 1501 | }, 1502 | "$page->isListable()": { 1503 | "prefix": "->isListable()", 1504 | "body": "->isListable()", 1505 | "description": "Check if the page can be listable by the current user This permission depends on the `read` option until v5", 1506 | "scope": "php" 1507 | }, 1508 | "$page->isListed()": { 1509 | "prefix": "->isListed()", 1510 | "body": "->isListed()", 1511 | "description": "Checks if the page has a sorting number", 1512 | "scope": "php" 1513 | }, 1514 | "$page->isLocked()": { 1515 | "prefix": "->isLocked()", 1516 | "body": "->isLocked()", 1517 | "description": "Checks if the model is locked for the current user", 1518 | "scope": "php" 1519 | }, 1520 | "$page->isMovableTo()": { 1521 | "prefix": "->isMovableTo()", 1522 | "body": "->isMovableTo(${1:\\$parent})", 1523 | "description": "", 1524 | "scope": "php" 1525 | }, 1526 | "$page->isNth()": { 1527 | "prefix": "->isNth()", 1528 | "body": "->isNth(${1:\\$n}, ${2:\\$collection = null})", 1529 | "description": "Checks if the item is at a certain position", 1530 | "scope": "php" 1531 | }, 1532 | "$page->isOpen()": { 1533 | "prefix": "->isOpen()", 1534 | "body": "->isOpen()", 1535 | "description": "Checks if the page is open.", 1536 | "scope": "php" 1537 | }, 1538 | "$page->isPublished()": { 1539 | "prefix": "->isPublished()", 1540 | "body": "->isPublished()", 1541 | "description": "Checks if the page is not a draft.", 1542 | "scope": "php" 1543 | }, 1544 | "$page->isReadable()": { 1545 | "prefix": "->isReadable()", 1546 | "body": "->isReadable()", 1547 | "description": "Check if the page can be read by the current user", 1548 | "scope": "php" 1549 | }, 1550 | "$page->isSortable()": { 1551 | "prefix": "->isSortable()", 1552 | "body": "->isSortable()", 1553 | "description": "Checks if the page is sortable", 1554 | "scope": "php" 1555 | }, 1556 | "$page->isUnlisted()": { 1557 | "prefix": "->isUnlisted()", 1558 | "body": "->isUnlisted()", 1559 | "description": "Checks if the page has no sorting number", 1560 | "scope": "php" 1561 | }, 1562 | "$page->isValid()": { 1563 | "prefix": "->isValid()", 1564 | "body": "->isValid()", 1565 | "description": "Checks if the data has any errors", 1566 | "scope": "php" 1567 | }, 1568 | "$page->kirby()": { 1569 | "prefix": "->kirby()", 1570 | "body": "->kirby()", 1571 | "description": "Returns the parent Kirby instance", 1572 | "scope": "php" 1573 | }, 1574 | "$page->lock()": { 1575 | "prefix": "->lock()", 1576 | "body": "->lock()", 1577 | "description": "Returns the lock object for this model", 1578 | "scope": "php" 1579 | }, 1580 | "$page->modified()": { 1581 | "prefix": "->modified()", 1582 | "body": "->modified(${1:\\$format = null}, ${2:\\$handler = null}, ${3:\\$languageCode = null})", 1583 | "description": "Returns the last modification date of the page", 1584 | "scope": "php" 1585 | }, 1586 | "$page->move()": { 1587 | "prefix": "->move()", 1588 | "body": "->move(${1:\\$parent})", 1589 | "description": "Moves the page to a new parent if the new parent accepts the page type", 1590 | "scope": "php" 1591 | }, 1592 | "$page->next()": { 1593 | "prefix": "->next()", 1594 | "body": "->next(${1:\\$collection = null})", 1595 | "description": "Returns the next item in the collection if available", 1596 | "scope": "php" 1597 | }, 1598 | "$page->nextAll()": { 1599 | "prefix": "->nextAll()", 1600 | "body": "->nextAll(${1:\\$collection = null})", 1601 | "description": "Returns the end of the collection starting after the current item", 1602 | "scope": "php" 1603 | }, 1604 | "$page->nextListed()": { 1605 | "prefix": "->nextListed()", 1606 | "body": "->nextListed(${1:\\$collection = null})", 1607 | "description": "Returns the next listed page if it exists", 1608 | "scope": "php" 1609 | }, 1610 | "$page->nextUnlisted()": { 1611 | "prefix": "->nextUnlisted()", 1612 | "body": "->nextUnlisted(${1:\\$collection = null})", 1613 | "description": "Returns the next unlisted page if it exists", 1614 | "scope": "php" 1615 | }, 1616 | "$page->num()": { 1617 | "prefix": "->num()", 1618 | "body": "->num()", 1619 | "description": "Returns the sorting number", 1620 | "scope": "php" 1621 | }, 1622 | "$page->panel()": { 1623 | "prefix": "->panel()", 1624 | "body": "->panel()", 1625 | "description": "Returns the panel info object", 1626 | "scope": "php" 1627 | }, 1628 | "$page->parent()": { 1629 | "prefix": "->parent()", 1630 | "body": "->parent()", 1631 | "description": "Returns the parent Page object", 1632 | "scope": "php" 1633 | }, 1634 | "$page->parents()": { 1635 | "prefix": "->parents()", 1636 | "body": "->parents()", 1637 | "description": "Returns a list of all parents and their parents recursively", 1638 | "scope": "php" 1639 | }, 1640 | "$page->permalink()": { 1641 | "prefix": "->permalink()", 1642 | "body": "->permalink()", 1643 | "description": "Return the permanent URL to the page using its UUID", 1644 | "scope": "php" 1645 | }, 1646 | "$page->permissions()": { 1647 | "prefix": "->permissions()", 1648 | "body": "->permissions()", 1649 | "description": "Returns the permissions object for this page", 1650 | "scope": "php" 1651 | }, 1652 | "$page->prev()": { 1653 | "prefix": "->prev()", 1654 | "body": "->prev(${1:\\$collection = null})", 1655 | "description": "Returns the previous item in the collection if available", 1656 | "scope": "php" 1657 | }, 1658 | "$page->prevAll()": { 1659 | "prefix": "->prevAll()", 1660 | "body": "->prevAll(${1:\\$collection = null})", 1661 | "description": "Returns the beginning of the collection before the current item", 1662 | "scope": "php" 1663 | }, 1664 | "$page->prevListed()": { 1665 | "prefix": "->prevListed()", 1666 | "body": "->prevListed(${1:\\$collection = null})", 1667 | "description": "Returns the previous listed page", 1668 | "scope": "php" 1669 | }, 1670 | "$page->prevUnlisted()": { 1671 | "prefix": "->prevUnlisted()", 1672 | "body": "->prevUnlisted(${1:\\$collection = null})", 1673 | "description": "Returns the previous unlisted page", 1674 | "scope": "php" 1675 | }, 1676 | "$page->purge()": { 1677 | "prefix": "->purge()", 1678 | "body": "->purge()", 1679 | "description": "Clean internal caches", 1680 | "scope": "php" 1681 | }, 1682 | "$page->render()": { 1683 | "prefix": "->render()", 1684 | "body": "->render(${1:\\$data = [ ]}, ${2:\\$contentType = 'html'})", 1685 | "description": "Renders the page with the given data.", 1686 | "scope": "php" 1687 | }, 1688 | "$page->root()": { 1689 | "prefix": "->root()", 1690 | "body": "->root()", 1691 | "description": "Returns the absolute root to the page directory No matter if it exists or not.", 1692 | "scope": "php" 1693 | }, 1694 | "$page->search()": { 1695 | "prefix": "->search()", 1696 | "body": "->search(${1:\\$query = null}, ${2:\\$params = [ ]})", 1697 | "description": "Search all pages within the current page", 1698 | "scope": "php" 1699 | }, 1700 | "$page->siblings()": { 1701 | "prefix": "->siblings()", 1702 | "body": "->siblings(${1:\\$self = true})", 1703 | "description": "Returns all sibling elements", 1704 | "scope": "php" 1705 | }, 1706 | "$page->site()": { 1707 | "prefix": "->site()", 1708 | "body": "->site()", 1709 | "description": "Returns the parent Site instance", 1710 | "scope": "php" 1711 | }, 1712 | "$page->slug()": { 1713 | "prefix": "->slug()", 1714 | "body": "->slug(${1:\\$languageCode = null})", 1715 | "description": "Returns the slug of the page", 1716 | "scope": "php" 1717 | }, 1718 | "$page->status()": { 1719 | "prefix": "->status()", 1720 | "body": "->status()", 1721 | "description": "Returns the page status, which can be `draft`, `listed` or `unlisted`", 1722 | "scope": "php" 1723 | }, 1724 | "$page->template()": { 1725 | "prefix": "->template()", 1726 | "body": "->template()", 1727 | "description": "Returns the final template", 1728 | "scope": "php" 1729 | }, 1730 | "$page->templateSiblings()": { 1731 | "prefix": "->templateSiblings()", 1732 | "body": "->templateSiblings(${1:\\$self = true})", 1733 | "description": "Returns siblings with the same template", 1734 | "scope": "php" 1735 | }, 1736 | "$page->title()": { 1737 | "prefix": "->title()", 1738 | "body": "->title()", 1739 | "description": "Returns the title field or the slug as fallback", 1740 | "scope": "php" 1741 | }, 1742 | "$page->toArray()": { 1743 | "prefix": "->toArray()", 1744 | "body": "->toArray()", 1745 | "description": "Converts the most important properties to array", 1746 | "scope": "php" 1747 | }, 1748 | "$page->toSafeString()": { 1749 | "prefix": "->toSafeString()", 1750 | "body": "->toSafeString(${1:\\$template = null}, ${2:\\$data = [ ]}, ${3:\\$fallback = ''})", 1751 | "description": "String template builder with automatic HTML escaping", 1752 | "scope": "php" 1753 | }, 1754 | "$page->toString()": { 1755 | "prefix": "->toString()", 1756 | "body": "->toString(${1:\\$template = null}, ${2:\\$data = [ ]}, ${3:\\$fallback = ''}, ${4:\\$handler = 'template'})", 1757 | "description": "String template builder", 1758 | "scope": "php" 1759 | }, 1760 | "$page->translation()": { 1761 | "prefix": "->translation()", 1762 | "body": "->translation(${1:\\$languageCode = null})", 1763 | "description": "Returns a single translation by language code If no code is specified the current translation is returned", 1764 | "scope": "php" 1765 | }, 1766 | "$page->translations()": { 1767 | "prefix": "->translations()", 1768 | "body": "->translations()", 1769 | "description": "Returns the translations collection", 1770 | "scope": "php" 1771 | }, 1772 | "$page->uid()": { 1773 | "prefix": "->uid()", 1774 | "body": "->uid()", 1775 | "description": "Returns the UID of the page.", 1776 | "scope": "php" 1777 | }, 1778 | "$page->update()": { 1779 | "prefix": "->update()", 1780 | "body": "->update(${1:\\$input = null}, ${2:\\$languageCode = null}, ${3:\\$validate = false})", 1781 | "description": "Updates the page data", 1782 | "scope": "php" 1783 | }, 1784 | "$page->uri()": { 1785 | "prefix": "->uri()", 1786 | "body": "->uri(${1:\\$languageCode = null})", 1787 | "description": "The uri is the same as the id, except that it will be translated in multi-language setups", 1788 | "scope": "php" 1789 | }, 1790 | "$page->url()": { 1791 | "prefix": "->url()", 1792 | "body": "->url(${1:\\$options = null})", 1793 | "description": "Returns the Url", 1794 | "scope": "php" 1795 | }, 1796 | "$page->uuid()": { 1797 | "prefix": "->uuid()", 1798 | "body": "->uuid()", 1799 | "description": "Returns the page's Unique ID.", 1800 | "scope": "php" 1801 | }, 1802 | "$page->videos()": { 1803 | "prefix": "->videos()", 1804 | "body": "->videos()", 1805 | "description": "Filters the Files collection by type videos", 1806 | "scope": "php" 1807 | }, 1808 | "$pages->add()": { 1809 | "prefix": "->add()", 1810 | "body": "->add(${1:\\$object})", 1811 | "description": "Adds a single page or an entire second collection to the current collection", 1812 | "scope": "php" 1813 | }, 1814 | "$pages->append()": { 1815 | "prefix": "->append()", 1816 | "body": "->append(${1:\\$args = null})", 1817 | "description": "Appends an element to the data array", 1818 | "scope": "php" 1819 | }, 1820 | "$pages->audio()": { 1821 | "prefix": "->audio()", 1822 | "body": "->audio()", 1823 | "description": "Returns all audio files of all children", 1824 | "scope": "php" 1825 | }, 1826 | "$pages->children()": { 1827 | "prefix": "->children()", 1828 | "body": "->children()", 1829 | "description": "Returns all children for each page in the array", 1830 | "scope": "php" 1831 | }, 1832 | "$pages->chunk()": { 1833 | "prefix": "->chunk()", 1834 | "body": "->chunk(${1:\\$size})", 1835 | "description": "Creates chunks of the same size.", 1836 | "scope": "php" 1837 | }, 1838 | "$pages->clone()": { 1839 | "prefix": "->clone()", 1840 | "body": "->clone()", 1841 | "description": "Returns a cloned instance of the collection", 1842 | "scope": "php" 1843 | }, 1844 | "$pages->code()": { 1845 | "prefix": "->code()", 1846 | "body": "->code()", 1847 | "description": "Returns all code files of all children", 1848 | "scope": "php" 1849 | }, 1850 | "$pages->count()": { 1851 | "prefix": "->count()", 1852 | "body": "->count()", 1853 | "description": "Counts all elements", 1854 | "scope": "php" 1855 | }, 1856 | "$pages->current()": { 1857 | "prefix": "->current()", 1858 | "body": "->current()", 1859 | "description": "Returns the current element", 1860 | "scope": "php" 1861 | }, 1862 | "$pages->data()": { 1863 | "prefix": "->data()", 1864 | "body": "->data(${1:\\$data = null})", 1865 | "description": "Getter and setter for the data", 1866 | "scope": "php" 1867 | }, 1868 | "$pages->documents()": { 1869 | "prefix": "->documents()", 1870 | "body": "->documents()", 1871 | "description": "Returns all documents of all children", 1872 | "scope": "php" 1873 | }, 1874 | "$pages->drafts()": { 1875 | "prefix": "->drafts()", 1876 | "body": "->drafts()", 1877 | "description": "Fetch all drafts for all pages in the collection", 1878 | "scope": "php" 1879 | }, 1880 | "$pages->empty()": { 1881 | "prefix": "->empty()", 1882 | "body": "->empty()", 1883 | "description": "Clone and remove all elements from the collection", 1884 | "scope": "php" 1885 | }, 1886 | "$pages->extend()": { 1887 | "prefix": "->extend()", 1888 | "body": "->extend(${1:\\$items})", 1889 | "description": "Adds all elements to the collection", 1890 | "scope": "php" 1891 | }, 1892 | "$pages->files()": { 1893 | "prefix": "->files()", 1894 | "body": "->files()", 1895 | "description": "Returns all files of all children", 1896 | "scope": "php" 1897 | }, 1898 | "$pages->filter()": { 1899 | "prefix": "->filter()", 1900 | "body": "->filter(${1:\\$field}, ${2:\\$args = null})", 1901 | "description": "Filters elements by one of the predefined filter methods, by a custom filter function or an array of filters", 1902 | "scope": "php" 1903 | }, 1904 | "$pages->filterBy()": { 1905 | "prefix": "->filterBy()", 1906 | "body": "->filterBy(${1:\\$args = null})", 1907 | "description": "Alias for `Kirby\\Toolkit\\Collection::filter`", 1908 | "scope": "php" 1909 | }, 1910 | "$pages->find()": { 1911 | "prefix": "->find()", 1912 | "body": "->find(${1:\\$keys = null})", 1913 | "description": "Find one or multiple elements by id", 1914 | "scope": "php" 1915 | }, 1916 | "$pages->findBy()": { 1917 | "prefix": "->findBy()", 1918 | "body": "->findBy(${1:\\$attribute}, ${2:\\$value})", 1919 | "description": "Find a single element by an attribute and its value", 1920 | "scope": "php" 1921 | }, 1922 | "$pages->findOpen()": { 1923 | "prefix": "->findOpen()", 1924 | "body": "->findOpen()", 1925 | "description": "Finds the currently open page", 1926 | "scope": "php" 1927 | }, 1928 | "$pages->first()": { 1929 | "prefix": "->first()", 1930 | "body": "->first()", 1931 | "description": "Returns the first element", 1932 | "scope": "php" 1933 | }, 1934 | "$pages->flip()": { 1935 | "prefix": "->flip()", 1936 | "body": "->flip()", 1937 | "description": "Returns the elements in reverse order", 1938 | "scope": "php" 1939 | }, 1940 | "$pages->get()": { 1941 | "prefix": "->get()", 1942 | "body": "->get(${1:\\$key}, ${2:\\$default = null})", 1943 | "description": "Custom getter that is able to find extension pages", 1944 | "scope": "php" 1945 | }, 1946 | "$pages->getAttribute()": { 1947 | "prefix": "->getAttribute()", 1948 | "body": "->getAttribute(${1:\\$item}, ${2:\\$attribute}, ${3:\\$split = false}, ${4:\\$related = null})", 1949 | "description": "Extracts an attribute value from the given element in the collection. This is useful if elements in the collection might be objects, arrays or anything else and you need to get the value independently from that. We use it for `filter`.", 1950 | "scope": "php" 1951 | }, 1952 | "$pages->getIterator()": { 1953 | "prefix": "->getIterator()", 1954 | "body": "->getIterator()", 1955 | "description": "Get an iterator for the items.", 1956 | "scope": "php" 1957 | }, 1958 | "$pages->group()": { 1959 | "prefix": "->group()", 1960 | "body": "->group(${1:\\$field}, ${2:\\$caseInsensitive = true})", 1961 | "description": "Groups the items by a given field or callback. Returns a collection with an item for each group and a collection for each group.", 1962 | "scope": "php" 1963 | }, 1964 | "$pages->groupBy()": { 1965 | "prefix": "->groupBy()", 1966 | "body": "->groupBy(${1:\\$args = null})", 1967 | "description": "Alias for `Kirby\\Toolkit\\Collection::group`", 1968 | "scope": "php" 1969 | }, 1970 | "$pages->has()": { 1971 | "prefix": "->has()", 1972 | "body": "->has(${1:\\$key})", 1973 | "description": "Checks if the given object or id is in the collection", 1974 | "scope": "php" 1975 | }, 1976 | "$pages->images()": { 1977 | "prefix": "->images()", 1978 | "body": "->images()", 1979 | "description": "Returns all images of all children", 1980 | "scope": "php" 1981 | }, 1982 | "$pages->index()": { 1983 | "prefix": "->index()", 1984 | "body": "->index(${1:\\$drafts = false})", 1985 | "description": "Create a recursive flat index of all pages and subpages, etc.", 1986 | "scope": "php" 1987 | }, 1988 | "$pages->indexOf()": { 1989 | "prefix": "->indexOf()", 1990 | "body": "->indexOf(${1:\\$needle})", 1991 | "description": "Correct position detection for objects.", 1992 | "scope": "php" 1993 | }, 1994 | "$pages->intersection()": { 1995 | "prefix": "->intersection()", 1996 | "body": "->intersection(${1:\\$other})", 1997 | "description": "Returns a Collection with the intersection of the given elements", 1998 | "scope": "php" 1999 | }, 2000 | "$pages->intersects()": { 2001 | "prefix": "->intersects()", 2002 | "body": "->intersects(${1:\\$other})", 2003 | "description": "Checks if there is an intersection between the given collection and this collection", 2004 | "scope": "php" 2005 | }, 2006 | "$pages->isEmpty()": { 2007 | "prefix": "->isEmpty()", 2008 | "body": "->isEmpty()", 2009 | "description": "Checks if the number of elements is zero", 2010 | "scope": "php" 2011 | }, 2012 | "$pages->isEven()": { 2013 | "prefix": "->isEven()", 2014 | "body": "->isEven()", 2015 | "description": "Checks if the number of elements is even", 2016 | "scope": "php" 2017 | }, 2018 | "$pages->isNotEmpty()": { 2019 | "prefix": "->isNotEmpty()", 2020 | "body": "->isNotEmpty()", 2021 | "description": "Checks if the number of elements is more than zero", 2022 | "scope": "php" 2023 | }, 2024 | "$pages->isOdd()": { 2025 | "prefix": "->isOdd()", 2026 | "body": "->isOdd()", 2027 | "description": "Checks if the number of elements is odd", 2028 | "scope": "php" 2029 | }, 2030 | "$pages->key()": { 2031 | "prefix": "->key()", 2032 | "body": "->key()", 2033 | "description": "Returns the current key", 2034 | "scope": "php" 2035 | }, 2036 | "$pages->keyOf()": { 2037 | "prefix": "->keyOf()", 2038 | "body": "->keyOf(${1:\\$needle})", 2039 | "description": "Tries to find the key for the given element", 2040 | "scope": "php" 2041 | }, 2042 | "$pages->keys()": { 2043 | "prefix": "->keys()", 2044 | "body": "->keys()", 2045 | "description": "Returns an array of all keys", 2046 | "scope": "php" 2047 | }, 2048 | "$pages->last()": { 2049 | "prefix": "->last()", 2050 | "body": "->last()", 2051 | "description": "Returns the last element", 2052 | "scope": "php" 2053 | }, 2054 | "$pages->limit()": { 2055 | "prefix": "->limit()", 2056 | "body": "->limit(${1:\\$limit})", 2057 | "description": "Returns a new object with a limited number of elements", 2058 | "scope": "php" 2059 | }, 2060 | "$pages->listed()": { 2061 | "prefix": "->listed()", 2062 | "body": "->listed()", 2063 | "description": "Returns all listed pages in the collection", 2064 | "scope": "php" 2065 | }, 2066 | "$pages->map()": { 2067 | "prefix": "->map()", 2068 | "body": "->map(${1:\\$callback})", 2069 | "description": "Map a function to each element", 2070 | "scope": "php" 2071 | }, 2072 | "$pages->merge()": { 2073 | "prefix": "->merge()", 2074 | "body": "->merge(${1:\\$args = null})", 2075 | "description": "Include all given items in the collection", 2076 | "scope": "php" 2077 | }, 2078 | "$pages->next()": { 2079 | "prefix": "->next()", 2080 | "body": "->next()", 2081 | "description": "Moves the cursor to the next element and returns it", 2082 | "scope": "php" 2083 | }, 2084 | "$pages->not()": { 2085 | "prefix": "->not()", 2086 | "body": "->not(${1:\\$keys = null})", 2087 | "description": "Returns a Collection without the given element(s)", 2088 | "scope": "php" 2089 | }, 2090 | "$pages->notTemplate()": { 2091 | "prefix": "->notTemplate()", 2092 | "body": "->notTemplate(${1:\\$templates})", 2093 | "description": "Filter all pages by excluding the given template", 2094 | "scope": "php" 2095 | }, 2096 | "$pages->nth()": { 2097 | "prefix": "->nth()", 2098 | "body": "->nth(${1:\\$n})", 2099 | "description": "Returns the nth element from the collection", 2100 | "scope": "php" 2101 | }, 2102 | "$pages->nums()": { 2103 | "prefix": "->nums()", 2104 | "body": "->nums()", 2105 | "description": "Returns an array with all page numbers", 2106 | "scope": "php" 2107 | }, 2108 | "$pages->offset()": { 2109 | "prefix": "->offset()", 2110 | "body": "->offset(${1:\\$offset})", 2111 | "description": "Returns a new object starting from the given offset", 2112 | "scope": "php" 2113 | }, 2114 | "$pages->paginate()": { 2115 | "prefix": "->paginate()", 2116 | "body": "->paginate(${1:\\$arguments = null})", 2117 | "description": "Add pagination and return a sliced set of data.", 2118 | "scope": "php" 2119 | }, 2120 | "$pages->pagination()": { 2121 | "prefix": "->pagination()", 2122 | "body": "->pagination()", 2123 | "description": "Get the pagination object", 2124 | "scope": "php" 2125 | }, 2126 | "$pages->parent()": { 2127 | "prefix": "->parent()", 2128 | "body": "->parent()", 2129 | "description": "Returns the parent model", 2130 | "scope": "php" 2131 | }, 2132 | "$pages->pluck()": { 2133 | "prefix": "->pluck()", 2134 | "body": "->pluck(${1:\\$field}, ${2:\\$split = null}, ${3:\\$unique = false})", 2135 | "description": "Extracts all values for a single field into a new array", 2136 | "scope": "php" 2137 | }, 2138 | "$pages->prepend()": { 2139 | "prefix": "->prepend()", 2140 | "body": "->prepend(${1:\\$args = null})", 2141 | "description": "Prepends an element to the data array", 2142 | "scope": "php" 2143 | }, 2144 | "$pages->prev()": { 2145 | "prefix": "->prev()", 2146 | "body": "->prev()", 2147 | "description": "Moves the cursor to the previous element and returns it", 2148 | "scope": "php" 2149 | }, 2150 | "$pages->published()": { 2151 | "prefix": "->published()", 2152 | "body": "->published()", 2153 | "description": "", 2154 | "scope": "php" 2155 | }, 2156 | "$pages->query()": { 2157 | "prefix": "->query()", 2158 | "body": "->query(${1:\\$arguments = [ ]})", 2159 | "description": "Runs a combination of filter, sort, not, offset, limit, search and paginate on the collection.", 2160 | "scope": "php" 2161 | }, 2162 | "$pages->random()": { 2163 | "prefix": "->random()", 2164 | "body": "->random(${1:\\$count = 1}, ${2:\\$shuffle = false})", 2165 | "description": "Returns a new collection consisting of random elements, from the original collection, shuffled or ordered", 2166 | "scope": "php" 2167 | }, 2168 | "$pages->remove()": { 2169 | "prefix": "->remove()", 2170 | "body": "->remove(${1:\\$key})", 2171 | "description": "Removes an object", 2172 | "scope": "php" 2173 | }, 2174 | "$pages->rewind()": { 2175 | "prefix": "->rewind()", 2176 | "body": "->rewind()", 2177 | "description": "Moves the cursor to the first element", 2178 | "scope": "php" 2179 | }, 2180 | "$pages->search()": { 2181 | "prefix": "->search()", 2182 | "body": "->search(${1:\\$query = null}, ${2:\\$params = [ ]})", 2183 | "description": "Searches the collection", 2184 | "scope": "php" 2185 | }, 2186 | "$pages->set()": { 2187 | "prefix": "->set()", 2188 | "body": "->set(${1:\\$key}, ${2:\\$value = null})", 2189 | "description": "Adds a new element to the collection", 2190 | "scope": "php" 2191 | }, 2192 | "$pages->shuffle()": { 2193 | "prefix": "->shuffle()", 2194 | "body": "->shuffle()", 2195 | "description": "Shuffle all elements", 2196 | "scope": "php" 2197 | }, 2198 | "$pages->slice()": { 2199 | "prefix": "->slice()", 2200 | "body": "->slice(${1:\\$offset = 0}, ${2:\\$limit = null})", 2201 | "description": "Returns a slice of the object", 2202 | "scope": "php" 2203 | }, 2204 | "$pages->sort()": { 2205 | "prefix": "->sort()", 2206 | "body": "->sort()", 2207 | "description": "Sorts the elements by any number of fields", 2208 | "scope": "php" 2209 | }, 2210 | "$pages->sortBy()": { 2211 | "prefix": "->sortBy()", 2212 | "body": "->sortBy(${1:\\$args = null})", 2213 | "description": "Alias for `Kirby\\Toolkit\\Collection::sort`", 2214 | "scope": "php" 2215 | }, 2216 | "$pages->template()": { 2217 | "prefix": "->template()", 2218 | "body": "->template(${1:\\$templates})", 2219 | "description": "Filter all pages by the given template", 2220 | "scope": "php" 2221 | }, 2222 | "$pages->toArray()": { 2223 | "prefix": "->toArray()", 2224 | "body": "->toArray(${1:\\$map = null})", 2225 | "description": "Converts all objects in the collection to an array. This can also take a callback function to further modify the array result.", 2226 | "scope": "php" 2227 | }, 2228 | "$pages->toJson()": { 2229 | "prefix": "->toJson()", 2230 | "body": "->toJson()", 2231 | "description": "Converts the object into a JSON string", 2232 | "scope": "php" 2233 | }, 2234 | "$pages->toString()": { 2235 | "prefix": "->toString()", 2236 | "body": "->toString()", 2237 | "description": "Converts the object to a string", 2238 | "scope": "php" 2239 | }, 2240 | "$pages->unlisted()": { 2241 | "prefix": "->unlisted()", 2242 | "body": "->unlisted()", 2243 | "description": "Returns all unlisted pages in the collection", 2244 | "scope": "php" 2245 | }, 2246 | "$pages->valid()": { 2247 | "prefix": "->valid()", 2248 | "body": "->valid()", 2249 | "description": "Checks if the current element is valid", 2250 | "scope": "php" 2251 | }, 2252 | "$pages->values()": { 2253 | "prefix": "->values()", 2254 | "body": "->values(${1:\\$map = null})", 2255 | "description": "Returns a non-associative array with all values. If a mapping Closure is passed, all values are processed by the Closure.", 2256 | "scope": "php" 2257 | }, 2258 | "$pages->videos()": { 2259 | "prefix": "->videos()", 2260 | "body": "->videos()", 2261 | "description": "Returns all video files of all children", 2262 | "scope": "php" 2263 | }, 2264 | "$pages->when()": { 2265 | "prefix": "->when()", 2266 | "body": "->when(${1:\\$condition}, ${2:\\$callback}, ${3:\\$fallback = null})", 2267 | "description": "The when method only executes the given Closure when the first parameter is true. If the first parameter is false, the Closure will not be executed.", 2268 | "scope": "php" 2269 | }, 2270 | "$pages->without()": { 2271 | "prefix": "->without()", 2272 | "body": "->without(${1:\\$keys = null})", 2273 | "description": "Alias for $this->not()", 2274 | "scope": "php" 2275 | }, 2276 | "$file->asset()": { 2277 | "prefix": "->asset()", 2278 | "body": "->asset(${1:\\$props = null})", 2279 | "description": "Returns the file asset object", 2280 | "scope": "php" 2281 | }, 2282 | "$file->base64()": { 2283 | "prefix": "->base64()", 2284 | "body": "->base64()", 2285 | "description": "Returns the file content as base64 encoded string", 2286 | "scope": "php" 2287 | }, 2288 | "$file->blueprint()": { 2289 | "prefix": "->blueprint()", 2290 | "body": "->blueprint()", 2291 | "description": "Returns the FileBlueprint object for the file", 2292 | "scope": "php" 2293 | }, 2294 | "$file->blueprints()": { 2295 | "prefix": "->blueprints()", 2296 | "body": "->blueprints(${1:\\$inSection = null})", 2297 | "description": "Returns an array with all blueprints that are available for the file by comparing files sections and files fields of the parent model", 2298 | "scope": "php" 2299 | }, 2300 | "$file->blur()": { 2301 | "prefix": "->blur()", 2302 | "body": "->blur(${1:\\$pixels = true})", 2303 | "description": "Blurs the image by the given amount of pixels", 2304 | "scope": "php" 2305 | }, 2306 | "$file->bw()": { 2307 | "prefix": "->bw()", 2308 | "body": "->bw()", 2309 | "description": "Converts the image to black and white", 2310 | "scope": "php" 2311 | }, 2312 | "$file->changeName()": { 2313 | "prefix": "->changeName()", 2314 | "body": "->changeName(${1:\\$name}, ${2:\\$sanitize = true}, ${3:\\$extension = null})", 2315 | "description": "Renames the file (optionally also the extension).", 2316 | "scope": "php" 2317 | }, 2318 | "$file->changeSort()": { 2319 | "prefix": "->changeSort()", 2320 | "body": "->changeSort(${1:\\$sort})", 2321 | "description": "Changes the file's sorting number in the meta file", 2322 | "scope": "php" 2323 | }, 2324 | "$file->changeTemplate()": { 2325 | "prefix": "->changeTemplate()", 2326 | "body": "->changeTemplate(${1:\\$template})", 2327 | "description": "", 2328 | "scope": "php" 2329 | }, 2330 | "$file->clone()": { 2331 | "prefix": "->clone()", 2332 | "body": "->clone(${1:\\$props = [ ]})", 2333 | "description": "Creates a new instance with the same initial properties", 2334 | "scope": "php" 2335 | }, 2336 | "$file->content()": { 2337 | "prefix": "->content()", 2338 | "body": "->content(${1:\\$languageCode = null})", 2339 | "description": "Returns the content", 2340 | "scope": "php" 2341 | }, 2342 | "$file->contentFiles()": { 2343 | "prefix": "->contentFiles()", 2344 | "body": "->contentFiles()", 2345 | "description": "Returns an array with all content files; NOTE: only supports the published content file (use `$model->storage()->contentFiles()` for other versions)", 2346 | "scope": "php" 2347 | }, 2348 | "$file->copy()": { 2349 | "prefix": "->copy()", 2350 | "body": "->copy(${1:\\$target}, ${2:\\$force = false})", 2351 | "description": "Copy a file to a new location.", 2352 | "scope": "php" 2353 | }, 2354 | "$file->crop()": { 2355 | "prefix": "->crop()", 2356 | "body": "->crop(${1:\\$width}, ${2:\\$height = null}, ${3:\\$options = null})", 2357 | "description": "Crops the image by the given width and height", 2358 | "scope": "php" 2359 | }, 2360 | "$file->dataUri()": { 2361 | "prefix": "->dataUri()", 2362 | "body": "->dataUri(${1:\\$base64 = true})", 2363 | "description": "Returns the file as data uri", 2364 | "scope": "php" 2365 | }, 2366 | "$file->decrement()": { 2367 | "prefix": "->decrement()", 2368 | "body": "->decrement(${1:\\$field}, ${2:\\$by = 1}, ${3:\\$min = 0})", 2369 | "description": "Decrement a given field value", 2370 | "scope": "php" 2371 | }, 2372 | "$file->delete()": { 2373 | "prefix": "->delete()", 2374 | "body": "->delete()", 2375 | "description": "Deletes the file. The store is used to manipulate the filesystem or whatever you prefer.", 2376 | "scope": "php" 2377 | }, 2378 | "$image->dimensions()": { 2379 | "prefix": "->dimensions()", 2380 | "body": "->dimensions()", 2381 | "description": "Returns the dimensions of the file if possible", 2382 | "scope": "php" 2383 | }, 2384 | "$file->download()": { 2385 | "prefix": "->download()", 2386 | "body": "->download(${1:\\$filename = null})", 2387 | "description": "", 2388 | "scope": "php" 2389 | }, 2390 | "$file->errors()": { 2391 | "prefix": "->errors()", 2392 | "body": "->errors()", 2393 | "description": "Returns all content validation errors", 2394 | "scope": "php" 2395 | }, 2396 | "$image->exif()": { 2397 | "prefix": "->exif()", 2398 | "body": "->exif()", 2399 | "description": "Returns the exif object for this file (if image)", 2400 | "scope": "php" 2401 | }, 2402 | "$file->exists()": { 2403 | "prefix": "->exists()", 2404 | "body": "->exists()", 2405 | "description": "Checks if the file exists on disk", 2406 | "scope": "php" 2407 | }, 2408 | "$file->extension()": { 2409 | "prefix": "->extension()", 2410 | "body": "->extension()", 2411 | "description": "Returns the current lowercase extension (without .)", 2412 | "scope": "php" 2413 | }, 2414 | "$file->filename()": { 2415 | "prefix": "->filename()", 2416 | "body": "->filename()", 2417 | "description": "Returns the filename with extension", 2418 | "scope": "php" 2419 | }, 2420 | "$file->files()": { 2421 | "prefix": "->files()", 2422 | "body": "->files()", 2423 | "description": "Returns the parent Files collection", 2424 | "scope": "php" 2425 | }, 2426 | "$file->grayscale()": { 2427 | "prefix": "->grayscale()", 2428 | "body": "->grayscale()", 2429 | "description": "Alias for File::bw()", 2430 | "scope": "php" 2431 | }, 2432 | "$file->greyscale()": { 2433 | "prefix": "->greyscale()", 2434 | "body": "->greyscale()", 2435 | "description": "Alias for File::bw()", 2436 | "scope": "php" 2437 | }, 2438 | "$file->hardcopy()": { 2439 | "prefix": "->hardcopy()", 2440 | "body": "->hardcopy()", 2441 | "description": "Creates a clone and fetches all lazy-loaded getters to get a full copy", 2442 | "scope": "php" 2443 | }, 2444 | "$file->hasNext()": { 2445 | "prefix": "->hasNext()", 2446 | "body": "->hasNext(${1:\\$collection = null})", 2447 | "description": "Checks if there's a next item in the collection", 2448 | "scope": "php" 2449 | }, 2450 | "$file->hasPrev()": { 2451 | "prefix": "->hasPrev()", 2452 | "body": "->hasPrev(${1:\\$collection = null})", 2453 | "description": "Checks if there's a previous item in the collection", 2454 | "scope": "php" 2455 | }, 2456 | "$file->hash()": { 2457 | "prefix": "->hash()", 2458 | "body": "->hash()", 2459 | "description": "Returns a md5 hash of the root", 2460 | "scope": "php" 2461 | }, 2462 | "$file->header()": { 2463 | "prefix": "->header()", 2464 | "body": "->header(${1:\\$send = true})", 2465 | "description": "Sends an appropriate header for the asset", 2466 | "scope": "php" 2467 | }, 2468 | "$image->height()": { 2469 | "prefix": "->height()", 2470 | "body": "->height()", 2471 | "description": "Returns the height of the asset", 2472 | "scope": "php" 2473 | }, 2474 | "$file->html()": { 2475 | "prefix": "->html()", 2476 | "body": "->html(${1:\\$attr = [ ]})", 2477 | "description": "Converts the file to html", 2478 | "scope": "php" 2479 | }, 2480 | "$file->id()": { 2481 | "prefix": "->id()", 2482 | "body": "->id()", 2483 | "description": "Returns the id", 2484 | "scope": "php" 2485 | }, 2486 | "$image->imagesize()": { 2487 | "prefix": "->imagesize()", 2488 | "body": "->imagesize()", 2489 | "description": "Returns the PHP imagesize array", 2490 | "scope": "php" 2491 | }, 2492 | "$file->increment()": { 2493 | "prefix": "->increment()", 2494 | "body": "->increment(${1:\\$field}, ${2:\\$by = 1}, ${3:\\$max = null})", 2495 | "description": "Increment a given field value", 2496 | "scope": "php" 2497 | }, 2498 | "$file->indexOf()": { 2499 | "prefix": "->indexOf()", 2500 | "body": "->indexOf(${1:\\$collection = null})", 2501 | "description": "Returns the position / index in the collection", 2502 | "scope": "php" 2503 | }, 2504 | "$file->is()": { 2505 | "prefix": "->is()", 2506 | "body": "->is(${1:\\$file})", 2507 | "description": "Compares the current object with the given file object", 2508 | "scope": "php" 2509 | }, 2510 | "$file->isAccessible()": { 2511 | "prefix": "->isAccessible()", 2512 | "body": "->isAccessible()", 2513 | "description": "Checks if the files is accessible.", 2514 | "scope": "php" 2515 | }, 2516 | "$file->isFirst()": { 2517 | "prefix": "->isFirst()", 2518 | "body": "->isFirst(${1:\\$collection = null})", 2519 | "description": "Checks if the item is the first in the collection", 2520 | "scope": "php" 2521 | }, 2522 | "$image->isLandscape()": { 2523 | "prefix": "->isLandscape()", 2524 | "body": "->isLandscape()", 2525 | "description": "Checks if the dimensions of the asset are landscape", 2526 | "scope": "php" 2527 | }, 2528 | "$file->isLast()": { 2529 | "prefix": "->isLast()", 2530 | "body": "->isLast(${1:\\$collection = null})", 2531 | "description": "Checks if the item is the last in the collection", 2532 | "scope": "php" 2533 | }, 2534 | "$file->isListable()": { 2535 | "prefix": "->isListable()", 2536 | "body": "->isListable()", 2537 | "description": "Check if the file can be listable by the current user This permission depends on the `read` option until v5", 2538 | "scope": "php" 2539 | }, 2540 | "$file->isLocked()": { 2541 | "prefix": "->isLocked()", 2542 | "body": "->isLocked()", 2543 | "description": "Checks if the model is locked for the current user", 2544 | "scope": "php" 2545 | }, 2546 | "$file->isNth()": { 2547 | "prefix": "->isNth()", 2548 | "body": "->isNth(${1:\\$n}, ${2:\\$collection = null})", 2549 | "description": "Checks if the item is at a certain position", 2550 | "scope": "php" 2551 | }, 2552 | "$image->isPortrait()": { 2553 | "prefix": "->isPortrait()", 2554 | "body": "->isPortrait()", 2555 | "description": "Checks if the dimensions of the asset are portrait", 2556 | "scope": "php" 2557 | }, 2558 | "$file->isReadable()": { 2559 | "prefix": "->isReadable()", 2560 | "body": "->isReadable()", 2561 | "description": "Check if the file can be read by the current user", 2562 | "scope": "php" 2563 | }, 2564 | "$file->isResizable()": { 2565 | "prefix": "->isResizable()", 2566 | "body": "->isResizable()", 2567 | "description": "Checks if the file is a resizable image", 2568 | "scope": "php" 2569 | }, 2570 | "$image->isSquare()": { 2571 | "prefix": "->isSquare()", 2572 | "body": "->isSquare()", 2573 | "description": "Checks if the dimensions of the asset are square", 2574 | "scope": "php" 2575 | }, 2576 | "$file->isValid()": { 2577 | "prefix": "->isValid()", 2578 | "body": "->isValid()", 2579 | "description": "Checks if the data has any errors", 2580 | "scope": "php" 2581 | }, 2582 | "$file->isViewable()": { 2583 | "prefix": "->isViewable()", 2584 | "body": "->isViewable()", 2585 | "description": "Checks if a preview can be displayed for the file in the panel or in the frontend", 2586 | "scope": "php" 2587 | }, 2588 | "$file->isWritable()": { 2589 | "prefix": "->isWritable()", 2590 | "body": "->isWritable()", 2591 | "description": "Checks if the file is writable", 2592 | "scope": "php" 2593 | }, 2594 | "$file->kirby()": { 2595 | "prefix": "->kirby()", 2596 | "body": "->kirby()", 2597 | "description": "Returns the app instance", 2598 | "scope": "php" 2599 | }, 2600 | "$file->lock()": { 2601 | "prefix": "->lock()", 2602 | "body": "->lock()", 2603 | "description": "Returns the lock object for this model", 2604 | "scope": "php" 2605 | }, 2606 | "$file->manipulate()": { 2607 | "prefix": "->manipulate()", 2608 | "body": "->manipulate(${1:\\$options = [ ]})", 2609 | "description": "Resizes/crops the original file with Kirby's thumb handler", 2610 | "scope": "php" 2611 | }, 2612 | "$file->match()": { 2613 | "prefix": "->match()", 2614 | "body": "->match(${1:\\$rules})", 2615 | "description": "Runs a set of validations on the file object (mainly for images).", 2616 | "scope": "php" 2617 | }, 2618 | "$file->mime()": { 2619 | "prefix": "->mime()", 2620 | "body": "->mime()", 2621 | "description": "Detects the mime type of the file", 2622 | "scope": "php" 2623 | }, 2624 | "$file->model()": { 2625 | "prefix": "->model()", 2626 | "body": "->model()", 2627 | "description": "Returns the parent file model, which uses this instance as proxied file asset", 2628 | "scope": "php" 2629 | }, 2630 | "$file->modified()": { 2631 | "prefix": "->modified()", 2632 | "body": "->modified(${1:\\$format = null}, ${2:\\$handler = null}, ${3:\\$languageCode = null})", 2633 | "description": "Get the file's last modification time.", 2634 | "scope": "php" 2635 | }, 2636 | "$file->move()": { 2637 | "prefix": "->move()", 2638 | "body": "->move(${1:\\$newRoot}, ${2:\\$overwrite = false})", 2639 | "description": "Move the file to a new location", 2640 | "scope": "php" 2641 | }, 2642 | "$file->name()": { 2643 | "prefix": "->name()", 2644 | "body": "->name()", 2645 | "description": "Getter for the name of the file without the extension", 2646 | "scope": "php" 2647 | }, 2648 | "$file->next()": { 2649 | "prefix": "->next()", 2650 | "body": "->next(${1:\\$collection = null})", 2651 | "description": "Returns the next item in the collection if available", 2652 | "scope": "php" 2653 | }, 2654 | "$file->nextAll()": { 2655 | "prefix": "->nextAll()", 2656 | "body": "->nextAll(${1:\\$collection = null})", 2657 | "description": "Returns the end of the collection starting after the current item", 2658 | "scope": "php" 2659 | }, 2660 | "$file->niceSize()": { 2661 | "prefix": "->niceSize()", 2662 | "body": "->niceSize(${1:\\$locale = null})", 2663 | "description": "Returns the file size in a human-readable format", 2664 | "scope": "php" 2665 | }, 2666 | "$image->orientation()": { 2667 | "prefix": "->orientation()", 2668 | "body": "->orientation()", 2669 | "description": "Returns the orientation as string `landscape` | `portrait` | `square`", 2670 | "scope": "php" 2671 | }, 2672 | "$file->page()": { 2673 | "prefix": "->page()", 2674 | "body": "->page()", 2675 | "description": "Returns the parent Page object", 2676 | "scope": "php" 2677 | }, 2678 | "$file->panel()": { 2679 | "prefix": "->panel()", 2680 | "body": "->panel()", 2681 | "description": "Returns the panel info object", 2682 | "scope": "php" 2683 | }, 2684 | "$file->parent()": { 2685 | "prefix": "->parent()", 2686 | "body": "->parent()", 2687 | "description": "Returns the parent object", 2688 | "scope": "php" 2689 | }, 2690 | "$file->parents()": { 2691 | "prefix": "->parents()", 2692 | "body": "->parents()", 2693 | "description": "Returns a collection of all parent pages", 2694 | "scope": "php" 2695 | }, 2696 | "$file->permalink()": { 2697 | "prefix": "->permalink()", 2698 | "body": "->permalink()", 2699 | "description": "Return the permanent URL to the file using its UUID", 2700 | "scope": "php" 2701 | }, 2702 | "$file->permissions()": { 2703 | "prefix": "->permissions()", 2704 | "body": "->permissions()", 2705 | "description": "Returns the permissions object for this file", 2706 | "scope": "php" 2707 | }, 2708 | "$file->prev()": { 2709 | "prefix": "->prev()", 2710 | "body": "->prev(${1:\\$collection = null})", 2711 | "description": "Returns the previous item in the collection if available", 2712 | "scope": "php" 2713 | }, 2714 | "$file->prevAll()": { 2715 | "prefix": "->prevAll()", 2716 | "body": "->prevAll(${1:\\$collection = null})", 2717 | "description": "Returns the beginning of the collection before the current item", 2718 | "scope": "php" 2719 | }, 2720 | "$file->previewUrl()": { 2721 | "prefix": "->previewUrl()", 2722 | "body": "->previewUrl()", 2723 | "description": "Simplified File URL that uses the parent Page URL and the filename as a more stable alternative for the media URLs.", 2724 | "scope": "php" 2725 | }, 2726 | "$file->publish()": { 2727 | "prefix": "->publish()", 2728 | "body": "->publish()", 2729 | "description": "Move the file to the public media folder if it's not already there.", 2730 | "scope": "php" 2731 | }, 2732 | "$file->purge()": { 2733 | "prefix": "->purge()", 2734 | "body": "->purge()", 2735 | "description": "Clean internal caches", 2736 | "scope": "php" 2737 | }, 2738 | "$file->quality()": { 2739 | "prefix": "->quality()", 2740 | "body": "->quality(${1:\\$quality})", 2741 | "description": "Sets the JPEG compression quality", 2742 | "scope": "php" 2743 | }, 2744 | "$image->ratio()": { 2745 | "prefix": "->ratio()", 2746 | "body": "->ratio()", 2747 | "description": "Returns the ratio of the asset", 2748 | "scope": "php" 2749 | }, 2750 | "$file->read()": { 2751 | "prefix": "->read()", 2752 | "body": "->read()", 2753 | "description": "Reads the file content and returns it.", 2754 | "scope": "php" 2755 | }, 2756 | "$file->realpath()": { 2757 | "prefix": "->realpath()", 2758 | "body": "->realpath()", 2759 | "description": "Returns the absolute path to the file", 2760 | "scope": "php" 2761 | }, 2762 | "$file->rename()": { 2763 | "prefix": "->rename()", 2764 | "body": "->rename(${1:\\$newName}, ${2:\\$overwrite = false})", 2765 | "description": "Changes the name of the file without touching the extension", 2766 | "scope": "php" 2767 | }, 2768 | "$file->replace()": { 2769 | "prefix": "->replace()", 2770 | "body": "->replace(${1:\\$source}, ${2:\\$move = false})", 2771 | "description": "Replaces the file. The source must be an absolute path to a file or a Url.", 2772 | "scope": "php" 2773 | }, 2774 | "$file->resize()": { 2775 | "prefix": "->resize()", 2776 | "body": "->resize(${1:\\$width = null}, ${2:\\$height = null}, ${3:\\$quality = null})", 2777 | "description": "Resizes the file with the given width and height while keeping the aspect ratio.", 2778 | "scope": "php" 2779 | }, 2780 | "$file->root()": { 2781 | "prefix": "->root()", 2782 | "body": "->root()", 2783 | "description": "Returns the absolute root to the file", 2784 | "scope": "php" 2785 | }, 2786 | "$file->sanitizeContents()": { 2787 | "prefix": "->sanitizeContents()", 2788 | "body": "->sanitizeContents(${1:\\$typeLazy = false})", 2789 | "description": "Sanitizes the file contents depending on the file type by overwriting the file with the sanitized version", 2790 | "scope": "php" 2791 | }, 2792 | "$file->sha1()": { 2793 | "prefix": "->sha1()", 2794 | "body": "->sha1()", 2795 | "description": "Returns the sha1 hash of the file", 2796 | "scope": "php" 2797 | }, 2798 | "$file->sharpen()": { 2799 | "prefix": "->sharpen()", 2800 | "body": "->sharpen(${1:\\$amount = 50})", 2801 | "description": "Sharpens the image", 2802 | "scope": "php" 2803 | }, 2804 | "$file->siblings()": { 2805 | "prefix": "->siblings()", 2806 | "body": "->siblings(${1:\\$self = true})", 2807 | "description": "Returns all sibling elements", 2808 | "scope": "php" 2809 | }, 2810 | "$file->site()": { 2811 | "prefix": "->site()", 2812 | "body": "->site()", 2813 | "description": "Returns the parent Site object", 2814 | "scope": "php" 2815 | }, 2816 | "$file->size()": { 2817 | "prefix": "->size()", 2818 | "body": "->size()", 2819 | "description": "Returns the raw size of the file", 2820 | "scope": "php" 2821 | }, 2822 | "$file->srcset()": { 2823 | "prefix": "->srcset()", 2824 | "body": "->srcset(${1:\\$sizes = null})", 2825 | "description": "Create a srcset definition for the given sizes Sizes can be defined as a simple array. They can also be set up in the config with the thumbs.srcsets option.", 2826 | "scope": "php" 2827 | }, 2828 | "$file->template()": { 2829 | "prefix": "->template()", 2830 | "body": "->template()", 2831 | "description": "Returns the final template", 2832 | "scope": "php" 2833 | }, 2834 | "$file->templateSiblings()": { 2835 | "prefix": "->templateSiblings()", 2836 | "body": "->templateSiblings(${1:\\$self = true})", 2837 | "description": "Returns siblings with the same template", 2838 | "scope": "php" 2839 | }, 2840 | "$file->thumb()": { 2841 | "prefix": "->thumb()", 2842 | "body": "->thumb(${1:\\$options = null})", 2843 | "description": "Creates a modified version of images The media manager takes care of generating those modified versions and putting them in the right place. This is normally the `/media` folder of your installation, but could potentially also be a CDN or any other place.", 2844 | "scope": "php" 2845 | }, 2846 | "$file->toArray()": { 2847 | "prefix": "->toArray()", 2848 | "body": "->toArray()", 2849 | "description": "Extended info for the array export by injecting the information from the asset.", 2850 | "scope": "php" 2851 | }, 2852 | "$file->toJson()": { 2853 | "prefix": "->toJson()", 2854 | "body": "->toJson()", 2855 | "description": "Converts the entire file array into a json string", 2856 | "scope": "php" 2857 | }, 2858 | "$file->toSafeString()": { 2859 | "prefix": "->toSafeString()", 2860 | "body": "->toSafeString(${1:\\$template = null}, ${2:\\$data = [ ]}, ${3:\\$fallback = ''})", 2861 | "description": "String template builder with automatic HTML escaping", 2862 | "scope": "php" 2863 | }, 2864 | "$file->toString()": { 2865 | "prefix": "->toString()", 2866 | "body": "->toString(${1:\\$template = null}, ${2:\\$data = [ ]}, ${3:\\$fallback = ''}, ${4:\\$handler = 'template'})", 2867 | "description": "String template builder", 2868 | "scope": "php" 2869 | }, 2870 | "$file->translation()": { 2871 | "prefix": "->translation()", 2872 | "body": "->translation(${1:\\$languageCode = null})", 2873 | "description": "Returns a single translation by language code If no code is specified the current translation is returned", 2874 | "scope": "php" 2875 | }, 2876 | "$file->translations()": { 2877 | "prefix": "->translations()", 2878 | "body": "->translations()", 2879 | "description": "Returns the translations collection", 2880 | "scope": "php" 2881 | }, 2882 | "$file->type()": { 2883 | "prefix": "->type()", 2884 | "body": "->type()", 2885 | "description": "Returns the file type", 2886 | "scope": "php" 2887 | }, 2888 | "$file->unpublish()": { 2889 | "prefix": "->unpublish()", 2890 | "body": "->unpublish(${1:\\$onlyMedia = false})", 2891 | "description": "Remove all public versions of this file", 2892 | "scope": "php" 2893 | }, 2894 | "$file->update()": { 2895 | "prefix": "->update()", 2896 | "body": "->update(${1:\\$input = null}, ${2:\\$languageCode = null}, ${3:\\$validate = false})", 2897 | "description": "Updates the file's data and ensures that media files get wiped if `focus` changed", 2898 | "scope": "php" 2899 | }, 2900 | "$file->url()": { 2901 | "prefix": "->url()", 2902 | "body": "->url()", 2903 | "description": "Returns the Url", 2904 | "scope": "php" 2905 | }, 2906 | "$file->uuid()": { 2907 | "prefix": "->uuid()", 2908 | "body": "->uuid()", 2909 | "description": "Return the file's Unique ID.", 2910 | "scope": "php" 2911 | }, 2912 | "$file->validateContents()": { 2913 | "prefix": "->validateContents()", 2914 | "body": "->validateContents(${1:\\$typeLazy = false})", 2915 | "description": "Validates the file contents depending on the file type", 2916 | "scope": "php" 2917 | }, 2918 | "$image->width()": { 2919 | "prefix": "->width()", 2920 | "body": "->width()", 2921 | "description": "Returns the width of the asset", 2922 | "scope": "php" 2923 | }, 2924 | "$file->write()": { 2925 | "prefix": "->write()", 2926 | "body": "->write(${1:\\$content})", 2927 | "description": "Writes content to the file", 2928 | "scope": "php" 2929 | }, 2930 | "$files->add()": { 2931 | "prefix": "->add()", 2932 | "body": "->add(${1:\\$object})", 2933 | "description": "Adds a single file or an entire second collection to the current collection", 2934 | "scope": "php" 2935 | }, 2936 | "$files->append()": { 2937 | "prefix": "->append()", 2938 | "body": "->append(${1:\\$args = null})", 2939 | "description": "Appends an element to the data array", 2940 | "scope": "php" 2941 | }, 2942 | "$files->changeSort()": { 2943 | "prefix": "->changeSort()", 2944 | "body": "->changeSort(${1:\\$files}, ${2:\\$offset = 0})", 2945 | "description": "Sort all given files by the order in the array", 2946 | "scope": "php" 2947 | }, 2948 | "$files->chunk()": { 2949 | "prefix": "->chunk()", 2950 | "body": "->chunk(${1:\\$size})", 2951 | "description": "Creates chunks of the same size.", 2952 | "scope": "php" 2953 | }, 2954 | "$files->clone()": { 2955 | "prefix": "->clone()", 2956 | "body": "->clone()", 2957 | "description": "Returns a cloned instance of the collection", 2958 | "scope": "php" 2959 | }, 2960 | "$files->count()": { 2961 | "prefix": "->count()", 2962 | "body": "->count()", 2963 | "description": "Counts all elements", 2964 | "scope": "php" 2965 | }, 2966 | "$files->current()": { 2967 | "prefix": "->current()", 2968 | "body": "->current()", 2969 | "description": "Returns the current element", 2970 | "scope": "php" 2971 | }, 2972 | "$files->data()": { 2973 | "prefix": "->data()", 2974 | "body": "->data(${1:\\$data = null})", 2975 | "description": "Getter and setter for the data", 2976 | "scope": "php" 2977 | }, 2978 | "$files->empty()": { 2979 | "prefix": "->empty()", 2980 | "body": "->empty()", 2981 | "description": "Clone and remove all elements from the collection", 2982 | "scope": "php" 2983 | }, 2984 | "$files->extend()": { 2985 | "prefix": "->extend()", 2986 | "body": "->extend(${1:\\$items})", 2987 | "description": "Adds all elements to the collection", 2988 | "scope": "php" 2989 | }, 2990 | "$files->filter()": { 2991 | "prefix": "->filter()", 2992 | "body": "->filter(${1:\\$field}, ${2:\\$args = null})", 2993 | "description": "Filters elements by one of the predefined filter methods, by a custom filter function or an array of filters", 2994 | "scope": "php" 2995 | }, 2996 | "$files->filterBy()": { 2997 | "prefix": "->filterBy()", 2998 | "body": "->filterBy(${1:\\$args = null})", 2999 | "description": "Alias for `Kirby\\Toolkit\\Collection::filter`", 3000 | "scope": "php" 3001 | }, 3002 | "$files->find()": { 3003 | "prefix": "->find()", 3004 | "body": "->find(${1:\\$keys = null})", 3005 | "description": "Find one or multiple elements by id", 3006 | "scope": "php" 3007 | }, 3008 | "$files->findBy()": { 3009 | "prefix": "->findBy()", 3010 | "body": "->findBy(${1:\\$attribute}, ${2:\\$value})", 3011 | "description": "Find a single element by an attribute and its value", 3012 | "scope": "php" 3013 | }, 3014 | "$files->first()": { 3015 | "prefix": "->first()", 3016 | "body": "->first()", 3017 | "description": "Returns the first element", 3018 | "scope": "php" 3019 | }, 3020 | "$files->flip()": { 3021 | "prefix": "->flip()", 3022 | "body": "->flip()", 3023 | "description": "Returns the elements in reverse order", 3024 | "scope": "php" 3025 | }, 3026 | "$files->get()": { 3027 | "prefix": "->get()", 3028 | "body": "->get(${1:\\$key}, ${2:\\$default = null})", 3029 | "description": "Getter", 3030 | "scope": "php" 3031 | }, 3032 | "$files->getAttribute()": { 3033 | "prefix": "->getAttribute()", 3034 | "body": "->getAttribute(${1:\\$item}, ${2:\\$attribute}, ${3:\\$split = false}, ${4:\\$related = null})", 3035 | "description": "Extracts an attribute value from the given element in the collection. This is useful if elements in the collection might be objects, arrays or anything else and you need to get the value independently from that. We use it for `filter`.", 3036 | "scope": "php" 3037 | }, 3038 | "$files->getIterator()": { 3039 | "prefix": "->getIterator()", 3040 | "body": "->getIterator()", 3041 | "description": "Get an iterator for the items.", 3042 | "scope": "php" 3043 | }, 3044 | "$files->group()": { 3045 | "prefix": "->group()", 3046 | "body": "->group(${1:\\$field}, ${2:\\$caseInsensitive = true})", 3047 | "description": "Groups the items by a given field or callback. Returns a collection with an item for each group and a collection for each group.", 3048 | "scope": "php" 3049 | }, 3050 | "$files->groupBy()": { 3051 | "prefix": "->groupBy()", 3052 | "body": "->groupBy(${1:\\$args = null})", 3053 | "description": "Alias for `Kirby\\Toolkit\\Collection::group`", 3054 | "scope": "php" 3055 | }, 3056 | "$files->has()": { 3057 | "prefix": "->has()", 3058 | "body": "->has(${1:\\$key})", 3059 | "description": "Checks if the given object or id is in the collection", 3060 | "scope": "php" 3061 | }, 3062 | "$files->indexOf()": { 3063 | "prefix": "->indexOf()", 3064 | "body": "->indexOf(${1:\\$needle})", 3065 | "description": "Correct position detection for objects.", 3066 | "scope": "php" 3067 | }, 3068 | "$files->intersection()": { 3069 | "prefix": "->intersection()", 3070 | "body": "->intersection(${1:\\$other})", 3071 | "description": "Returns a Collection with the intersection of the given elements", 3072 | "scope": "php" 3073 | }, 3074 | "$files->intersects()": { 3075 | "prefix": "->intersects()", 3076 | "body": "->intersects(${1:\\$other})", 3077 | "description": "Checks if there is an intersection between the given collection and this collection", 3078 | "scope": "php" 3079 | }, 3080 | "$files->isEmpty()": { 3081 | "prefix": "->isEmpty()", 3082 | "body": "->isEmpty()", 3083 | "description": "Checks if the number of elements is zero", 3084 | "scope": "php" 3085 | }, 3086 | "$files->isEven()": { 3087 | "prefix": "->isEven()", 3088 | "body": "->isEven()", 3089 | "description": "Checks if the number of elements is even", 3090 | "scope": "php" 3091 | }, 3092 | "$files->isNotEmpty()": { 3093 | "prefix": "->isNotEmpty()", 3094 | "body": "->isNotEmpty()", 3095 | "description": "Checks if the number of elements is more than zero", 3096 | "scope": "php" 3097 | }, 3098 | "$files->isOdd()": { 3099 | "prefix": "->isOdd()", 3100 | "body": "->isOdd()", 3101 | "description": "Checks if the number of elements is odd", 3102 | "scope": "php" 3103 | }, 3104 | "$files->key()": { 3105 | "prefix": "->key()", 3106 | "body": "->key()", 3107 | "description": "Returns the current key", 3108 | "scope": "php" 3109 | }, 3110 | "$files->keyOf()": { 3111 | "prefix": "->keyOf()", 3112 | "body": "->keyOf(${1:\\$needle})", 3113 | "description": "Tries to find the key for the given element", 3114 | "scope": "php" 3115 | }, 3116 | "$files->keys()": { 3117 | "prefix": "->keys()", 3118 | "body": "->keys()", 3119 | "description": "Returns an array of all keys", 3120 | "scope": "php" 3121 | }, 3122 | "$files->last()": { 3123 | "prefix": "->last()", 3124 | "body": "->last()", 3125 | "description": "Returns the last element", 3126 | "scope": "php" 3127 | }, 3128 | "$files->limit()": { 3129 | "prefix": "->limit()", 3130 | "body": "->limit(${1:\\$limit})", 3131 | "description": "Returns a new object with a limited number of elements", 3132 | "scope": "php" 3133 | }, 3134 | "$files->map()": { 3135 | "prefix": "->map()", 3136 | "body": "->map(${1:\\$callback})", 3137 | "description": "Map a function to each element", 3138 | "scope": "php" 3139 | }, 3140 | "$files->next()": { 3141 | "prefix": "->next()", 3142 | "body": "->next()", 3143 | "description": "Moves the cursor to the next element and returns it", 3144 | "scope": "php" 3145 | }, 3146 | "$files->niceSize()": { 3147 | "prefix": "->niceSize()", 3148 | "body": "->niceSize(${1:\\$locale = null})", 3149 | "description": "Returns the file size for all files in the collection in a human-readable format", 3150 | "scope": "php" 3151 | }, 3152 | "$files->not()": { 3153 | "prefix": "->not()", 3154 | "body": "->not(${1:\\$keys = null})", 3155 | "description": "Returns a Collection without the given element(s)", 3156 | "scope": "php" 3157 | }, 3158 | "$files->nth()": { 3159 | "prefix": "->nth()", 3160 | "body": "->nth(${1:\\$n})", 3161 | "description": "Returns the nth element from the collection", 3162 | "scope": "php" 3163 | }, 3164 | "$files->offset()": { 3165 | "prefix": "->offset()", 3166 | "body": "->offset(${1:\\$offset})", 3167 | "description": "Returns a new object starting from the given offset", 3168 | "scope": "php" 3169 | }, 3170 | "$files->paginate()": { 3171 | "prefix": "->paginate()", 3172 | "body": "->paginate(${1:\\$arguments = null})", 3173 | "description": "Add pagination and return a sliced set of data.", 3174 | "scope": "php" 3175 | }, 3176 | "$files->pagination()": { 3177 | "prefix": "->pagination()", 3178 | "body": "->pagination()", 3179 | "description": "Get the pagination object", 3180 | "scope": "php" 3181 | }, 3182 | "$files->parent()": { 3183 | "prefix": "->parent()", 3184 | "body": "->parent()", 3185 | "description": "Returns the parent model", 3186 | "scope": "php" 3187 | }, 3188 | "$files->pluck()": { 3189 | "prefix": "->pluck()", 3190 | "body": "->pluck(${1:\\$field}, ${2:\\$split = null}, ${3:\\$unique = false})", 3191 | "description": "Extracts all values for a single field into a new array", 3192 | "scope": "php" 3193 | }, 3194 | "$files->prepend()": { 3195 | "prefix": "->prepend()", 3196 | "body": "->prepend(${1:\\$args = null})", 3197 | "description": "Prepends an element to the data array", 3198 | "scope": "php" 3199 | }, 3200 | "$files->prev()": { 3201 | "prefix": "->prev()", 3202 | "body": "->prev()", 3203 | "description": "Moves the cursor to the previous element and returns it", 3204 | "scope": "php" 3205 | }, 3206 | "$files->query()": { 3207 | "prefix": "->query()", 3208 | "body": "->query(${1:\\$arguments = [ ]})", 3209 | "description": "Runs a combination of filter, sort, not, offset, limit, search and paginate on the collection.", 3210 | "scope": "php" 3211 | }, 3212 | "$files->random()": { 3213 | "prefix": "->random()", 3214 | "body": "->random(${1:\\$count = 1}, ${2:\\$shuffle = false})", 3215 | "description": "Returns a new collection consisting of random elements, from the original collection, shuffled or ordered", 3216 | "scope": "php" 3217 | }, 3218 | "$files->remove()": { 3219 | "prefix": "->remove()", 3220 | "body": "->remove(${1:\\$key})", 3221 | "description": "Removes an object", 3222 | "scope": "php" 3223 | }, 3224 | "$files->rewind()": { 3225 | "prefix": "->rewind()", 3226 | "body": "->rewind()", 3227 | "description": "Moves the cursor to the first element", 3228 | "scope": "php" 3229 | }, 3230 | "$files->search()": { 3231 | "prefix": "->search()", 3232 | "body": "->search(${1:\\$query = null}, ${2:\\$params = [ ]})", 3233 | "description": "Searches the collection", 3234 | "scope": "php" 3235 | }, 3236 | "$files->set()": { 3237 | "prefix": "->set()", 3238 | "body": "->set(${1:\\$key}, ${2:\\$value = null})", 3239 | "description": "Adds a new element to the collection", 3240 | "scope": "php" 3241 | }, 3242 | "$files->shuffle()": { 3243 | "prefix": "->shuffle()", 3244 | "body": "->shuffle()", 3245 | "description": "Shuffle all elements", 3246 | "scope": "php" 3247 | }, 3248 | "$files->size()": { 3249 | "prefix": "->size()", 3250 | "body": "->size()", 3251 | "description": "Returns the raw size for all files in the collection", 3252 | "scope": "php" 3253 | }, 3254 | "$files->slice()": { 3255 | "prefix": "->slice()", 3256 | "body": "->slice(${1:\\$offset = 0}, ${2:\\$limit = null})", 3257 | "description": "Returns a slice of the object", 3258 | "scope": "php" 3259 | }, 3260 | "$files->sort()": { 3261 | "prefix": "->sort()", 3262 | "body": "->sort()", 3263 | "description": "Sorts the elements by any number of fields", 3264 | "scope": "php" 3265 | }, 3266 | "$files->sortBy()": { 3267 | "prefix": "->sortBy()", 3268 | "body": "->sortBy(${1:\\$args = null})", 3269 | "description": "Alias for `Kirby\\Toolkit\\Collection::sort`", 3270 | "scope": "php" 3271 | }, 3272 | "$files->sorted()": { 3273 | "prefix": "->sorted()", 3274 | "body": "->sorted()", 3275 | "description": "Returns the collection sorted by the sort number and the filename", 3276 | "scope": "php" 3277 | }, 3278 | "$files->template()": { 3279 | "prefix": "->template()", 3280 | "body": "->template(${1:\\$template})", 3281 | "description": "Filter all files by the given template", 3282 | "scope": "php" 3283 | }, 3284 | "$files->toArray()": { 3285 | "prefix": "->toArray()", 3286 | "body": "->toArray(${1:\\$map = null})", 3287 | "description": "Converts all objects in the collection to an array. This can also take a callback function to further modify the array result.", 3288 | "scope": "php" 3289 | }, 3290 | "$files->toJson()": { 3291 | "prefix": "->toJson()", 3292 | "body": "->toJson()", 3293 | "description": "Converts the object into a JSON string", 3294 | "scope": "php" 3295 | }, 3296 | "$files->toString()": { 3297 | "prefix": "->toString()", 3298 | "body": "->toString()", 3299 | "description": "Converts the object to a string", 3300 | "scope": "php" 3301 | }, 3302 | "$files->valid()": { 3303 | "prefix": "->valid()", 3304 | "body": "->valid()", 3305 | "description": "Checks if the current element is valid", 3306 | "scope": "php" 3307 | }, 3308 | "$files->values()": { 3309 | "prefix": "->values()", 3310 | "body": "->values(${1:\\$map = null})", 3311 | "description": "Returns a non-associative array with all values. If a mapping Closure is passed, all values are processed by the Closure.", 3312 | "scope": "php" 3313 | }, 3314 | "$files->when()": { 3315 | "prefix": "->when()", 3316 | "body": "->when(${1:\\$condition}, ${2:\\$callback}, ${3:\\$fallback = null})", 3317 | "description": "The when method only executes the given Closure when the first parameter is true. If the first parameter is false, the Closure will not be executed.", 3318 | "scope": "php" 3319 | }, 3320 | "$files->without()": { 3321 | "prefix": "->without()", 3322 | "body": "->without(${1:\\$keys = null})", 3323 | "description": "Alias for $this->not()", 3324 | "scope": "php" 3325 | }, 3326 | "$user->audio()": { 3327 | "prefix": "->audio()", 3328 | "body": "->audio()", 3329 | "description": "Filters the Files collection by type audio", 3330 | "scope": "php" 3331 | }, 3332 | "$user->avatar()": { 3333 | "prefix": "->avatar()", 3334 | "body": "->avatar()", 3335 | "description": "Returns the File object for the avatar or null", 3336 | "scope": "php" 3337 | }, 3338 | "$user->blueprint()": { 3339 | "prefix": "->blueprint()", 3340 | "body": "->blueprint()", 3341 | "description": "Returns the UserBlueprint object", 3342 | "scope": "php" 3343 | }, 3344 | "$user->blueprints()": { 3345 | "prefix": "->blueprints()", 3346 | "body": "->blueprints(${1:\\$inSection = null})", 3347 | "description": "Returns an array with all blueprints that are available", 3348 | "scope": "php" 3349 | }, 3350 | "$user->changeEmail()": { 3351 | "prefix": "->changeEmail()", 3352 | "body": "->changeEmail(${1:\\$email})", 3353 | "description": "Changes the user email address", 3354 | "scope": "php" 3355 | }, 3356 | "$user->changeLanguage()": { 3357 | "prefix": "->changeLanguage()", 3358 | "body": "->changeLanguage(${1:\\$language})", 3359 | "description": "Changes the user language", 3360 | "scope": "php" 3361 | }, 3362 | "$user->changeName()": { 3363 | "prefix": "->changeName()", 3364 | "body": "->changeName(${1:\\$name})", 3365 | "description": "Changes the screen name of the user", 3366 | "scope": "php" 3367 | }, 3368 | "$user->changePassword()": { 3369 | "prefix": "->changePassword()", 3370 | "body": "->changePassword(${1:\\$password})", 3371 | "description": "Changes the user password", 3372 | "scope": "php" 3373 | }, 3374 | "$user->changeRole()": { 3375 | "prefix": "->changeRole()", 3376 | "body": "->changeRole(${1:\\$role})", 3377 | "description": "Changes the user role", 3378 | "scope": "php" 3379 | }, 3380 | "$user->changeTotp()": { 3381 | "prefix": "->changeTotp()", 3382 | "body": "->changeTotp(${1:\\$secret})", 3383 | "description": "Changes the user's TOTP secret", 3384 | "scope": "php" 3385 | }, 3386 | "$user->clone()": { 3387 | "prefix": "->clone()", 3388 | "body": "->clone(${1:\\$props = [ ]})", 3389 | "description": "Creates a new instance with the same initial properties", 3390 | "scope": "php" 3391 | }, 3392 | "$user->code()": { 3393 | "prefix": "->code()", 3394 | "body": "->code()", 3395 | "description": "Filters the Files collection by type code", 3396 | "scope": "php" 3397 | }, 3398 | "$user->content()": { 3399 | "prefix": "->content()", 3400 | "body": "->content(${1:\\$languageCode = null})", 3401 | "description": "Returns the content", 3402 | "scope": "php" 3403 | }, 3404 | "$user->contentFiles()": { 3405 | "prefix": "->contentFiles()", 3406 | "body": "->contentFiles()", 3407 | "description": "Returns an array with all content files; NOTE: only supports the published content file (use `$model->storage()->contentFiles()` for other versions)", 3408 | "scope": "php" 3409 | }, 3410 | "$user->createFile()": { 3411 | "prefix": "->createFile()", 3412 | "body": "->createFile(${1:\\$props}, ${2:\\$move = false})", 3413 | "description": "Creates a new file", 3414 | "scope": "php" 3415 | }, 3416 | "$user->createId()": { 3417 | "prefix": "->createId()", 3418 | "body": "->createId()", 3419 | "description": "Returns a random user id", 3420 | "scope": "php" 3421 | }, 3422 | "$user->decrement()": { 3423 | "prefix": "->decrement()", 3424 | "body": "->decrement(${1:\\$field}, ${2:\\$by = 1}, ${3:\\$min = 0})", 3425 | "description": "Decrement a given field value", 3426 | "scope": "php" 3427 | }, 3428 | "$user->delete()": { 3429 | "prefix": "->delete()", 3430 | "body": "->delete()", 3431 | "description": "Deletes the user", 3432 | "scope": "php" 3433 | }, 3434 | "$user->documents()": { 3435 | "prefix": "->documents()", 3436 | "body": "->documents()", 3437 | "description": "Filters the Files collection by type documents", 3438 | "scope": "php" 3439 | }, 3440 | "$user->email()": { 3441 | "prefix": "->email()", 3442 | "body": "->email()", 3443 | "description": "Returns the user email address", 3444 | "scope": "php" 3445 | }, 3446 | "$user->errors()": { 3447 | "prefix": "->errors()", 3448 | "body": "->errors()", 3449 | "description": "Returns all content validation errors", 3450 | "scope": "php" 3451 | }, 3452 | "$user->exists()": { 3453 | "prefix": "->exists()", 3454 | "body": "->exists()", 3455 | "description": "Checks if the user exists", 3456 | "scope": "php" 3457 | }, 3458 | "$user->file()": { 3459 | "prefix": "->file()", 3460 | "body": "->file(${1:\\$filename = null}, ${2:\\$in = 'files'})", 3461 | "description": "Returns a specific file by filename or the first one", 3462 | "scope": "php" 3463 | }, 3464 | "$user->files()": { 3465 | "prefix": "->files()", 3466 | "body": "->files()", 3467 | "description": "Returns the Files collection", 3468 | "scope": "php" 3469 | }, 3470 | "$user->hardcopy()": { 3471 | "prefix": "->hardcopy()", 3472 | "body": "->hardcopy()", 3473 | "description": "Creates a clone and fetches all lazy-loaded getters to get a full copy", 3474 | "scope": "php" 3475 | }, 3476 | "$user->hasAudio()": { 3477 | "prefix": "->hasAudio()", 3478 | "body": "->hasAudio()", 3479 | "description": "Checks if the Files collection has any audio files", 3480 | "scope": "php" 3481 | }, 3482 | "$user->hasCode()": { 3483 | "prefix": "->hasCode()", 3484 | "body": "->hasCode()", 3485 | "description": "Checks if the Files collection has any code files", 3486 | "scope": "php" 3487 | }, 3488 | "$user->hasDocuments()": { 3489 | "prefix": "->hasDocuments()", 3490 | "body": "->hasDocuments()", 3491 | "description": "Checks if the Files collection has any document files", 3492 | "scope": "php" 3493 | }, 3494 | "$user->hasFiles()": { 3495 | "prefix": "->hasFiles()", 3496 | "body": "->hasFiles()", 3497 | "description": "Checks if the Files collection has any files", 3498 | "scope": "php" 3499 | }, 3500 | "$user->hasImages()": { 3501 | "prefix": "->hasImages()", 3502 | "body": "->hasImages()", 3503 | "description": "Checks if the Files collection has any images", 3504 | "scope": "php" 3505 | }, 3506 | "$user->hasNext()": { 3507 | "prefix": "->hasNext()", 3508 | "body": "->hasNext(${1:\\$collection = null})", 3509 | "description": "Checks if there's a next item in the collection", 3510 | "scope": "php" 3511 | }, 3512 | "$user->hasPrev()": { 3513 | "prefix": "->hasPrev()", 3514 | "body": "->hasPrev(${1:\\$collection = null})", 3515 | "description": "Checks if there's a previous item in the collection", 3516 | "scope": "php" 3517 | }, 3518 | "$user->hasVideos()": { 3519 | "prefix": "->hasVideos()", 3520 | "body": "->hasVideos()", 3521 | "description": "Checks if the Files collection has any videos", 3522 | "scope": "php" 3523 | }, 3524 | "$user->id()": { 3525 | "prefix": "->id()", 3526 | "body": "->id()", 3527 | "description": "Returns the user id", 3528 | "scope": "php" 3529 | }, 3530 | "$user->image()": { 3531 | "prefix": "->image()", 3532 | "body": "->image(${1:\\$filename = null})", 3533 | "description": "Returns a specific image by filename or the first one", 3534 | "scope": "php" 3535 | }, 3536 | "$user->images()": { 3537 | "prefix": "->images()", 3538 | "body": "->images()", 3539 | "description": "Filters the Files collection by type image", 3540 | "scope": "php" 3541 | }, 3542 | "$user->increment()": { 3543 | "prefix": "->increment()", 3544 | "body": "->increment(${1:\\$field}, ${2:\\$by = 1}, ${3:\\$max = null})", 3545 | "description": "Increment a given field value", 3546 | "scope": "php" 3547 | }, 3548 | "$user->indexOf()": { 3549 | "prefix": "->indexOf()", 3550 | "body": "->indexOf(${1:\\$collection = null})", 3551 | "description": "Returns the position / index in the collection", 3552 | "scope": "php" 3553 | }, 3554 | "$user->inventory()": { 3555 | "prefix": "->inventory()", 3556 | "body": "->inventory()", 3557 | "description": "Returns the inventory of files children and content files", 3558 | "scope": "php" 3559 | }, 3560 | "$user->is()": { 3561 | "prefix": "->is()", 3562 | "body": "->is(${1:\\$user = null})", 3563 | "description": "Compares the current object with the given user object", 3564 | "scope": "php" 3565 | }, 3566 | "$user->isAdmin()": { 3567 | "prefix": "->isAdmin()", 3568 | "body": "->isAdmin()", 3569 | "description": "Checks if this user has the admin role", 3570 | "scope": "php" 3571 | }, 3572 | "$user->isFirst()": { 3573 | "prefix": "->isFirst()", 3574 | "body": "->isFirst(${1:\\$collection = null})", 3575 | "description": "Checks if the item is the first in the collection", 3576 | "scope": "php" 3577 | }, 3578 | "$user->isKirby()": { 3579 | "prefix": "->isKirby()", 3580 | "body": "->isKirby()", 3581 | "description": "Checks if the current user is the virtual Kirby user", 3582 | "scope": "php" 3583 | }, 3584 | "$user->isLast()": { 3585 | "prefix": "->isLast()", 3586 | "body": "->isLast(${1:\\$collection = null})", 3587 | "description": "Checks if the item is the last in the collection", 3588 | "scope": "php" 3589 | }, 3590 | "$user->isLastAdmin()": { 3591 | "prefix": "->isLastAdmin()", 3592 | "body": "->isLastAdmin()", 3593 | "description": "Checks if the user is the last one with the admin role", 3594 | "scope": "php" 3595 | }, 3596 | "$user->isLastUser()": { 3597 | "prefix": "->isLastUser()", 3598 | "body": "->isLastUser()", 3599 | "description": "Checks if the user is the last user", 3600 | "scope": "php" 3601 | }, 3602 | "$user->isLocked()": { 3603 | "prefix": "->isLocked()", 3604 | "body": "->isLocked()", 3605 | "description": "Checks if the model is locked for the current user", 3606 | "scope": "php" 3607 | }, 3608 | "$user->isLoggedIn()": { 3609 | "prefix": "->isLoggedIn()", 3610 | "body": "->isLoggedIn()", 3611 | "description": "Checks if the current user is this user", 3612 | "scope": "php" 3613 | }, 3614 | "$user->isNobody()": { 3615 | "prefix": "->isNobody()", 3616 | "body": "->isNobody()", 3617 | "description": "Checks if the current user is the virtual Nobody user", 3618 | "scope": "php" 3619 | }, 3620 | "$user->isNth()": { 3621 | "prefix": "->isNth()", 3622 | "body": "->isNth(${1:\\$n}, ${2:\\$collection = null})", 3623 | "description": "Checks if the item is at a certain position", 3624 | "scope": "php" 3625 | }, 3626 | "$user->isValid()": { 3627 | "prefix": "->isValid()", 3628 | "body": "->isValid()", 3629 | "description": "Checks if the data has any errors", 3630 | "scope": "php" 3631 | }, 3632 | "$user->kirby()": { 3633 | "prefix": "->kirby()", 3634 | "body": "->kirby()", 3635 | "description": "Returns the parent Kirby instance", 3636 | "scope": "php" 3637 | }, 3638 | "$user->language()": { 3639 | "prefix": "->language()", 3640 | "body": "->language()", 3641 | "description": "Returns the user language", 3642 | "scope": "php" 3643 | }, 3644 | "$user->lock()": { 3645 | "prefix": "->lock()", 3646 | "body": "->lock()", 3647 | "description": "Returns the lock object for this model", 3648 | "scope": "php" 3649 | }, 3650 | "$user->login()": { 3651 | "prefix": "->login()", 3652 | "body": "->login(${1:\\$password}, ${2:\\$session = null})", 3653 | "description": "Logs the user in", 3654 | "scope": "php" 3655 | }, 3656 | "$user->loginPasswordless()": { 3657 | "prefix": "->loginPasswordless()", 3658 | "body": "->loginPasswordless(${1:\\$session = null})", 3659 | "description": "Logs the user in without checking the password", 3660 | "scope": "php" 3661 | }, 3662 | "$user->logout()": { 3663 | "prefix": "->logout()", 3664 | "body": "->logout(${1:\\$session = null})", 3665 | "description": "Logs the user out", 3666 | "scope": "php" 3667 | }, 3668 | "$user->modified()": { 3669 | "prefix": "->modified()", 3670 | "body": "->modified(${1:\\$format = 'U'}, ${2:\\$handler = null}, ${3:\\$languageCode = null})", 3671 | "description": "Returns the last modification date of the user", 3672 | "scope": "php" 3673 | }, 3674 | "$user->name()": { 3675 | "prefix": "->name()", 3676 | "body": "->name()", 3677 | "description": "Returns the user's name", 3678 | "scope": "php" 3679 | }, 3680 | "$user->nameOrEmail()": { 3681 | "prefix": "->nameOrEmail()", 3682 | "body": "->nameOrEmail()", 3683 | "description": "Returns the user's name or, if empty, the email address", 3684 | "scope": "php" 3685 | }, 3686 | "$user->next()": { 3687 | "prefix": "->next()", 3688 | "body": "->next(${1:\\$collection = null})", 3689 | "description": "Returns the next item in the collection if available", 3690 | "scope": "php" 3691 | }, 3692 | "$user->nextAll()": { 3693 | "prefix": "->nextAll()", 3694 | "body": "->nextAll(${1:\\$collection = null})", 3695 | "description": "Returns the end of the collection starting after the current item", 3696 | "scope": "php" 3697 | }, 3698 | "$user->panel()": { 3699 | "prefix": "->panel()", 3700 | "body": "->panel()", 3701 | "description": "Returns the panel info object", 3702 | "scope": "php" 3703 | }, 3704 | "$user->password()": { 3705 | "prefix": "->password()", 3706 | "body": "->password()", 3707 | "description": "Returns the encrypted user password", 3708 | "scope": "php" 3709 | }, 3710 | "$user->passwordTimestamp()": { 3711 | "prefix": "->passwordTimestamp()", 3712 | "body": "->passwordTimestamp()", 3713 | "description": "Returns the timestamp when the password was last changed", 3714 | "scope": "php" 3715 | }, 3716 | "$user->permissions()": { 3717 | "prefix": "->permissions()", 3718 | "body": "->permissions()", 3719 | "description": "", 3720 | "scope": "php" 3721 | }, 3722 | "$user->prev()": { 3723 | "prefix": "->prev()", 3724 | "body": "->prev(${1:\\$collection = null})", 3725 | "description": "Returns the previous item in the collection if available", 3726 | "scope": "php" 3727 | }, 3728 | "$user->prevAll()": { 3729 | "prefix": "->prevAll()", 3730 | "body": "->prevAll(${1:\\$collection = null})", 3731 | "description": "Returns the beginning of the collection before the current item", 3732 | "scope": "php" 3733 | }, 3734 | "$user->purge()": { 3735 | "prefix": "->purge()", 3736 | "body": "->purge()", 3737 | "description": "Clean internal caches", 3738 | "scope": "php" 3739 | }, 3740 | "$user->role()": { 3741 | "prefix": "->role()", 3742 | "body": "->role()", 3743 | "description": "Returns the user role", 3744 | "scope": "php" 3745 | }, 3746 | "$user->roles()": { 3747 | "prefix": "->roles()", 3748 | "body": "->roles()", 3749 | "description": "Returns all available roles for this user, that the authenticated user can change to.", 3750 | "scope": "php" 3751 | }, 3752 | "$user->root()": { 3753 | "prefix": "->root()", 3754 | "body": "->root()", 3755 | "description": "The absolute path to the user directory", 3756 | "scope": "php" 3757 | }, 3758 | "$user->secret()": { 3759 | "prefix": "->secret()", 3760 | "body": "->secret(${1:\\$key})", 3761 | "description": "Reads a specific secret from the user secrets file on disk", 3762 | "scope": "php" 3763 | }, 3764 | "$user->siblings()": { 3765 | "prefix": "->siblings()", 3766 | "body": "->siblings(${1:\\$self = true})", 3767 | "description": "Returns all sibling elements", 3768 | "scope": "php" 3769 | }, 3770 | "$user->site()": { 3771 | "prefix": "->site()", 3772 | "body": "->site()", 3773 | "description": "Returns the parent Site instance", 3774 | "scope": "php" 3775 | }, 3776 | "$user->toArray()": { 3777 | "prefix": "->toArray()", 3778 | "body": "->toArray()", 3779 | "description": "Converts the most important user properties to an array", 3780 | "scope": "php" 3781 | }, 3782 | "$user->toSafeString()": { 3783 | "prefix": "->toSafeString()", 3784 | "body": "->toSafeString(${1:\\$template = null}, ${2:\\$data = [ ]}, ${3:\\$fallback = ''})", 3785 | "description": "String template builder with automatic HTML escaping", 3786 | "scope": "php" 3787 | }, 3788 | "$user->toString()": { 3789 | "prefix": "->toString()", 3790 | "body": "->toString(${1:\\$template = null}, ${2:\\$data = [ ]}, ${3:\\$fallback = ''}, ${4:\\$handler = 'template'})", 3791 | "description": "String template builder", 3792 | "scope": "php" 3793 | }, 3794 | "$user->translation()": { 3795 | "prefix": "->translation()", 3796 | "body": "->translation(${1:\\$languageCode = null})", 3797 | "description": "Returns a single translation by language code If no code is specified the current translation is returned", 3798 | "scope": "php" 3799 | }, 3800 | "$user->translations()": { 3801 | "prefix": "->translations()", 3802 | "body": "->translations()", 3803 | "description": "Returns the translations collection", 3804 | "scope": "php" 3805 | }, 3806 | "$user->update()": { 3807 | "prefix": "->update()", 3808 | "body": "->update(${1:\\$input = null}, ${2:\\$languageCode = null}, ${3:\\$validate = false})", 3809 | "description": "Updates the user data", 3810 | "scope": "php" 3811 | }, 3812 | "$user->username()": { 3813 | "prefix": "->username()", 3814 | "body": "->username()", 3815 | "description": "Returns the username which is the given name or the email as a fallback", 3816 | "scope": "php" 3817 | }, 3818 | "$user->uuid()": { 3819 | "prefix": "->uuid()", 3820 | "body": "->uuid()", 3821 | "description": "Returns the user's Unique ID.", 3822 | "scope": "php" 3823 | }, 3824 | "$user->validatePassword()": { 3825 | "prefix": "->validatePassword()", 3826 | "body": "->validatePassword(${1:\\$password = null})", 3827 | "description": "Compares the given password with the stored one", 3828 | "scope": "php" 3829 | }, 3830 | "$user->videos()": { 3831 | "prefix": "->videos()", 3832 | "body": "->videos()", 3833 | "description": "Filters the Files collection by type videos", 3834 | "scope": "php" 3835 | }, 3836 | "$users->add()": { 3837 | "prefix": "->add()", 3838 | "body": "->add(${1:\\$object})", 3839 | "description": "Adds a single user or an entire second collection to the current collection", 3840 | "scope": "php" 3841 | }, 3842 | "$users->append()": { 3843 | "prefix": "->append()", 3844 | "body": "->append(${1:\\$args = null})", 3845 | "description": "Appends an element to the data array", 3846 | "scope": "php" 3847 | }, 3848 | "$users->chunk()": { 3849 | "prefix": "->chunk()", 3850 | "body": "->chunk(${1:\\$size})", 3851 | "description": "Creates chunks of the same size.", 3852 | "scope": "php" 3853 | }, 3854 | "$users->clone()": { 3855 | "prefix": "->clone()", 3856 | "body": "->clone()", 3857 | "description": "Returns a cloned instance of the collection", 3858 | "scope": "php" 3859 | }, 3860 | "$users->count()": { 3861 | "prefix": "->count()", 3862 | "body": "->count()", 3863 | "description": "Counts all elements", 3864 | "scope": "php" 3865 | }, 3866 | "$users->create()": { 3867 | "prefix": "->create()", 3868 | "body": "->create(${1:\\$data})", 3869 | "description": "", 3870 | "scope": "php" 3871 | }, 3872 | "$users->current()": { 3873 | "prefix": "->current()", 3874 | "body": "->current()", 3875 | "description": "Returns the current element", 3876 | "scope": "php" 3877 | }, 3878 | "$users->data()": { 3879 | "prefix": "->data()", 3880 | "body": "->data(${1:\\$data = null})", 3881 | "description": "Getter and setter for the data", 3882 | "scope": "php" 3883 | }, 3884 | "$users->empty()": { 3885 | "prefix": "->empty()", 3886 | "body": "->empty()", 3887 | "description": "Clone and remove all elements from the collection", 3888 | "scope": "php" 3889 | }, 3890 | "$users->extend()": { 3891 | "prefix": "->extend()", 3892 | "body": "->extend(${1:\\$items})", 3893 | "description": "Adds all elements to the collection", 3894 | "scope": "php" 3895 | }, 3896 | "$users->files()": { 3897 | "prefix": "->files()", 3898 | "body": "->files()", 3899 | "description": "Returns all files of all users", 3900 | "scope": "php" 3901 | }, 3902 | "$users->filter()": { 3903 | "prefix": "->filter()", 3904 | "body": "->filter(${1:\\$field}, ${2:\\$args = null})", 3905 | "description": "Filters elements by one of the predefined filter methods, by a custom filter function or an array of filters", 3906 | "scope": "php" 3907 | }, 3908 | "$users->filterBy()": { 3909 | "prefix": "->filterBy()", 3910 | "body": "->filterBy(${1:\\$args = null})", 3911 | "description": "Alias for `Kirby\\Toolkit\\Collection::filter`", 3912 | "scope": "php" 3913 | }, 3914 | "$users->find()": { 3915 | "prefix": "->find()", 3916 | "body": "->find(${1:\\$keys = null})", 3917 | "description": "Find one or multiple elements by id", 3918 | "scope": "php" 3919 | }, 3920 | "$users->findBy()": { 3921 | "prefix": "->findBy()", 3922 | "body": "->findBy(${1:\\$attribute}, ${2:\\$value})", 3923 | "description": "Find a single element by an attribute and its value", 3924 | "scope": "php" 3925 | }, 3926 | "$users->first()": { 3927 | "prefix": "->first()", 3928 | "body": "->first()", 3929 | "description": "Returns the first element", 3930 | "scope": "php" 3931 | }, 3932 | "$users->flip()": { 3933 | "prefix": "->flip()", 3934 | "body": "->flip()", 3935 | "description": "Returns the elements in reverse order", 3936 | "scope": "php" 3937 | }, 3938 | "$users->get()": { 3939 | "prefix": "->get()", 3940 | "body": "->get(${1:\\$key}, ${2:\\$default = null})", 3941 | "description": "Getter", 3942 | "scope": "php" 3943 | }, 3944 | "$users->getAttribute()": { 3945 | "prefix": "->getAttribute()", 3946 | "body": "->getAttribute(${1:\\$item}, ${2:\\$attribute}, ${3:\\$split = false}, ${4:\\$related = null})", 3947 | "description": "Extracts an attribute value from the given element in the collection. This is useful if elements in the collection might be objects, arrays or anything else and you need to get the value independently from that. We use it for `filter`.", 3948 | "scope": "php" 3949 | }, 3950 | "$users->getIterator()": { 3951 | "prefix": "->getIterator()", 3952 | "body": "->getIterator()", 3953 | "description": "Get an iterator for the items.", 3954 | "scope": "php" 3955 | }, 3956 | "$users->group()": { 3957 | "prefix": "->group()", 3958 | "body": "->group(${1:\\$field}, ${2:\\$caseInsensitive = true})", 3959 | "description": "Groups the items by a given field or callback. Returns a collection with an item for each group and a collection for each group.", 3960 | "scope": "php" 3961 | }, 3962 | "$users->groupBy()": { 3963 | "prefix": "->groupBy()", 3964 | "body": "->groupBy(${1:\\$args = null})", 3965 | "description": "Alias for `Kirby\\Toolkit\\Collection::group`", 3966 | "scope": "php" 3967 | }, 3968 | "$users->has()": { 3969 | "prefix": "->has()", 3970 | "body": "->has(${1:\\$key})", 3971 | "description": "Checks if the given object or id is in the collection", 3972 | "scope": "php" 3973 | }, 3974 | "$users->indexOf()": { 3975 | "prefix": "->indexOf()", 3976 | "body": "->indexOf(${1:\\$needle})", 3977 | "description": "Correct position detection for objects.", 3978 | "scope": "php" 3979 | }, 3980 | "$users->intersection()": { 3981 | "prefix": "->intersection()", 3982 | "body": "->intersection(${1:\\$other})", 3983 | "description": "Returns a Collection with the intersection of the given elements", 3984 | "scope": "php" 3985 | }, 3986 | "$users->intersects()": { 3987 | "prefix": "->intersects()", 3988 | "body": "->intersects(${1:\\$other})", 3989 | "description": "Checks if there is an intersection between the given collection and this collection", 3990 | "scope": "php" 3991 | }, 3992 | "$users->isEmpty()": { 3993 | "prefix": "->isEmpty()", 3994 | "body": "->isEmpty()", 3995 | "description": "Checks if the number of elements is zero", 3996 | "scope": "php" 3997 | }, 3998 | "$users->isEven()": { 3999 | "prefix": "->isEven()", 4000 | "body": "->isEven()", 4001 | "description": "Checks if the number of elements is even", 4002 | "scope": "php" 4003 | }, 4004 | "$users->isNotEmpty()": { 4005 | "prefix": "->isNotEmpty()", 4006 | "body": "->isNotEmpty()", 4007 | "description": "Checks if the number of elements is more than zero", 4008 | "scope": "php" 4009 | }, 4010 | "$users->isOdd()": { 4011 | "prefix": "->isOdd()", 4012 | "body": "->isOdd()", 4013 | "description": "Checks if the number of elements is odd", 4014 | "scope": "php" 4015 | }, 4016 | "$users->key()": { 4017 | "prefix": "->key()", 4018 | "body": "->key()", 4019 | "description": "Returns the current key", 4020 | "scope": "php" 4021 | }, 4022 | "$users->keyOf()": { 4023 | "prefix": "->keyOf()", 4024 | "body": "->keyOf(${1:\\$needle})", 4025 | "description": "Tries to find the key for the given element", 4026 | "scope": "php" 4027 | }, 4028 | "$users->keys()": { 4029 | "prefix": "->keys()", 4030 | "body": "->keys()", 4031 | "description": "Returns an array of all keys", 4032 | "scope": "php" 4033 | }, 4034 | "$users->last()": { 4035 | "prefix": "->last()", 4036 | "body": "->last()", 4037 | "description": "Returns the last element", 4038 | "scope": "php" 4039 | }, 4040 | "$users->limit()": { 4041 | "prefix": "->limit()", 4042 | "body": "->limit(${1:\\$limit})", 4043 | "description": "Returns a new object with a limited number of elements", 4044 | "scope": "php" 4045 | }, 4046 | "$users->map()": { 4047 | "prefix": "->map()", 4048 | "body": "->map(${1:\\$callback})", 4049 | "description": "Map a function to each element", 4050 | "scope": "php" 4051 | }, 4052 | "$users->next()": { 4053 | "prefix": "->next()", 4054 | "body": "->next()", 4055 | "description": "Moves the cursor to the next element and returns it", 4056 | "scope": "php" 4057 | }, 4058 | "$users->not()": { 4059 | "prefix": "->not()", 4060 | "body": "->not(${1:\\$keys = null})", 4061 | "description": "Returns a Collection without the given element(s)", 4062 | "scope": "php" 4063 | }, 4064 | "$users->nth()": { 4065 | "prefix": "->nth()", 4066 | "body": "->nth(${1:\\$n})", 4067 | "description": "Returns the nth element from the collection", 4068 | "scope": "php" 4069 | }, 4070 | "$users->offset()": { 4071 | "prefix": "->offset()", 4072 | "body": "->offset(${1:\\$offset})", 4073 | "description": "Returns a new object starting from the given offset", 4074 | "scope": "php" 4075 | }, 4076 | "$users->paginate()": { 4077 | "prefix": "->paginate()", 4078 | "body": "->paginate(${1:\\$arguments = null})", 4079 | "description": "Add pagination and return a sliced set of data.", 4080 | "scope": "php" 4081 | }, 4082 | "$users->pagination()": { 4083 | "prefix": "->pagination()", 4084 | "body": "->pagination()", 4085 | "description": "Get the pagination object", 4086 | "scope": "php" 4087 | }, 4088 | "$users->parent()": { 4089 | "prefix": "->parent()", 4090 | "body": "->parent()", 4091 | "description": "Returns the parent model", 4092 | "scope": "php" 4093 | }, 4094 | "$users->pluck()": { 4095 | "prefix": "->pluck()", 4096 | "body": "->pluck(${1:\\$field}, ${2:\\$split = null}, ${3:\\$unique = false})", 4097 | "description": "Extracts all values for a single field into a new array", 4098 | "scope": "php" 4099 | }, 4100 | "$users->prepend()": { 4101 | "prefix": "->prepend()", 4102 | "body": "->prepend(${1:\\$args = null})", 4103 | "description": "Prepends an element to the data array", 4104 | "scope": "php" 4105 | }, 4106 | "$users->prev()": { 4107 | "prefix": "->prev()", 4108 | "body": "->prev()", 4109 | "description": "Moves the cursor to the previous element and returns it", 4110 | "scope": "php" 4111 | }, 4112 | "$users->query()": { 4113 | "prefix": "->query()", 4114 | "body": "->query(${1:\\$arguments = [ ]})", 4115 | "description": "Runs a combination of filter, sort, not, offset, limit, search and paginate on the collection.", 4116 | "scope": "php" 4117 | }, 4118 | "$users->random()": { 4119 | "prefix": "->random()", 4120 | "body": "->random(${1:\\$count = 1}, ${2:\\$shuffle = false})", 4121 | "description": "Returns a new collection consisting of random elements, from the original collection, shuffled or ordered", 4122 | "scope": "php" 4123 | }, 4124 | "$users->remove()": { 4125 | "prefix": "->remove()", 4126 | "body": "->remove(${1:\\$key})", 4127 | "description": "Removes an object", 4128 | "scope": "php" 4129 | }, 4130 | "$users->rewind()": { 4131 | "prefix": "->rewind()", 4132 | "body": "->rewind()", 4133 | "description": "Moves the cursor to the first element", 4134 | "scope": "php" 4135 | }, 4136 | "$users->role()": { 4137 | "prefix": "->role()", 4138 | "body": "->role(${1:\\$role})", 4139 | "description": "Shortcut for `$users->filter('role', 'admin')`", 4140 | "scope": "php" 4141 | }, 4142 | "$users->search()": { 4143 | "prefix": "->search()", 4144 | "body": "->search(${1:\\$query = null}, ${2:\\$params = [ ]})", 4145 | "description": "Searches the collection", 4146 | "scope": "php" 4147 | }, 4148 | "$users->set()": { 4149 | "prefix": "->set()", 4150 | "body": "->set(${1:\\$key}, ${2:\\$value = null})", 4151 | "description": "Adds a new element to the collection", 4152 | "scope": "php" 4153 | }, 4154 | "$users->shuffle()": { 4155 | "prefix": "->shuffle()", 4156 | "body": "->shuffle()", 4157 | "description": "Shuffle all elements", 4158 | "scope": "php" 4159 | }, 4160 | "$users->slice()": { 4161 | "prefix": "->slice()", 4162 | "body": "->slice(${1:\\$offset = 0}, ${2:\\$limit = null})", 4163 | "description": "Returns a slice of the object", 4164 | "scope": "php" 4165 | }, 4166 | "$users->sort()": { 4167 | "prefix": "->sort()", 4168 | "body": "->sort()", 4169 | "description": "Sorts the elements by any number of fields", 4170 | "scope": "php" 4171 | }, 4172 | "$users->sortBy()": { 4173 | "prefix": "->sortBy()", 4174 | "body": "->sortBy(${1:\\$args = null})", 4175 | "description": "Alias for `Kirby\\Toolkit\\Collection::sort`", 4176 | "scope": "php" 4177 | }, 4178 | "$users->toArray()": { 4179 | "prefix": "->toArray()", 4180 | "body": "->toArray(${1:\\$map = null})", 4181 | "description": "Converts all objects in the collection to an array. This can also take a callback function to further modify the array result.", 4182 | "scope": "php" 4183 | }, 4184 | "$users->toJson()": { 4185 | "prefix": "->toJson()", 4186 | "body": "->toJson()", 4187 | "description": "Converts the object into a JSON string", 4188 | "scope": "php" 4189 | }, 4190 | "$users->toString()": { 4191 | "prefix": "->toString()", 4192 | "body": "->toString()", 4193 | "description": "Converts the object to a string", 4194 | "scope": "php" 4195 | }, 4196 | "$users->valid()": { 4197 | "prefix": "->valid()", 4198 | "body": "->valid()", 4199 | "description": "Checks if the current element is valid", 4200 | "scope": "php" 4201 | }, 4202 | "$users->values()": { 4203 | "prefix": "->values()", 4204 | "body": "->values(${1:\\$map = null})", 4205 | "description": "Returns a non-associative array with all values. If a mapping Closure is passed, all values are processed by the Closure.", 4206 | "scope": "php" 4207 | }, 4208 | "$users->when()": { 4209 | "prefix": "->when()", 4210 | "body": "->when(${1:\\$condition}, ${2:\\$callback}, ${3:\\$fallback = null})", 4211 | "description": "The when method only executes the given Closure when the first parameter is true. If the first parameter is false, the Closure will not be executed.", 4212 | "scope": "php" 4213 | }, 4214 | "$users->without()": { 4215 | "prefix": "->without()", 4216 | "body": "->without(${1:\\$keys = null})", 4217 | "description": "Alias for $this->not()", 4218 | "scope": "php" 4219 | }, 4220 | "$blocks->add()": { 4221 | "prefix": "->add()", 4222 | "body": "->add(${1:\\$object})", 4223 | "description": "Adds a single object or an entire second collection to the current collection", 4224 | "scope": "php" 4225 | }, 4226 | "$blocks->append()": { 4227 | "prefix": "->append()", 4228 | "body": "->append(${1:\\$args = null})", 4229 | "description": "Appends an element to the data array", 4230 | "scope": "php" 4231 | }, 4232 | "$blocks->chunk()": { 4233 | "prefix": "->chunk()", 4234 | "body": "->chunk(${1:\\$size})", 4235 | "description": "Creates chunks of the same size.", 4236 | "scope": "php" 4237 | }, 4238 | "$blocks->clone()": { 4239 | "prefix": "->clone()", 4240 | "body": "->clone()", 4241 | "description": "Returns a cloned instance of the collection", 4242 | "scope": "php" 4243 | }, 4244 | "$blocks->count()": { 4245 | "prefix": "->count()", 4246 | "body": "->count()", 4247 | "description": "Counts all elements", 4248 | "scope": "php" 4249 | }, 4250 | "$blocks->current()": { 4251 | "prefix": "->current()", 4252 | "body": "->current()", 4253 | "description": "Returns the current element", 4254 | "scope": "php" 4255 | }, 4256 | "$blocks->data()": { 4257 | "prefix": "->data()", 4258 | "body": "->data(${1:\\$data = null})", 4259 | "description": "Getter and setter for the data", 4260 | "scope": "php" 4261 | }, 4262 | "$blocks->empty()": { 4263 | "prefix": "->empty()", 4264 | "body": "->empty()", 4265 | "description": "Clone and remove all elements from the collection", 4266 | "scope": "php" 4267 | }, 4268 | "$blocks->excerpt()": { 4269 | "prefix": "->excerpt()", 4270 | "body": "->excerpt(${1:\\$args = null})", 4271 | "description": "Converts the blocks to HTML and then uses the Str::excerpt method to create a non-formatted, shortened excerpt from it", 4272 | "scope": "php" 4273 | }, 4274 | "$blocks->extend()": { 4275 | "prefix": "->extend()", 4276 | "body": "->extend(${1:\\$items})", 4277 | "description": "Adds all elements to the collection", 4278 | "scope": "php" 4279 | }, 4280 | "$blocks->field()": { 4281 | "prefix": "->field()", 4282 | "body": "->field()", 4283 | "description": "Returns the parent field if known", 4284 | "scope": "php" 4285 | }, 4286 | "$blocks->filter()": { 4287 | "prefix": "->filter()", 4288 | "body": "->filter(${1:\\$field}, ${2:\\$args = null})", 4289 | "description": "Filters elements by one of the predefined filter methods, by a custom filter function or an array of filters", 4290 | "scope": "php" 4291 | }, 4292 | "$blocks->filterBy()": { 4293 | "prefix": "->filterBy()", 4294 | "body": "->filterBy(${1:\\$args = null})", 4295 | "description": "Alias for `Kirby\\Toolkit\\Collection::filter`", 4296 | "scope": "php" 4297 | }, 4298 | "$blocks->find()": { 4299 | "prefix": "->find()", 4300 | "body": "->find(${1:\\$keys = null})", 4301 | "description": "Find one or multiple elements by id", 4302 | "scope": "php" 4303 | }, 4304 | "$blocks->findBy()": { 4305 | "prefix": "->findBy()", 4306 | "body": "->findBy(${1:\\$attribute}, ${2:\\$value})", 4307 | "description": "Find a single element by an attribute and its value", 4308 | "scope": "php" 4309 | }, 4310 | "$blocks->findByKey()": { 4311 | "prefix": "->findByKey()", 4312 | "body": "->findByKey(${1:\\$key})", 4313 | "description": "Find a single element by key (id)", 4314 | "scope": "php" 4315 | }, 4316 | "$blocks->first()": { 4317 | "prefix": "->first()", 4318 | "body": "->first()", 4319 | "description": "Returns the first element", 4320 | "scope": "php" 4321 | }, 4322 | "$blocks->flip()": { 4323 | "prefix": "->flip()", 4324 | "body": "->flip()", 4325 | "description": "Returns the elements in reverse order", 4326 | "scope": "php" 4327 | }, 4328 | "$blocks->get()": { 4329 | "prefix": "->get()", 4330 | "body": "->get(${1:\\$key}, ${2:\\$default = null})", 4331 | "description": "Getter", 4332 | "scope": "php" 4333 | }, 4334 | "$blocks->getAttribute()": { 4335 | "prefix": "->getAttribute()", 4336 | "body": "->getAttribute(${1:\\$item}, ${2:\\$attribute}, ${3:\\$split = false}, ${4:\\$related = null})", 4337 | "description": "Extracts an attribute value from the given element in the collection. This is useful if elements in the collection might be objects, arrays or anything else and you need to get the value independently from that. We use it for `filter`.", 4338 | "scope": "php" 4339 | }, 4340 | "$blocks->getIterator()": { 4341 | "prefix": "->getIterator()", 4342 | "body": "->getIterator()", 4343 | "description": "Get an iterator for the items.", 4344 | "scope": "php" 4345 | }, 4346 | "$blocks->group()": { 4347 | "prefix": "->group()", 4348 | "body": "->group(${1:\\$field}, ${2:\\$caseInsensitive = true})", 4349 | "description": "Groups the items by a given field or callback. Returns a collection with an item for each group and a collection for each group.", 4350 | "scope": "php" 4351 | }, 4352 | "$blocks->groupBy()": { 4353 | "prefix": "->groupBy()", 4354 | "body": "->groupBy(${1:\\$args = null})", 4355 | "description": "Alias for `Kirby\\Toolkit\\Collection::group`", 4356 | "scope": "php" 4357 | }, 4358 | "$blocks->has()": { 4359 | "prefix": "->has()", 4360 | "body": "->has(${1:\\$key})", 4361 | "description": "Checks if the given object or id is in the collection", 4362 | "scope": "php" 4363 | }, 4364 | "$blocks->hasType()": { 4365 | "prefix": "->hasType()", 4366 | "body": "->hasType(${1:\\$type})", 4367 | "description": "Checks if a given block type exists in the collection", 4368 | "scope": "php" 4369 | }, 4370 | "$blocks->indexOf()": { 4371 | "prefix": "->indexOf()", 4372 | "body": "->indexOf(${1:\\$needle})", 4373 | "description": "Correct position detection for objects.", 4374 | "scope": "php" 4375 | }, 4376 | "$blocks->intersection()": { 4377 | "prefix": "->intersection()", 4378 | "body": "->intersection(${1:\\$other})", 4379 | "description": "Returns a Collection with the intersection of the given elements", 4380 | "scope": "php" 4381 | }, 4382 | "$blocks->intersects()": { 4383 | "prefix": "->intersects()", 4384 | "body": "->intersects(${1:\\$other})", 4385 | "description": "Checks if there is an intersection between the given collection and this collection", 4386 | "scope": "php" 4387 | }, 4388 | "$blocks->isEmpty()": { 4389 | "prefix": "->isEmpty()", 4390 | "body": "->isEmpty()", 4391 | "description": "Checks if the number of elements is zero", 4392 | "scope": "php" 4393 | }, 4394 | "$blocks->isEven()": { 4395 | "prefix": "->isEven()", 4396 | "body": "->isEven()", 4397 | "description": "Checks if the number of elements is even", 4398 | "scope": "php" 4399 | }, 4400 | "$blocks->isNotEmpty()": { 4401 | "prefix": "->isNotEmpty()", 4402 | "body": "->isNotEmpty()", 4403 | "description": "Checks if the number of elements is more than zero", 4404 | "scope": "php" 4405 | }, 4406 | "$blocks->isOdd()": { 4407 | "prefix": "->isOdd()", 4408 | "body": "->isOdd()", 4409 | "description": "Checks if the number of elements is odd", 4410 | "scope": "php" 4411 | }, 4412 | "$blocks->key()": { 4413 | "prefix": "->key()", 4414 | "body": "->key()", 4415 | "description": "Returns the current key", 4416 | "scope": "php" 4417 | }, 4418 | "$blocks->keyOf()": { 4419 | "prefix": "->keyOf()", 4420 | "body": "->keyOf(${1:\\$needle})", 4421 | "description": "Tries to find the key for the given element", 4422 | "scope": "php" 4423 | }, 4424 | "$blocks->keys()": { 4425 | "prefix": "->keys()", 4426 | "body": "->keys()", 4427 | "description": "Returns an array of all keys", 4428 | "scope": "php" 4429 | }, 4430 | "$blocks->last()": { 4431 | "prefix": "->last()", 4432 | "body": "->last()", 4433 | "description": "Returns the last element", 4434 | "scope": "php" 4435 | }, 4436 | "$blocks->limit()": { 4437 | "prefix": "->limit()", 4438 | "body": "->limit(${1:\\$limit})", 4439 | "description": "Returns a new object with a limited number of elements", 4440 | "scope": "php" 4441 | }, 4442 | "$blocks->map()": { 4443 | "prefix": "->map()", 4444 | "body": "->map(${1:\\$callback})", 4445 | "description": "Map a function to each element", 4446 | "scope": "php" 4447 | }, 4448 | "$blocks->next()": { 4449 | "prefix": "->next()", 4450 | "body": "->next()", 4451 | "description": "Moves the cursor to the next element and returns it", 4452 | "scope": "php" 4453 | }, 4454 | "$blocks->not()": { 4455 | "prefix": "->not()", 4456 | "body": "->not(${1:\\$keys = null})", 4457 | "description": "Returns a Collection without the given element(s)", 4458 | "scope": "php" 4459 | }, 4460 | "$blocks->nth()": { 4461 | "prefix": "->nth()", 4462 | "body": "->nth(${1:\\$n})", 4463 | "description": "Returns the nth element from the collection", 4464 | "scope": "php" 4465 | }, 4466 | "$blocks->offset()": { 4467 | "prefix": "->offset()", 4468 | "body": "->offset(${1:\\$offset})", 4469 | "description": "Returns a new object starting from the given offset", 4470 | "scope": "php" 4471 | }, 4472 | "$blocks->paginate()": { 4473 | "prefix": "->paginate()", 4474 | "body": "->paginate(${1:\\$arguments = null})", 4475 | "description": "Add pagination and return a sliced set of data.", 4476 | "scope": "php" 4477 | }, 4478 | "$blocks->pagination()": { 4479 | "prefix": "->pagination()", 4480 | "body": "->pagination()", 4481 | "description": "Get the pagination object", 4482 | "scope": "php" 4483 | }, 4484 | "$blocks->parent()": { 4485 | "prefix": "->parent()", 4486 | "body": "->parent()", 4487 | "description": "Returns the parent model", 4488 | "scope": "php" 4489 | }, 4490 | "$blocks->pluck()": { 4491 | "prefix": "->pluck()", 4492 | "body": "->pluck(${1:\\$field}, ${2:\\$split = null}, ${3:\\$unique = false})", 4493 | "description": "Extracts all values for a single field into a new array", 4494 | "scope": "php" 4495 | }, 4496 | "$blocks->prepend()": { 4497 | "prefix": "->prepend()", 4498 | "body": "->prepend(${1:\\$args = null})", 4499 | "description": "Prepends an element to the data array", 4500 | "scope": "php" 4501 | }, 4502 | "$blocks->prev()": { 4503 | "prefix": "->prev()", 4504 | "body": "->prev()", 4505 | "description": "Moves the cursor to the previous element and returns it", 4506 | "scope": "php" 4507 | }, 4508 | "$blocks->query()": { 4509 | "prefix": "->query()", 4510 | "body": "->query(${1:\\$arguments = [ ]})", 4511 | "description": "Runs a combination of filter, sort, not, offset, limit, search and paginate on the collection.", 4512 | "scope": "php" 4513 | }, 4514 | "$blocks->random()": { 4515 | "prefix": "->random()", 4516 | "body": "->random(${1:\\$count = 1}, ${2:\\$shuffle = false})", 4517 | "description": "Returns a new collection consisting of random elements, from the original collection, shuffled or ordered", 4518 | "scope": "php" 4519 | }, 4520 | "$blocks->remove()": { 4521 | "prefix": "->remove()", 4522 | "body": "->remove(${1:\\$key})", 4523 | "description": "Removes an object", 4524 | "scope": "php" 4525 | }, 4526 | "$blocks->rewind()": { 4527 | "prefix": "->rewind()", 4528 | "body": "->rewind()", 4529 | "description": "Moves the cursor to the first element", 4530 | "scope": "php" 4531 | }, 4532 | "$blocks->search()": { 4533 | "prefix": "->search()", 4534 | "body": "->search(${1:\\$query = null}, ${2:\\$params = [ ]})", 4535 | "description": "Searches the collection", 4536 | "scope": "php" 4537 | }, 4538 | "$blocks->set()": { 4539 | "prefix": "->set()", 4540 | "body": "->set(${1:\\$key}, ${2:\\$value = null})", 4541 | "description": "Adds a new element to the collection", 4542 | "scope": "php" 4543 | }, 4544 | "$blocks->shuffle()": { 4545 | "prefix": "->shuffle()", 4546 | "body": "->shuffle()", 4547 | "description": "Shuffle all elements", 4548 | "scope": "php" 4549 | }, 4550 | "$blocks->slice()": { 4551 | "prefix": "->slice()", 4552 | "body": "->slice(${1:\\$offset = 0}, ${2:\\$limit = null})", 4553 | "description": "Returns a slice of the object", 4554 | "scope": "php" 4555 | }, 4556 | "$blocks->sort()": { 4557 | "prefix": "->sort()", 4558 | "body": "->sort()", 4559 | "description": "Sorts the elements by any number of fields", 4560 | "scope": "php" 4561 | }, 4562 | "$blocks->sortBy()": { 4563 | "prefix": "->sortBy()", 4564 | "body": "->sortBy(${1:\\$args = null})", 4565 | "description": "Alias for `Kirby\\Toolkit\\Collection::sort`", 4566 | "scope": "php" 4567 | }, 4568 | "$blocks->toArray()": { 4569 | "prefix": "->toArray()", 4570 | "body": "->toArray(${1:\\$map = null})", 4571 | "description": "Convert the items to an array", 4572 | "scope": "php" 4573 | }, 4574 | "$blocks->toHtml()": { 4575 | "prefix": "->toHtml()", 4576 | "body": "->toHtml()", 4577 | "description": "Convert all blocks to HTML", 4578 | "scope": "php" 4579 | }, 4580 | "$blocks->toJson()": { 4581 | "prefix": "->toJson()", 4582 | "body": "->toJson()", 4583 | "description": "Converts the object into a JSON string", 4584 | "scope": "php" 4585 | }, 4586 | "$blocks->toString()": { 4587 | "prefix": "->toString()", 4588 | "body": "->toString()", 4589 | "description": "Converts the object to a string", 4590 | "scope": "php" 4591 | }, 4592 | "$blocks->valid()": { 4593 | "prefix": "->valid()", 4594 | "body": "->valid()", 4595 | "description": "Checks if the current element is valid", 4596 | "scope": "php" 4597 | }, 4598 | "$blocks->values()": { 4599 | "prefix": "->values()", 4600 | "body": "->values(${1:\\$map = null})", 4601 | "description": "Returns a non-associative array with all values. If a mapping Closure is passed, all values are processed by the Closure.", 4602 | "scope": "php" 4603 | }, 4604 | "$blocks->when()": { 4605 | "prefix": "->when()", 4606 | "body": "->when(${1:\\$condition}, ${2:\\$callback}, ${3:\\$fallback = null})", 4607 | "description": "The when method only executes the given Closure when the first parameter is true. If the first parameter is false, the Closure will not be executed.", 4608 | "scope": "php" 4609 | }, 4610 | "$blocks->without()": { 4611 | "prefix": "->without()", 4612 | "body": "->without(${1:\\$keys = null})", 4613 | "description": "Alias for $this->not()", 4614 | "scope": "php" 4615 | }, 4616 | "$block->content()": { 4617 | "prefix": "->content()", 4618 | "body": "->content()", 4619 | "description": "Returns the content object", 4620 | "scope": "php" 4621 | }, 4622 | "$block->controller()": { 4623 | "prefix": "->controller()", 4624 | "body": "->controller()", 4625 | "description": "Controller for the block snippet", 4626 | "scope": "php" 4627 | }, 4628 | "$block->excerpt()": { 4629 | "prefix": "->excerpt()", 4630 | "body": "->excerpt(${1:\\$args = null})", 4631 | "description": "Converts the block to HTML and then uses the Str::excerpt method to create a non-formatted, shortened excerpt from it", 4632 | "scope": "php" 4633 | }, 4634 | "$block->field()": { 4635 | "prefix": "->field()", 4636 | "body": "->field()", 4637 | "description": "Returns the parent field if known", 4638 | "scope": "php" 4639 | }, 4640 | "$block->hasNext()": { 4641 | "prefix": "->hasNext()", 4642 | "body": "->hasNext(${1:\\$collection = null})", 4643 | "description": "Checks if there's a next item in the collection", 4644 | "scope": "php" 4645 | }, 4646 | "$block->hasPrev()": { 4647 | "prefix": "->hasPrev()", 4648 | "body": "->hasPrev(${1:\\$collection = null})", 4649 | "description": "Checks if there's a previous item in the collection", 4650 | "scope": "php" 4651 | }, 4652 | "$block->id()": { 4653 | "prefix": "->id()", 4654 | "body": "->id()", 4655 | "description": "Returns the unique item id (UUID v4)", 4656 | "scope": "php" 4657 | }, 4658 | "$block->indexOf()": { 4659 | "prefix": "->indexOf()", 4660 | "body": "->indexOf(${1:\\$collection = null})", 4661 | "description": "Returns the position / index in the collection", 4662 | "scope": "php" 4663 | }, 4664 | "$block->is()": { 4665 | "prefix": "->is()", 4666 | "body": "->is(${1:\\$item})", 4667 | "description": "Compares the item to another one", 4668 | "scope": "php" 4669 | }, 4670 | "$block->isEmpty()": { 4671 | "prefix": "->isEmpty()", 4672 | "body": "->isEmpty()", 4673 | "description": "Checks if the block is empty", 4674 | "scope": "php" 4675 | }, 4676 | "$block->isFirst()": { 4677 | "prefix": "->isFirst()", 4678 | "body": "->isFirst(${1:\\$collection = null})", 4679 | "description": "Checks if the item is the first in the collection", 4680 | "scope": "php" 4681 | }, 4682 | "$block->isHidden()": { 4683 | "prefix": "->isHidden()", 4684 | "body": "->isHidden()", 4685 | "description": "Checks if the block is hidden from being rendered in the frontend", 4686 | "scope": "php" 4687 | }, 4688 | "$block->isLast()": { 4689 | "prefix": "->isLast()", 4690 | "body": "->isLast(${1:\\$collection = null})", 4691 | "description": "Checks if the item is the last in the collection", 4692 | "scope": "php" 4693 | }, 4694 | "$block->isNotEmpty()": { 4695 | "prefix": "->isNotEmpty()", 4696 | "body": "->isNotEmpty()", 4697 | "description": "Checks if the block is not empty", 4698 | "scope": "php" 4699 | }, 4700 | "$block->isNth()": { 4701 | "prefix": "->isNth()", 4702 | "body": "->isNth(${1:\\$n}, ${2:\\$collection = null})", 4703 | "description": "Checks if the item is at a certain position", 4704 | "scope": "php" 4705 | }, 4706 | "$block->kirby()": { 4707 | "prefix": "->kirby()", 4708 | "body": "->kirby()", 4709 | "description": "Returns the Kirby instance", 4710 | "scope": "php" 4711 | }, 4712 | "$block->next()": { 4713 | "prefix": "->next()", 4714 | "body": "->next(${1:\\$collection = null})", 4715 | "description": "Returns the next item in the collection if available", 4716 | "scope": "php" 4717 | }, 4718 | "$block->nextAll()": { 4719 | "prefix": "->nextAll()", 4720 | "body": "->nextAll(${1:\\$collection = null})", 4721 | "description": "Returns the end of the collection starting after the current item", 4722 | "scope": "php" 4723 | }, 4724 | "$block->parent()": { 4725 | "prefix": "->parent()", 4726 | "body": "->parent()", 4727 | "description": "Returns the parent model", 4728 | "scope": "php" 4729 | }, 4730 | "$block->prev()": { 4731 | "prefix": "->prev()", 4732 | "body": "->prev(${1:\\$collection = null})", 4733 | "description": "Returns the previous item in the collection if available", 4734 | "scope": "php" 4735 | }, 4736 | "$block->prevAll()": { 4737 | "prefix": "->prevAll()", 4738 | "body": "->prevAll(${1:\\$collection = null})", 4739 | "description": "Returns the beginning of the collection before the current item", 4740 | "scope": "php" 4741 | }, 4742 | "$block->siblings()": { 4743 | "prefix": "->siblings()", 4744 | "body": "->siblings(${1:\\$self = true})", 4745 | "description": "Returns all sibling elements", 4746 | "scope": "php" 4747 | }, 4748 | "$block->toArray()": { 4749 | "prefix": "->toArray()", 4750 | "body": "->toArray()", 4751 | "description": "The result is being sent to the editor via the API in the panel", 4752 | "scope": "php" 4753 | }, 4754 | "$block->toField()": { 4755 | "prefix": "->toField()", 4756 | "body": "->toField()", 4757 | "description": "Converts the block to html first and then places that inside a field object. This can be used further with all available field methods", 4758 | "scope": "php" 4759 | }, 4760 | "$block->toHtml()": { 4761 | "prefix": "->toHtml()", 4762 | "body": "->toHtml()", 4763 | "description": "Converts the block to HTML", 4764 | "scope": "php" 4765 | }, 4766 | "$block->type()": { 4767 | "prefix": "->type()", 4768 | "body": "->type()", 4769 | "description": "Returns the block type", 4770 | "scope": "php" 4771 | }, 4772 | "$layouts->add()": { 4773 | "prefix": "->add()", 4774 | "body": "->add(${1:\\$object})", 4775 | "description": "Adds a single object or an entire second collection to the current collection", 4776 | "scope": "php" 4777 | }, 4778 | "$layouts->append()": { 4779 | "prefix": "->append()", 4780 | "body": "->append(${1:\\$args = null})", 4781 | "description": "Appends an element to the data array", 4782 | "scope": "php" 4783 | }, 4784 | "$layouts->chunk()": { 4785 | "prefix": "->chunk()", 4786 | "body": "->chunk(${1:\\$size})", 4787 | "description": "Creates chunks of the same size.", 4788 | "scope": "php" 4789 | }, 4790 | "$layouts->clone()": { 4791 | "prefix": "->clone()", 4792 | "body": "->clone()", 4793 | "description": "Returns a cloned instance of the collection", 4794 | "scope": "php" 4795 | }, 4796 | "$layouts->count()": { 4797 | "prefix": "->count()", 4798 | "body": "->count()", 4799 | "description": "Counts all elements", 4800 | "scope": "php" 4801 | }, 4802 | "$layouts->current()": { 4803 | "prefix": "->current()", 4804 | "body": "->current()", 4805 | "description": "Returns the current element", 4806 | "scope": "php" 4807 | }, 4808 | "$layouts->data()": { 4809 | "prefix": "->data()", 4810 | "body": "->data(${1:\\$data = null})", 4811 | "description": "Getter and setter for the data", 4812 | "scope": "php" 4813 | }, 4814 | "$layouts->empty()": { 4815 | "prefix": "->empty()", 4816 | "body": "->empty()", 4817 | "description": "Clone and remove all elements from the collection", 4818 | "scope": "php" 4819 | }, 4820 | "$layouts->extend()": { 4821 | "prefix": "->extend()", 4822 | "body": "->extend(${1:\\$items})", 4823 | "description": "Adds all elements to the collection", 4824 | "scope": "php" 4825 | }, 4826 | "$layouts->field()": { 4827 | "prefix": "->field()", 4828 | "body": "->field()", 4829 | "description": "Returns the parent field if known", 4830 | "scope": "php" 4831 | }, 4832 | "$layouts->filter()": { 4833 | "prefix": "->filter()", 4834 | "body": "->filter(${1:\\$field}, ${2:\\$args = null})", 4835 | "description": "Filters elements by one of the predefined filter methods, by a custom filter function or an array of filters", 4836 | "scope": "php" 4837 | }, 4838 | "$layouts->filterBy()": { 4839 | "prefix": "->filterBy()", 4840 | "body": "->filterBy(${1:\\$args = null})", 4841 | "description": "Alias for `Kirby\\Toolkit\\Collection::filter`", 4842 | "scope": "php" 4843 | }, 4844 | "$layouts->find()": { 4845 | "prefix": "->find()", 4846 | "body": "->find(${1:\\$keys = null})", 4847 | "description": "Find one or multiple elements by id", 4848 | "scope": "php" 4849 | }, 4850 | "$layouts->findBy()": { 4851 | "prefix": "->findBy()", 4852 | "body": "->findBy(${1:\\$attribute}, ${2:\\$value})", 4853 | "description": "Find a single element by an attribute and its value", 4854 | "scope": "php" 4855 | }, 4856 | "$layouts->findByKey()": { 4857 | "prefix": "->findByKey()", 4858 | "body": "->findByKey(${1:\\$key})", 4859 | "description": "Find a single element by key (id)", 4860 | "scope": "php" 4861 | }, 4862 | "$layouts->first()": { 4863 | "prefix": "->first()", 4864 | "body": "->first()", 4865 | "description": "Returns the first element", 4866 | "scope": "php" 4867 | }, 4868 | "$layouts->flip()": { 4869 | "prefix": "->flip()", 4870 | "body": "->flip()", 4871 | "description": "Returns the elements in reverse order", 4872 | "scope": "php" 4873 | }, 4874 | "$layouts->get()": { 4875 | "prefix": "->get()", 4876 | "body": "->get(${1:\\$key}, ${2:\\$default = null})", 4877 | "description": "Getter", 4878 | "scope": "php" 4879 | }, 4880 | "$layouts->getAttribute()": { 4881 | "prefix": "->getAttribute()", 4882 | "body": "->getAttribute(${1:\\$item}, ${2:\\$attribute}, ${3:\\$split = false}, ${4:\\$related = null})", 4883 | "description": "Extracts an attribute value from the given element in the collection. This is useful if elements in the collection might be objects, arrays or anything else and you need to get the value independently from that. We use it for `filter`.", 4884 | "scope": "php" 4885 | }, 4886 | "$layouts->getIterator()": { 4887 | "prefix": "->getIterator()", 4888 | "body": "->getIterator()", 4889 | "description": "Get an iterator for the items.", 4890 | "scope": "php" 4891 | }, 4892 | "$layouts->group()": { 4893 | "prefix": "->group()", 4894 | "body": "->group(${1:\\$field}, ${2:\\$caseInsensitive = true})", 4895 | "description": "Groups the items by a given field or callback. Returns a collection with an item for each group and a collection for each group.", 4896 | "scope": "php" 4897 | }, 4898 | "$layouts->groupBy()": { 4899 | "prefix": "->groupBy()", 4900 | "body": "->groupBy(${1:\\$args = null})", 4901 | "description": "Alias for `Kirby\\Toolkit\\Collection::group`", 4902 | "scope": "php" 4903 | }, 4904 | "$layouts->has()": { 4905 | "prefix": "->has()", 4906 | "body": "->has(${1:\\$key})", 4907 | "description": "Checks if the given object or id is in the collection", 4908 | "scope": "php" 4909 | }, 4910 | "$layouts->hasBlockType()": { 4911 | "prefix": "->hasBlockType()", 4912 | "body": "->hasBlockType(${1:\\$type})", 4913 | "description": "Checks if a given block type exists in the layouts collection", 4914 | "scope": "php" 4915 | }, 4916 | "$layouts->indexOf()": { 4917 | "prefix": "->indexOf()", 4918 | "body": "->indexOf(${1:\\$needle})", 4919 | "description": "Correct position detection for objects.", 4920 | "scope": "php" 4921 | }, 4922 | "$layouts->intersection()": { 4923 | "prefix": "->intersection()", 4924 | "body": "->intersection(${1:\\$other})", 4925 | "description": "Returns a Collection with the intersection of the given elements", 4926 | "scope": "php" 4927 | }, 4928 | "$layouts->intersects()": { 4929 | "prefix": "->intersects()", 4930 | "body": "->intersects(${1:\\$other})", 4931 | "description": "Checks if there is an intersection between the given collection and this collection", 4932 | "scope": "php" 4933 | }, 4934 | "$layouts->isEmpty()": { 4935 | "prefix": "->isEmpty()", 4936 | "body": "->isEmpty()", 4937 | "description": "Checks if the number of elements is zero", 4938 | "scope": "php" 4939 | }, 4940 | "$layouts->isEven()": { 4941 | "prefix": "->isEven()", 4942 | "body": "->isEven()", 4943 | "description": "Checks if the number of elements is even", 4944 | "scope": "php" 4945 | }, 4946 | "$layouts->isNotEmpty()": { 4947 | "prefix": "->isNotEmpty()", 4948 | "body": "->isNotEmpty()", 4949 | "description": "Checks if the number of elements is more than zero", 4950 | "scope": "php" 4951 | }, 4952 | "$layouts->isOdd()": { 4953 | "prefix": "->isOdd()", 4954 | "body": "->isOdd()", 4955 | "description": "Checks if the number of elements is odd", 4956 | "scope": "php" 4957 | }, 4958 | "$layouts->key()": { 4959 | "prefix": "->key()", 4960 | "body": "->key()", 4961 | "description": "Returns the current key", 4962 | "scope": "php" 4963 | }, 4964 | "$layouts->keyOf()": { 4965 | "prefix": "->keyOf()", 4966 | "body": "->keyOf(${1:\\$needle})", 4967 | "description": "Tries to find the key for the given element", 4968 | "scope": "php" 4969 | }, 4970 | "$layouts->keys()": { 4971 | "prefix": "->keys()", 4972 | "body": "->keys()", 4973 | "description": "Returns an array of all keys", 4974 | "scope": "php" 4975 | }, 4976 | "$layouts->last()": { 4977 | "prefix": "->last()", 4978 | "body": "->last()", 4979 | "description": "Returns the last element", 4980 | "scope": "php" 4981 | }, 4982 | "$layouts->limit()": { 4983 | "prefix": "->limit()", 4984 | "body": "->limit(${1:\\$limit})", 4985 | "description": "Returns a new object with a limited number of elements", 4986 | "scope": "php" 4987 | }, 4988 | "$layouts->map()": { 4989 | "prefix": "->map()", 4990 | "body": "->map(${1:\\$callback})", 4991 | "description": "Map a function to each element", 4992 | "scope": "php" 4993 | }, 4994 | "$layouts->next()": { 4995 | "prefix": "->next()", 4996 | "body": "->next()", 4997 | "description": "Moves the cursor to the next element and returns it", 4998 | "scope": "php" 4999 | }, 5000 | "$layouts->not()": { 5001 | "prefix": "->not()", 5002 | "body": "->not(${1:\\$keys = null})", 5003 | "description": "Returns a Collection without the given element(s)", 5004 | "scope": "php" 5005 | }, 5006 | "$layouts->nth()": { 5007 | "prefix": "->nth()", 5008 | "body": "->nth(${1:\\$n})", 5009 | "description": "Returns the nth element from the collection", 5010 | "scope": "php" 5011 | }, 5012 | "$layouts->offset()": { 5013 | "prefix": "->offset()", 5014 | "body": "->offset(${1:\\$offset})", 5015 | "description": "Returns a new object starting from the given offset", 5016 | "scope": "php" 5017 | }, 5018 | "$layouts->paginate()": { 5019 | "prefix": "->paginate()", 5020 | "body": "->paginate(${1:\\$arguments = null})", 5021 | "description": "Add pagination and return a sliced set of data.", 5022 | "scope": "php" 5023 | }, 5024 | "$layouts->pagination()": { 5025 | "prefix": "->pagination()", 5026 | "body": "->pagination()", 5027 | "description": "Get the pagination object", 5028 | "scope": "php" 5029 | }, 5030 | "$layouts->parent()": { 5031 | "prefix": "->parent()", 5032 | "body": "->parent()", 5033 | "description": "Returns the parent model", 5034 | "scope": "php" 5035 | }, 5036 | "$layouts->pluck()": { 5037 | "prefix": "->pluck()", 5038 | "body": "->pluck(${1:\\$field}, ${2:\\$split = null}, ${3:\\$unique = false})", 5039 | "description": "Extracts all values for a single field into a new array", 5040 | "scope": "php" 5041 | }, 5042 | "$layouts->prepend()": { 5043 | "prefix": "->prepend()", 5044 | "body": "->prepend(${1:\\$args = null})", 5045 | "description": "Prepends an element to the data array", 5046 | "scope": "php" 5047 | }, 5048 | "$layouts->prev()": { 5049 | "prefix": "->prev()", 5050 | "body": "->prev()", 5051 | "description": "Moves the cursor to the previous element and returns it", 5052 | "scope": "php" 5053 | }, 5054 | "$layouts->query()": { 5055 | "prefix": "->query()", 5056 | "body": "->query(${1:\\$arguments = [ ]})", 5057 | "description": "Runs a combination of filter, sort, not, offset, limit, search and paginate on the collection.", 5058 | "scope": "php" 5059 | }, 5060 | "$layouts->random()": { 5061 | "prefix": "->random()", 5062 | "body": "->random(${1:\\$count = 1}, ${2:\\$shuffle = false})", 5063 | "description": "Returns a new collection consisting of random elements, from the original collection, shuffled or ordered", 5064 | "scope": "php" 5065 | }, 5066 | "$layouts->remove()": { 5067 | "prefix": "->remove()", 5068 | "body": "->remove(${1:\\$key})", 5069 | "description": "Removes an object", 5070 | "scope": "php" 5071 | }, 5072 | "$layouts->rewind()": { 5073 | "prefix": "->rewind()", 5074 | "body": "->rewind()", 5075 | "description": "Moves the cursor to the first element", 5076 | "scope": "php" 5077 | }, 5078 | "$layouts->search()": { 5079 | "prefix": "->search()", 5080 | "body": "->search(${1:\\$query = null}, ${2:\\$params = [ ]})", 5081 | "description": "Searches the collection", 5082 | "scope": "php" 5083 | }, 5084 | "$layouts->set()": { 5085 | "prefix": "->set()", 5086 | "body": "->set(${1:\\$key}, ${2:\\$value = null})", 5087 | "description": "Adds a new element to the collection", 5088 | "scope": "php" 5089 | }, 5090 | "$layouts->shuffle()": { 5091 | "prefix": "->shuffle()", 5092 | "body": "->shuffle()", 5093 | "description": "Shuffle all elements", 5094 | "scope": "php" 5095 | }, 5096 | "$layouts->slice()": { 5097 | "prefix": "->slice()", 5098 | "body": "->slice(${1:\\$offset = 0}, ${2:\\$limit = null})", 5099 | "description": "Returns a slice of the object", 5100 | "scope": "php" 5101 | }, 5102 | "$layouts->sort()": { 5103 | "prefix": "->sort()", 5104 | "body": "->sort()", 5105 | "description": "Sorts the elements by any number of fields", 5106 | "scope": "php" 5107 | }, 5108 | "$layouts->sortBy()": { 5109 | "prefix": "->sortBy()", 5110 | "body": "->sortBy(${1:\\$args = null})", 5111 | "description": "Alias for `Kirby\\Toolkit\\Collection::sort`", 5112 | "scope": "php" 5113 | }, 5114 | "$layouts->toArray()": { 5115 | "prefix": "->toArray()", 5116 | "body": "->toArray(${1:\\$map = null})", 5117 | "description": "Convert the items to an array", 5118 | "scope": "php" 5119 | }, 5120 | "$layouts->toBlocks()": { 5121 | "prefix": "->toBlocks()", 5122 | "body": "->toBlocks(${1:\\$includeHidden = false})", 5123 | "description": "Converts layouts to blocks", 5124 | "scope": "php" 5125 | }, 5126 | "$layouts->toJson()": { 5127 | "prefix": "->toJson()", 5128 | "body": "->toJson()", 5129 | "description": "Converts the object into a JSON string", 5130 | "scope": "php" 5131 | }, 5132 | "$layouts->toString()": { 5133 | "prefix": "->toString()", 5134 | "body": "->toString()", 5135 | "description": "Converts the object to a string", 5136 | "scope": "php" 5137 | }, 5138 | "$layouts->valid()": { 5139 | "prefix": "->valid()", 5140 | "body": "->valid()", 5141 | "description": "Checks if the current element is valid", 5142 | "scope": "php" 5143 | }, 5144 | "$layouts->values()": { 5145 | "prefix": "->values()", 5146 | "body": "->values(${1:\\$map = null})", 5147 | "description": "Returns a non-associative array with all values. If a mapping Closure is passed, all values are processed by the Closure.", 5148 | "scope": "php" 5149 | }, 5150 | "$layouts->when()": { 5151 | "prefix": "->when()", 5152 | "body": "->when(${1:\\$condition}, ${2:\\$callback}, ${3:\\$fallback = null})", 5153 | "description": "The when method only executes the given Closure when the first parameter is true. If the first parameter is false, the Closure will not be executed.", 5154 | "scope": "php" 5155 | }, 5156 | "$layouts->without()": { 5157 | "prefix": "->without()", 5158 | "body": "->without(${1:\\$keys = null})", 5159 | "description": "Alias for $this->not()", 5160 | "scope": "php" 5161 | }, 5162 | "$layout->attrs()": { 5163 | "prefix": "->attrs()", 5164 | "body": "->attrs()", 5165 | "description": "Returns the attrs object", 5166 | "scope": "php" 5167 | }, 5168 | "$layout->columns()": { 5169 | "prefix": "->columns()", 5170 | "body": "->columns()", 5171 | "description": "Returns the columns in this layout", 5172 | "scope": "php" 5173 | }, 5174 | "$layout->field()": { 5175 | "prefix": "->field()", 5176 | "body": "->field()", 5177 | "description": "Returns the parent field if known", 5178 | "scope": "php" 5179 | }, 5180 | "$layout->hasNext()": { 5181 | "prefix": "->hasNext()", 5182 | "body": "->hasNext(${1:\\$collection = null})", 5183 | "description": "Checks if there's a next item in the collection", 5184 | "scope": "php" 5185 | }, 5186 | "$layout->hasPrev()": { 5187 | "prefix": "->hasPrev()", 5188 | "body": "->hasPrev(${1:\\$collection = null})", 5189 | "description": "Checks if there's a previous item in the collection", 5190 | "scope": "php" 5191 | }, 5192 | "$layout->id()": { 5193 | "prefix": "->id()", 5194 | "body": "->id()", 5195 | "description": "Returns the unique item id (UUID v4)", 5196 | "scope": "php" 5197 | }, 5198 | "$layout->indexOf()": { 5199 | "prefix": "->indexOf()", 5200 | "body": "->indexOf(${1:\\$collection = null})", 5201 | "description": "Returns the position / index in the collection", 5202 | "scope": "php" 5203 | }, 5204 | "$layout->is()": { 5205 | "prefix": "->is()", 5206 | "body": "->is(${1:\\$item})", 5207 | "description": "Compares the item to another one", 5208 | "scope": "php" 5209 | }, 5210 | "$layout->isEmpty()": { 5211 | "prefix": "->isEmpty()", 5212 | "body": "->isEmpty()", 5213 | "description": "Checks if the layout is empty", 5214 | "scope": "php" 5215 | }, 5216 | "$layout->isFirst()": { 5217 | "prefix": "->isFirst()", 5218 | "body": "->isFirst(${1:\\$collection = null})", 5219 | "description": "Checks if the item is the first in the collection", 5220 | "scope": "php" 5221 | }, 5222 | "$layout->isLast()": { 5223 | "prefix": "->isLast()", 5224 | "body": "->isLast(${1:\\$collection = null})", 5225 | "description": "Checks if the item is the last in the collection", 5226 | "scope": "php" 5227 | }, 5228 | "$layout->isNotEmpty()": { 5229 | "prefix": "->isNotEmpty()", 5230 | "body": "->isNotEmpty()", 5231 | "description": "Checks if the layout is not empty", 5232 | "scope": "php" 5233 | }, 5234 | "$layout->isNth()": { 5235 | "prefix": "->isNth()", 5236 | "body": "->isNth(${1:\\$n}, ${2:\\$collection = null})", 5237 | "description": "Checks if the item is at a certain position", 5238 | "scope": "php" 5239 | }, 5240 | "$layout->kirby()": { 5241 | "prefix": "->kirby()", 5242 | "body": "->kirby()", 5243 | "description": "Returns the Kirby instance", 5244 | "scope": "php" 5245 | }, 5246 | "$layout->next()": { 5247 | "prefix": "->next()", 5248 | "body": "->next(${1:\\$collection = null})", 5249 | "description": "Returns the next item in the collection if available", 5250 | "scope": "php" 5251 | }, 5252 | "$layout->nextAll()": { 5253 | "prefix": "->nextAll()", 5254 | "body": "->nextAll(${1:\\$collection = null})", 5255 | "description": "Returns the end of the collection starting after the current item", 5256 | "scope": "php" 5257 | }, 5258 | "$layout->parent()": { 5259 | "prefix": "->parent()", 5260 | "body": "->parent()", 5261 | "description": "Returns the parent model", 5262 | "scope": "php" 5263 | }, 5264 | "$layout->prev()": { 5265 | "prefix": "->prev()", 5266 | "body": "->prev(${1:\\$collection = null})", 5267 | "description": "Returns the previous item in the collection if available", 5268 | "scope": "php" 5269 | }, 5270 | "$layout->prevAll()": { 5271 | "prefix": "->prevAll()", 5272 | "body": "->prevAll(${1:\\$collection = null})", 5273 | "description": "Returns the beginning of the collection before the current item", 5274 | "scope": "php" 5275 | }, 5276 | "$layout->siblings()": { 5277 | "prefix": "->siblings()", 5278 | "body": "->siblings(${1:\\$self = true})", 5279 | "description": "Returns all sibling elements", 5280 | "scope": "php" 5281 | }, 5282 | "$layout->toArray()": { 5283 | "prefix": "->toArray()", 5284 | "body": "->toArray()", 5285 | "description": "The result is being sent to the editor via the API in the panel", 5286 | "scope": "php" 5287 | }, 5288 | "$language->baseUrl()": { 5289 | "prefix": "->baseUrl()", 5290 | "body": "->baseUrl()", 5291 | "description": "Returns the base Url for the language without the path or other cruft", 5292 | "scope": "php" 5293 | }, 5294 | "$language->clone()": { 5295 | "prefix": "->clone()", 5296 | "body": "->clone(${1:\\$props = [ ]})", 5297 | "description": "Creates an instance with the same initial properties.", 5298 | "scope": "php" 5299 | }, 5300 | "$language->code()": { 5301 | "prefix": "->code()", 5302 | "body": "->code()", 5303 | "description": "Returns the language code/id.", 5304 | "scope": "php" 5305 | }, 5306 | "$language->direction()": { 5307 | "prefix": "->direction()", 5308 | "body": "->direction()", 5309 | "description": "Reading direction of this language", 5310 | "scope": "php" 5311 | }, 5312 | "$language->exists()": { 5313 | "prefix": "->exists()", 5314 | "body": "->exists()", 5315 | "description": "Check if the language file exists", 5316 | "scope": "php" 5317 | }, 5318 | "$language->hasNext()": { 5319 | "prefix": "->hasNext()", 5320 | "body": "->hasNext(${1:\\$collection = null})", 5321 | "description": "Checks if there's a next item in the collection", 5322 | "scope": "php" 5323 | }, 5324 | "$language->hasPrev()": { 5325 | "prefix": "->hasPrev()", 5326 | "body": "->hasPrev(${1:\\$collection = null})", 5327 | "description": "Checks if there's a previous item in the collection", 5328 | "scope": "php" 5329 | }, 5330 | "$language->id()": { 5331 | "prefix": "->id()", 5332 | "body": "->id()", 5333 | "description": "The id is required for collections to work properly. The code is used as id", 5334 | "scope": "php" 5335 | }, 5336 | "$language->indexOf()": { 5337 | "prefix": "->indexOf()", 5338 | "body": "->indexOf(${1:\\$collection = null})", 5339 | "description": "Returns the position / index in the collection", 5340 | "scope": "php" 5341 | }, 5342 | "$language->isDefault()": { 5343 | "prefix": "->isDefault()", 5344 | "body": "->isDefault()", 5345 | "description": "Checks if this is the default language for the site.", 5346 | "scope": "php" 5347 | }, 5348 | "$language->isDeletable()": { 5349 | "prefix": "->isDeletable()", 5350 | "body": "->isDeletable()", 5351 | "description": "Checks if the language can be deleted", 5352 | "scope": "php" 5353 | }, 5354 | "$language->isFirst()": { 5355 | "prefix": "->isFirst()", 5356 | "body": "->isFirst(${1:\\$collection = null})", 5357 | "description": "Checks if the item is the first in the collection", 5358 | "scope": "php" 5359 | }, 5360 | "$language->isLast()": { 5361 | "prefix": "->isLast()", 5362 | "body": "->isLast()", 5363 | "description": "Checks if this is the last language", 5364 | "scope": "php" 5365 | }, 5366 | "$language->isNth()": { 5367 | "prefix": "->isNth()", 5368 | "body": "->isNth(${1:\\$n}, ${2:\\$collection = null})", 5369 | "description": "Checks if the item is at a certain position", 5370 | "scope": "php" 5371 | }, 5372 | "$language->kirby()": { 5373 | "prefix": "->kirby()", 5374 | "body": "->kirby()", 5375 | "description": "Returns the parent Kirby instance", 5376 | "scope": "php" 5377 | }, 5378 | "$language->locale()": { 5379 | "prefix": "->locale()", 5380 | "body": "->locale(${1:\\$category = null})", 5381 | "description": "Returns the PHP locale setting array", 5382 | "scope": "php" 5383 | }, 5384 | "$language->name()": { 5385 | "prefix": "->name()", 5386 | "body": "->name()", 5387 | "description": "Returns the human-readable name of the language", 5388 | "scope": "php" 5389 | }, 5390 | "$language->next()": { 5391 | "prefix": "->next()", 5392 | "body": "->next(${1:\\$collection = null})", 5393 | "description": "Returns the next item in the collection if available", 5394 | "scope": "php" 5395 | }, 5396 | "$language->nextAll()": { 5397 | "prefix": "->nextAll()", 5398 | "body": "->nextAll(${1:\\$collection = null})", 5399 | "description": "Returns the end of the collection starting after the current item", 5400 | "scope": "php" 5401 | }, 5402 | "$language->path()": { 5403 | "prefix": "->path()", 5404 | "body": "->path()", 5405 | "description": "Returns the URL path for the language", 5406 | "scope": "php" 5407 | }, 5408 | "$language->pattern()": { 5409 | "prefix": "->pattern()", 5410 | "body": "->pattern()", 5411 | "description": "Returns the routing pattern for the language", 5412 | "scope": "php" 5413 | }, 5414 | "$language->prev()": { 5415 | "prefix": "->prev()", 5416 | "body": "->prev(${1:\\$collection = null})", 5417 | "description": "Returns the previous item in the collection if available", 5418 | "scope": "php" 5419 | }, 5420 | "$language->prevAll()": { 5421 | "prefix": "->prevAll()", 5422 | "body": "->prevAll(${1:\\$collection = null})", 5423 | "description": "Returns the beginning of the collection before the current item", 5424 | "scope": "php" 5425 | }, 5426 | "$language->root()": { 5427 | "prefix": "->root()", 5428 | "body": "->root()", 5429 | "description": "Returns the absolute path to the language file", 5430 | "scope": "php" 5431 | }, 5432 | "$language->router()": { 5433 | "prefix": "->router()", 5434 | "body": "->router()", 5435 | "description": "Returns the LanguageRouter instance which is used to handle language specific routes.", 5436 | "scope": "php" 5437 | }, 5438 | "$language->siblings()": { 5439 | "prefix": "->siblings()", 5440 | "body": "->siblings(${1:\\$self = true})", 5441 | "description": "Returns all sibling elements", 5442 | "scope": "php" 5443 | }, 5444 | "$language->slugs()": { 5445 | "prefix": "->slugs()", 5446 | "body": "->slugs()", 5447 | "description": "Returns the custom slug rules for this language", 5448 | "scope": "php" 5449 | }, 5450 | "$language->smartypants()": { 5451 | "prefix": "->smartypants()", 5452 | "body": "->smartypants()", 5453 | "description": "Returns the custom SmartyPants options for this language", 5454 | "scope": "php" 5455 | }, 5456 | "$language->toArray()": { 5457 | "prefix": "->toArray()", 5458 | "body": "->toArray()", 5459 | "description": "Returns the most important properties as array", 5460 | "scope": "php" 5461 | }, 5462 | "$language->translations()": { 5463 | "prefix": "->translations()", 5464 | "body": "->translations()", 5465 | "description": "Returns the translation strings for this language", 5466 | "scope": "php" 5467 | }, 5468 | "$language->url()": { 5469 | "prefix": "->url()", 5470 | "body": "->url()", 5471 | "description": "Returns the absolute Url for the language", 5472 | "scope": "php" 5473 | }, 5474 | "$language->variable()": { 5475 | "prefix": "->variable()", 5476 | "body": "->variable(${1:\\$key}, ${2:\\$decode = false})", 5477 | "description": "Returns a language variable object for the key in the translations array", 5478 | "scope": "php" 5479 | }, 5480 | "$languages->add()": { 5481 | "prefix": "->add()", 5482 | "body": "->add(${1:\\$object})", 5483 | "description": "Adds a single object or an entire second collection to the current collection", 5484 | "scope": "php" 5485 | }, 5486 | "$languages->append()": { 5487 | "prefix": "->append()", 5488 | "body": "->append(${1:\\$args = null})", 5489 | "description": "Appends an element to the data array", 5490 | "scope": "php" 5491 | }, 5492 | "$languages->chunk()": { 5493 | "prefix": "->chunk()", 5494 | "body": "->chunk(${1:\\$size})", 5495 | "description": "Creates chunks of the same size.", 5496 | "scope": "php" 5497 | }, 5498 | "$languages->clone()": { 5499 | "prefix": "->clone()", 5500 | "body": "->clone()", 5501 | "description": "Returns a cloned instance of the collection", 5502 | "scope": "php" 5503 | }, 5504 | "$languages->codes()": { 5505 | "prefix": "->codes()", 5506 | "body": "->codes()", 5507 | "description": "Returns all language codes as array", 5508 | "scope": "php" 5509 | }, 5510 | "$languages->count()": { 5511 | "prefix": "->count()", 5512 | "body": "->count()", 5513 | "description": "Counts all elements", 5514 | "scope": "php" 5515 | }, 5516 | "$languages->current()": { 5517 | "prefix": "->current()", 5518 | "body": "->current()", 5519 | "description": "Returns the current element", 5520 | "scope": "php" 5521 | }, 5522 | "$languages->data()": { 5523 | "prefix": "->data()", 5524 | "body": "->data(${1:\\$data = null})", 5525 | "description": "Getter and setter for the data", 5526 | "scope": "php" 5527 | }, 5528 | "$languages->default()": { 5529 | "prefix": "->default()", 5530 | "body": "->default()", 5531 | "description": "Returns the default language", 5532 | "scope": "php" 5533 | }, 5534 | "$languages->empty()": { 5535 | "prefix": "->empty()", 5536 | "body": "->empty()", 5537 | "description": "Clone and remove all elements from the collection", 5538 | "scope": "php" 5539 | }, 5540 | "$languages->extend()": { 5541 | "prefix": "->extend()", 5542 | "body": "->extend(${1:\\$items})", 5543 | "description": "Adds all elements to the collection", 5544 | "scope": "php" 5545 | }, 5546 | "$languages->filter()": { 5547 | "prefix": "->filter()", 5548 | "body": "->filter(${1:\\$field}, ${2:\\$args = null})", 5549 | "description": "Filters elements by one of the predefined filter methods, by a custom filter function or an array of filters", 5550 | "scope": "php" 5551 | }, 5552 | "$languages->filterBy()": { 5553 | "prefix": "->filterBy()", 5554 | "body": "->filterBy(${1:\\$args = null})", 5555 | "description": "Alias for `Kirby\\Toolkit\\Collection::filter`", 5556 | "scope": "php" 5557 | }, 5558 | "$languages->find()": { 5559 | "prefix": "->find()", 5560 | "body": "->find(${1:\\$keys = null})", 5561 | "description": "Find one or multiple elements by id", 5562 | "scope": "php" 5563 | }, 5564 | "$languages->findBy()": { 5565 | "prefix": "->findBy()", 5566 | "body": "->findBy(${1:\\$attribute}, ${2:\\$value})", 5567 | "description": "Find a single element by an attribute and its value", 5568 | "scope": "php" 5569 | }, 5570 | "$languages->findByKey()": { 5571 | "prefix": "->findByKey()", 5572 | "body": "->findByKey(${1:\\$key})", 5573 | "description": "Find a single element by key (id)", 5574 | "scope": "php" 5575 | }, 5576 | "$languages->first()": { 5577 | "prefix": "->first()", 5578 | "body": "->first()", 5579 | "description": "Returns the first element", 5580 | "scope": "php" 5581 | }, 5582 | "$languages->flip()": { 5583 | "prefix": "->flip()", 5584 | "body": "->flip()", 5585 | "description": "Returns the elements in reverse order", 5586 | "scope": "php" 5587 | }, 5588 | "$languages->get()": { 5589 | "prefix": "->get()", 5590 | "body": "->get(${1:\\$key}, ${2:\\$default = null})", 5591 | "description": "Getter", 5592 | "scope": "php" 5593 | }, 5594 | "$languages->getAttribute()": { 5595 | "prefix": "->getAttribute()", 5596 | "body": "->getAttribute(${1:\\$item}, ${2:\\$attribute}, ${3:\\$split = false}, ${4:\\$related = null})", 5597 | "description": "Extracts an attribute value from the given element in the collection. This is useful if elements in the collection might be objects, arrays or anything else and you need to get the value independently from that. We use it for `filter`.", 5598 | "scope": "php" 5599 | }, 5600 | "$languages->getIterator()": { 5601 | "prefix": "->getIterator()", 5602 | "body": "->getIterator()", 5603 | "description": "Get an iterator for the items.", 5604 | "scope": "php" 5605 | }, 5606 | "$languages->group()": { 5607 | "prefix": "->group()", 5608 | "body": "->group(${1:\\$field}, ${2:\\$caseInsensitive = true})", 5609 | "description": "Groups the items by a given field or callback. Returns a collection with an item for each group and a collection for each group.", 5610 | "scope": "php" 5611 | }, 5612 | "$languages->groupBy()": { 5613 | "prefix": "->groupBy()", 5614 | "body": "->groupBy(${1:\\$args = null})", 5615 | "description": "Alias for `Kirby\\Toolkit\\Collection::group`", 5616 | "scope": "php" 5617 | }, 5618 | "$languages->has()": { 5619 | "prefix": "->has()", 5620 | "body": "->has(${1:\\$key})", 5621 | "description": "Checks if the given object or id is in the collection", 5622 | "scope": "php" 5623 | }, 5624 | "$languages->indexOf()": { 5625 | "prefix": "->indexOf()", 5626 | "body": "->indexOf(${1:\\$needle})", 5627 | "description": "Correct position detection for objects.", 5628 | "scope": "php" 5629 | }, 5630 | "$languages->intersection()": { 5631 | "prefix": "->intersection()", 5632 | "body": "->intersection(${1:\\$other})", 5633 | "description": "Returns a Collection with the intersection of the given elements", 5634 | "scope": "php" 5635 | }, 5636 | "$languages->intersects()": { 5637 | "prefix": "->intersects()", 5638 | "body": "->intersects(${1:\\$other})", 5639 | "description": "Checks if there is an intersection between the given collection and this collection", 5640 | "scope": "php" 5641 | }, 5642 | "$languages->isEmpty()": { 5643 | "prefix": "->isEmpty()", 5644 | "body": "->isEmpty()", 5645 | "description": "Checks if the number of elements is zero", 5646 | "scope": "php" 5647 | }, 5648 | "$languages->isEven()": { 5649 | "prefix": "->isEven()", 5650 | "body": "->isEven()", 5651 | "description": "Checks if the number of elements is even", 5652 | "scope": "php" 5653 | }, 5654 | "$languages->isNotEmpty()": { 5655 | "prefix": "->isNotEmpty()", 5656 | "body": "->isNotEmpty()", 5657 | "description": "Checks if the number of elements is more than zero", 5658 | "scope": "php" 5659 | }, 5660 | "$languages->isOdd()": { 5661 | "prefix": "->isOdd()", 5662 | "body": "->isOdd()", 5663 | "description": "Checks if the number of elements is odd", 5664 | "scope": "php" 5665 | }, 5666 | "$languages->key()": { 5667 | "prefix": "->key()", 5668 | "body": "->key()", 5669 | "description": "Returns the current key", 5670 | "scope": "php" 5671 | }, 5672 | "$languages->keyOf()": { 5673 | "prefix": "->keyOf()", 5674 | "body": "->keyOf(${1:\\$needle})", 5675 | "description": "Tries to find the key for the given element", 5676 | "scope": "php" 5677 | }, 5678 | "$languages->keys()": { 5679 | "prefix": "->keys()", 5680 | "body": "->keys()", 5681 | "description": "Returns an array of all keys", 5682 | "scope": "php" 5683 | }, 5684 | "$languages->last()": { 5685 | "prefix": "->last()", 5686 | "body": "->last()", 5687 | "description": "Returns the last element", 5688 | "scope": "php" 5689 | }, 5690 | "$languages->limit()": { 5691 | "prefix": "->limit()", 5692 | "body": "->limit(${1:\\$limit})", 5693 | "description": "Returns a new object with a limited number of elements", 5694 | "scope": "php" 5695 | }, 5696 | "$languages->map()": { 5697 | "prefix": "->map()", 5698 | "body": "->map(${1:\\$callback})", 5699 | "description": "Map a function to each element", 5700 | "scope": "php" 5701 | }, 5702 | "$languages->next()": { 5703 | "prefix": "->next()", 5704 | "body": "->next()", 5705 | "description": "Moves the cursor to the next element and returns it", 5706 | "scope": "php" 5707 | }, 5708 | "$languages->not()": { 5709 | "prefix": "->not()", 5710 | "body": "->not(${1:\\$keys = null})", 5711 | "description": "Returns a Collection without the given element(s)", 5712 | "scope": "php" 5713 | }, 5714 | "$languages->nth()": { 5715 | "prefix": "->nth()", 5716 | "body": "->nth(${1:\\$n})", 5717 | "description": "Returns the nth element from the collection", 5718 | "scope": "php" 5719 | }, 5720 | "$languages->offset()": { 5721 | "prefix": "->offset()", 5722 | "body": "->offset(${1:\\$offset})", 5723 | "description": "Returns a new object starting from the given offset", 5724 | "scope": "php" 5725 | }, 5726 | "$languages->paginate()": { 5727 | "prefix": "->paginate()", 5728 | "body": "->paginate(${1:\\$arguments = null})", 5729 | "description": "Add pagination and return a sliced set of data.", 5730 | "scope": "php" 5731 | }, 5732 | "$languages->pagination()": { 5733 | "prefix": "->pagination()", 5734 | "body": "->pagination()", 5735 | "description": "Get the pagination object", 5736 | "scope": "php" 5737 | }, 5738 | "$languages->parent()": { 5739 | "prefix": "->parent()", 5740 | "body": "->parent()", 5741 | "description": "Returns the parent model", 5742 | "scope": "php" 5743 | }, 5744 | "$languages->pluck()": { 5745 | "prefix": "->pluck()", 5746 | "body": "->pluck(${1:\\$field}, ${2:\\$split = null}, ${3:\\$unique = false})", 5747 | "description": "Extracts all values for a single field into a new array", 5748 | "scope": "php" 5749 | }, 5750 | "$languages->prepend()": { 5751 | "prefix": "->prepend()", 5752 | "body": "->prepend(${1:\\$args = null})", 5753 | "description": "Prepends an element to the data array", 5754 | "scope": "php" 5755 | }, 5756 | "$languages->prev()": { 5757 | "prefix": "->prev()", 5758 | "body": "->prev()", 5759 | "description": "Moves the cursor to the previous element and returns it", 5760 | "scope": "php" 5761 | }, 5762 | "$languages->query()": { 5763 | "prefix": "->query()", 5764 | "body": "->query(${1:\\$arguments = [ ]})", 5765 | "description": "Runs a combination of filter, sort, not, offset, limit, search and paginate on the collection.", 5766 | "scope": "php" 5767 | }, 5768 | "$languages->random()": { 5769 | "prefix": "->random()", 5770 | "body": "->random(${1:\\$count = 1}, ${2:\\$shuffle = false})", 5771 | "description": "Returns a new collection consisting of random elements, from the original collection, shuffled or ordered", 5772 | "scope": "php" 5773 | }, 5774 | "$languages->remove()": { 5775 | "prefix": "->remove()", 5776 | "body": "->remove(${1:\\$key})", 5777 | "description": "Removes an object", 5778 | "scope": "php" 5779 | }, 5780 | "$languages->rewind()": { 5781 | "prefix": "->rewind()", 5782 | "body": "->rewind()", 5783 | "description": "Moves the cursor to the first element", 5784 | "scope": "php" 5785 | }, 5786 | "$languages->search()": { 5787 | "prefix": "->search()", 5788 | "body": "->search(${1:\\$query = null}, ${2:\\$params = [ ]})", 5789 | "description": "Searches the collection", 5790 | "scope": "php" 5791 | }, 5792 | "$languages->set()": { 5793 | "prefix": "->set()", 5794 | "body": "->set(${1:\\$key}, ${2:\\$value = null})", 5795 | "description": "Adds a new element to the collection", 5796 | "scope": "php" 5797 | }, 5798 | "$languages->shuffle()": { 5799 | "prefix": "->shuffle()", 5800 | "body": "->shuffle()", 5801 | "description": "Shuffle all elements", 5802 | "scope": "php" 5803 | }, 5804 | "$languages->slice()": { 5805 | "prefix": "->slice()", 5806 | "body": "->slice(${1:\\$offset = 0}, ${2:\\$limit = null})", 5807 | "description": "Returns a slice of the object", 5808 | "scope": "php" 5809 | }, 5810 | "$languages->sort()": { 5811 | "prefix": "->sort()", 5812 | "body": "->sort()", 5813 | "description": "Sorts the elements by any number of fields", 5814 | "scope": "php" 5815 | }, 5816 | "$languages->sortBy()": { 5817 | "prefix": "->sortBy()", 5818 | "body": "->sortBy(${1:\\$args = null})", 5819 | "description": "Alias for `Kirby\\Toolkit\\Collection::sort`", 5820 | "scope": "php" 5821 | }, 5822 | "$languages->toArray()": { 5823 | "prefix": "->toArray()", 5824 | "body": "->toArray(${1:\\$map = null})", 5825 | "description": "Converts all objects in the collection to an array. This can also take a callback function to further modify the array result.", 5826 | "scope": "php" 5827 | }, 5828 | "$languages->toJson()": { 5829 | "prefix": "->toJson()", 5830 | "body": "->toJson()", 5831 | "description": "Converts the object into a JSON string", 5832 | "scope": "php" 5833 | }, 5834 | "$languages->toString()": { 5835 | "prefix": "->toString()", 5836 | "body": "->toString()", 5837 | "description": "Converts the object to a string", 5838 | "scope": "php" 5839 | }, 5840 | "$languages->valid()": { 5841 | "prefix": "->valid()", 5842 | "body": "->valid()", 5843 | "description": "Checks if the current element is valid", 5844 | "scope": "php" 5845 | }, 5846 | "$languages->values()": { 5847 | "prefix": "->values()", 5848 | "body": "->values(${1:\\$map = null})", 5849 | "description": "Returns a non-associative array with all values. If a mapping Closure is passed, all values are processed by the Closure.", 5850 | "scope": "php" 5851 | }, 5852 | "$languages->when()": { 5853 | "prefix": "->when()", 5854 | "body": "->when(${1:\\$condition}, ${2:\\$callback}, ${3:\\$fallback = null})", 5855 | "description": "The when method only executes the given Closure when the first parameter is true. If the first parameter is false, the Closure will not be executed.", 5856 | "scope": "php" 5857 | }, 5858 | "$languages->without()": { 5859 | "prefix": "->without()", 5860 | "body": "->without(${1:\\$keys = null})", 5861 | "description": "Alias for $this->not()", 5862 | "scope": "php" 5863 | }, 5864 | "$pagination->clone()": { 5865 | "prefix": "->clone()", 5866 | "body": "->clone(${1:\\$props = [ ]})", 5867 | "description": "Creates a new instance while merging initial and new properties", 5868 | "scope": "php" 5869 | }, 5870 | "$pagination->end()": { 5871 | "prefix": "->end()", 5872 | "body": "->end()", 5873 | "description": "Returns the index of the last item on the page", 5874 | "scope": "php" 5875 | }, 5876 | "$pagination->firstPage()": { 5877 | "prefix": "->firstPage()", 5878 | "body": "->firstPage()", 5879 | "description": "Returns the first page", 5880 | "scope": "php" 5881 | }, 5882 | "$pagination->firstPageUrl()": { 5883 | "prefix": "->firstPageUrl()", 5884 | "body": "->firstPageUrl()", 5885 | "description": "Returns the Url for the first page", 5886 | "scope": "php" 5887 | }, 5888 | "$pagination->hasNextPage()": { 5889 | "prefix": "->hasNextPage()", 5890 | "body": "->hasNextPage()", 5891 | "description": "Checks if there's a next page", 5892 | "scope": "php" 5893 | }, 5894 | "$pagination->hasPage()": { 5895 | "prefix": "->hasPage()", 5896 | "body": "->hasPage(${1:\\$page})", 5897 | "description": "Checks if the given page exists", 5898 | "scope": "php" 5899 | }, 5900 | "$pagination->hasPages()": { 5901 | "prefix": "->hasPages()", 5902 | "body": "->hasPages()", 5903 | "description": "Checks if there are any pages at all", 5904 | "scope": "php" 5905 | }, 5906 | "$pagination->hasPrevPage()": { 5907 | "prefix": "->hasPrevPage()", 5908 | "body": "->hasPrevPage()", 5909 | "description": "Checks if there's a previous page", 5910 | "scope": "php" 5911 | }, 5912 | "$pagination->isFirstPage()": { 5913 | "prefix": "->isFirstPage()", 5914 | "body": "->isFirstPage()", 5915 | "description": "Checks if the current page is the first page", 5916 | "scope": "php" 5917 | }, 5918 | "$pagination->isLastPage()": { 5919 | "prefix": "->isLastPage()", 5920 | "body": "->isLastPage()", 5921 | "description": "Checks if the current page is the last page", 5922 | "scope": "php" 5923 | }, 5924 | "$pagination->lastPage()": { 5925 | "prefix": "->lastPage()", 5926 | "body": "->lastPage()", 5927 | "description": "Returns the last page", 5928 | "scope": "php" 5929 | }, 5930 | "$pagination->lastPageUrl()": { 5931 | "prefix": "->lastPageUrl()", 5932 | "body": "->lastPageUrl()", 5933 | "description": "Returns the Url for the last page", 5934 | "scope": "php" 5935 | }, 5936 | "$pagination->limit()": { 5937 | "prefix": "->limit()", 5938 | "body": "->limit()", 5939 | "description": "Getter for the number of items per page", 5940 | "scope": "php" 5941 | }, 5942 | "$pagination->nextPage()": { 5943 | "prefix": "->nextPage()", 5944 | "body": "->nextPage()", 5945 | "description": "Returns the next page", 5946 | "scope": "php" 5947 | }, 5948 | "$pagination->nextPageUrl()": { 5949 | "prefix": "->nextPageUrl()", 5950 | "body": "->nextPageUrl()", 5951 | "description": "Returns the Url for the next page.", 5952 | "scope": "php" 5953 | }, 5954 | "$pagination->offset()": { 5955 | "prefix": "->offset()", 5956 | "body": "->offset()", 5957 | "description": "Returns the offset (i.e. for db queries)", 5958 | "scope": "php" 5959 | }, 5960 | "$pagination->page()": { 5961 | "prefix": "->page()", 5962 | "body": "->page()", 5963 | "description": "Getter for the current page", 5964 | "scope": "php" 5965 | }, 5966 | "$pagination->pageUrl()": { 5967 | "prefix": "->pageUrl()", 5968 | "body": "->pageUrl(${1:\\$page = null})", 5969 | "description": "Returns the URL of the current page.", 5970 | "scope": "php" 5971 | }, 5972 | "$pagination->pages()": { 5973 | "prefix": "->pages()", 5974 | "body": "->pages()", 5975 | "description": "Returns the total number of pages", 5976 | "scope": "php" 5977 | }, 5978 | "$pagination->prevPage()": { 5979 | "prefix": "->prevPage()", 5980 | "body": "->prevPage()", 5981 | "description": "Returns the previous page", 5982 | "scope": "php" 5983 | }, 5984 | "$pagination->prevPageUrl()": { 5985 | "prefix": "->prevPageUrl()", 5986 | "body": "->prevPageUrl()", 5987 | "description": "Returns the Url for the previous page.", 5988 | "scope": "php" 5989 | }, 5990 | "$pagination->range()": { 5991 | "prefix": "->range()", 5992 | "body": "->range(${1:\\$range = 5})", 5993 | "description": "Creates a range of page numbers for Google-like pagination", 5994 | "scope": "php" 5995 | }, 5996 | "$pagination->rangeEnd()": { 5997 | "prefix": "->rangeEnd()", 5998 | "body": "->rangeEnd(${1:\\$range = 5})", 5999 | "description": "Returns the last page of the created range", 6000 | "scope": "php" 6001 | }, 6002 | "$pagination->rangeStart()": { 6003 | "prefix": "->rangeStart()", 6004 | "body": "->rangeStart(${1:\\$range = 5})", 6005 | "description": "Returns the first page of the created range", 6006 | "scope": "php" 6007 | }, 6008 | "$pagination->start()": { 6009 | "prefix": "->start()", 6010 | "body": "->start()", 6011 | "description": "Returns the index of the first item on the page", 6012 | "scope": "php" 6013 | }, 6014 | "$pagination->toArray()": { 6015 | "prefix": "->toArray()", 6016 | "body": "->toArray()", 6017 | "description": "Returns an array with all properties", 6018 | "scope": "php" 6019 | }, 6020 | "$pagination->total()": { 6021 | "prefix": "->total()", 6022 | "body": "->total()", 6023 | "description": "Getter for the total number of items", 6024 | "scope": "php" 6025 | }, 6026 | "$request->auth()": { 6027 | "prefix": "->auth()", 6028 | "body": "->auth()", 6029 | "description": "Returns the Auth object if authentication is set", 6030 | "scope": "php" 6031 | }, 6032 | "$request->body()": { 6033 | "prefix": "->body()", 6034 | "body": "->body()", 6035 | "description": "Returns the Body object", 6036 | "scope": "php" 6037 | }, 6038 | "$request->cli()": { 6039 | "prefix": "->cli()", 6040 | "body": "->cli()", 6041 | "description": "Checks if the request has been made from the command line", 6042 | "scope": "php" 6043 | }, 6044 | "$request->csrf()": { 6045 | "prefix": "->csrf()", 6046 | "body": "->csrf()", 6047 | "description": "Returns a CSRF token if stored in a header or the query", 6048 | "scope": "php" 6049 | }, 6050 | "$request->data()": { 6051 | "prefix": "->data()", 6052 | "body": "->data()", 6053 | "description": "Returns the request input as array", 6054 | "scope": "php" 6055 | }, 6056 | "$request->detectRequestMethod()": { 6057 | "prefix": "->detectRequestMethod()", 6058 | "body": "->detectRequestMethod(${1:\\$method = null})", 6059 | "description": "Detect the request method from various options: given method, query string, server vars", 6060 | "scope": "php" 6061 | }, 6062 | "$request->domain()": { 6063 | "prefix": "->domain()", 6064 | "body": "->domain()", 6065 | "description": "Returns the domain", 6066 | "scope": "php" 6067 | }, 6068 | "$request->file()": { 6069 | "prefix": "->file()", 6070 | "body": "->file(${1:\\$key})", 6071 | "description": "Fetches a single file array from the Files object by key", 6072 | "scope": "php" 6073 | }, 6074 | "$request->files()": { 6075 | "prefix": "->files()", 6076 | "body": "->files()", 6077 | "description": "Returns the Files object", 6078 | "scope": "php" 6079 | }, 6080 | "$request->get()": { 6081 | "prefix": "->get()", 6082 | "body": "->get(${1:\\$key = null}, ${2:\\$fallback = null})", 6083 | "description": "Returns any data field from the request if it exists", 6084 | "scope": "php" 6085 | }, 6086 | "$request->hasAuth()": { 6087 | "prefix": "->hasAuth()", 6088 | "body": "->hasAuth()", 6089 | "description": "Returns whether the request contains the `Authorization` header", 6090 | "scope": "php" 6091 | }, 6092 | "$request->header()": { 6093 | "prefix": "->header()", 6094 | "body": "->header(${1:\\$key}, ${2:\\$fallback = null})", 6095 | "description": "Returns a header by key if it exists", 6096 | "scope": "php" 6097 | }, 6098 | "$request->headers()": { 6099 | "prefix": "->headers()", 6100 | "body": "->headers()", 6101 | "description": "Return all headers with polyfill for missing getallheaders function", 6102 | "scope": "php" 6103 | }, 6104 | "$request->is()": { 6105 | "prefix": "->is()", 6106 | "body": "->is(${1:\\$method})", 6107 | "description": "Checks if the given method name matches the name of the request method.", 6108 | "scope": "php" 6109 | }, 6110 | "$request->method()": { 6111 | "prefix": "->method()", 6112 | "body": "->method()", 6113 | "description": "Returns the request method", 6114 | "scope": "php" 6115 | }, 6116 | "$request->params()": { 6117 | "prefix": "->params()", 6118 | "body": "->params()", 6119 | "description": "Shortcut to the Params object", 6120 | "scope": "php" 6121 | }, 6122 | "$request->path()": { 6123 | "prefix": "->path()", 6124 | "body": "->path()", 6125 | "description": "Shortcut to the Path object", 6126 | "scope": "php" 6127 | }, 6128 | "$request->query()": { 6129 | "prefix": "->query()", 6130 | "body": "->query()", 6131 | "description": "Returns the Query object", 6132 | "scope": "php" 6133 | }, 6134 | "$request->ssl()": { 6135 | "prefix": "->ssl()", 6136 | "body": "->ssl()", 6137 | "description": "Checks for a valid SSL connection", 6138 | "scope": "php" 6139 | }, 6140 | "$request->url()": { 6141 | "prefix": "->url()", 6142 | "body": "->url(${1:\\$props = null})", 6143 | "description": "Returns the current Uri object.", 6144 | "scope": "php" 6145 | }, 6146 | "$session->clear()": { 6147 | "prefix": "->clear()", 6148 | "body": "->clear()", 6149 | "description": "Clears all session data", 6150 | "scope": "php" 6151 | }, 6152 | "$session->decrement()": { 6153 | "prefix": "->decrement()", 6154 | "body": "->decrement(${1:\\$key}, ${2:\\$by = 1}, ${3:\\$min = null})", 6155 | "description": "Decrements one or multiple session values by a specified amount", 6156 | "scope": "php" 6157 | }, 6158 | "$session->get()": { 6159 | "prefix": "->get()", 6160 | "body": "->get(${1:\\$key = null}, ${2:\\$default = null})", 6161 | "description": "Returns one or all session values by key", 6162 | "scope": "php" 6163 | }, 6164 | "$session->increment()": { 6165 | "prefix": "->increment()", 6166 | "body": "->increment(${1:\\$key}, ${2:\\$by = 1}, ${3:\\$max = null})", 6167 | "description": "Increments one or multiple session values by a specified amount", 6168 | "scope": "php" 6169 | }, 6170 | "$session->pull()": { 6171 | "prefix": "->pull()", 6172 | "body": "->pull(${1:\\$key}, ${2:\\$default = null})", 6173 | "description": "Retrieves a value and removes it afterwards", 6174 | "scope": "php" 6175 | }, 6176 | "$session->reload()": { 6177 | "prefix": "->reload()", 6178 | "body": "->reload(${1:\\$data})", 6179 | "description": "Reloads the data array with the current session data Only used internally", 6180 | "scope": "php" 6181 | }, 6182 | "$session->remove()": { 6183 | "prefix": "->remove()", 6184 | "body": "->remove(${1:\\$key})", 6185 | "description": "Removes one or multiple session values by key", 6186 | "scope": "php" 6187 | }, 6188 | "$session->set()": { 6189 | "prefix": "->set()", 6190 | "body": "->set(${1:\\$key}, ${2:\\$value = null})", 6191 | "description": "Sets one or multiple session values by key", 6192 | "scope": "php" 6193 | } 6194 | } 6195 | --------------------------------------------------------------------------------