Documentation

Application extends AbstractModel
in package

Application model class

Tags
category

Pop\Kettle

author

Nick Sagona, III nick@popphp.org

copyright

Copyright (c) 2009-2026 Nick Sagona, III

license

https://www.popphp.org/license New BSD License

version
3.0.0

Table of Contents

Properties

$data  : mixed
Array data

Methods

__construct()  : mixed
Constructor
__get()  : mixed
Get a value
__isset()  : bool
Is value set
__serialize()  : mixed
Serialize magic method
__set()  : void
Magic method to set the property to the value of $this->data[$name]
__unserialize()  : void
Unserialize magic method
__unset()  : void
Unset a value
contains()  : bool
Determine if an item exists in the array
count()  : int
Method to get the count of data in the collection
createCommand()  : void
Create command method
createController()  : string
Create controller method
createFromJson()  : ArrayObject
Create array object from JSON string
createFromSerialized()  : ArrayObject
Create array object from serialized string
createModel()  : string
Create model method
createView()  : string
Create view method
current()  : mixed
Get the current item of the array
first()  : mixed
Get the first item of the array
getIterator()  : ArrayIterator
Method to iterate over the array object
getNamespace()  : string
Get namespace
init()  : void
Init application
install()  : void
Install application files
join()  : string
Join the array values into a string
jsonSerialize()  : string
JSON serialize the array object
jsonUnserialize()  : ArrayObject
Unserialize a JSON string
key()  : mixed
Get the key of the current item of the array
ksort()  : static
Sort array by keys
ksortDesc()  : static
Sort array by keys, descending
last()  : mixed
Get the last item of the array
next()  : mixed
Get the next item of the array
offsetExists()  : bool
ArrayAccess offsetExists
offsetGet()  : mixed
ArrayAccess offsetGet
offsetSet()  : void
ArrayAccess offsetSet
offsetUnset()  : void
ArrayAccess offsetUnset
parseNamespace()  : array{namespace: string, slug: string, fullName: string}
Parse a raw namespace value typed by the user into a valid PHP namespace, a filesystem-safe kebab-case slug and a human-readable full name.
resolveAppInstance()  : Application|null
Resolve a full instance of the consuming application, if one is scaffolded, merging $baseRoutes with its own app/src/Console/Command routes
serialize()  : string
Serialize the array object
sort()  : static
Sort array
sortDesc()  : static
Sort array descending
split()  : static
Split a string into an array object
toArray()  : array<string|int, mixed>
Get the values as an array
uksort()  : static
Sort array by user-defined callback using keys
unserialize()  : ArrayObject
Unserialize a string
usort()  : static
Sort array by user-defined callback
installFrontend()  : void
Install front-end tooling (package.json, vite config, source assets)
splitIntoWords()  : array<string|int, mixed>
Split a single namespace segment into its component words, on non-alphanumeric separators and camelCase boundaries.

Properties

Methods

__construct()

Constructor

public __construct([mixed|null $data = null ]) : mixed

Instantiate the array object

Parameters
$data : mixed|null = null
Tags
throws
Exception

__get()

Get a value

public __get(string $name) : mixed
Parameters
$name : string

__isset()

Is value set

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__serialize()

Serialize magic method

public __serialize() : mixed

__set()

Magic method to set the property to the value of $this->data[$name]

public __set([string|null $name = null ][, mixed $value = null ]) : void
Parameters
$name : string|null = null
$value : mixed = null

__unserialize()

Unserialize magic method

public __unserialize(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>

__unset()

Unset a value

public __unset(string $name) : void
Parameters
$name : string

contains()

Determine if an item exists in the array

public contains(mixed $key[, bool $strict = false ]) : bool
Parameters
$key : mixed
$strict : bool = false
Return values
bool

count()

Method to get the count of data in the collection

public count() : int
Return values
int

createCommand()

Create command method

public createCommand(string $command, string $location[, bool $app = false ]) : void
Parameters
$command : string
$location : string
$app : bool = false
Tags
throws
Exception

createController()

Create controller method

public createController(string $ctrl, string $location[, bool|null $cli = null ]) : string
Parameters
$ctrl : string
$location : string
$cli : bool|null = null
Tags
throws
Exception
Return values
string

createFromJson()

Create array object from JSON string

public static createFromJson(string $jsonString[, int $depth = 512 ][, int $options = 0 ]) : ArrayObject
Parameters
$jsonString : string
$depth : int = 512
$options : int = 0
Return values
ArrayObject

createFromSerialized()

Create array object from serialized string

public static createFromSerialized(string $string) : ArrayObject
Parameters
$string : string
Tags
throws
Exception
Return values
ArrayObject

createModel()

Create model method

public createModel(string $model, string $location[, bool $data = false ]) : string
Parameters
$model : string
$location : string
$data : bool = false
Return values
string

createView()

Create view method

public createView(string $view, string $location) : string
Parameters
$view : string
$location : string
Return values
string

current()

Get the current item of the array

public current() : mixed

first()

Get the first item of the array

public first() : mixed

getIterator()

Method to iterate over the array object

public getIterator() : ArrayIterator
Return values
ArrayIterator

getNamespace()

Get namespace

public getNamespace(string $location) : string
Parameters
$location : string
Tags
throws
Exception
Return values
string

init()

Init application

public init(string $location, string $namespace[, bool $cliOnly = false ][, string $name = 'App' ][, string $url = '' ][, bool $cliApp = false ][, bool $createDb = false ][, string|null $frontend = null ]) : void
Parameters
$location : string
$namespace : string
$cliOnly : bool = false
$name : string = 'App'
$url : string = ''
$cliApp : bool = false
$createDb : bool = false
$frontend : string|null = null

install()

Install application files

public install(bool $cliOnly, string $location, string $namespace[, string $name = 'App' ][, string $url = '' ][, bool $cliApp = false ][, bool $createDb = false ][, string|null $frontend = null ]) : void
Parameters
$cliOnly : bool
$location : string
$namespace : string
$name : string = 'App'
$url : string = ''
$cliApp : bool = false
$createDb : bool = false
$frontend : string|null = null

join()

Join the array values into a string

public join(string $glue[, string $finalGlue = '' ]) : string
Parameters
$glue : string
$finalGlue : string = ''
Return values
string

jsonSerialize()

JSON serialize the array object

public jsonSerialize([int $options = 0 ][, int $depth = 512 ]) : string
Parameters
$options : int = 0
$depth : int = 512
Return values
string

jsonUnserialize()

Unserialize a JSON string

public jsonUnserialize(string $jsonString[, int $depth = 512 ][, int $options = 0 ]) : ArrayObject
Parameters
$jsonString : string
$depth : int = 512
$options : int = 0
Return values
ArrayObject

key()

Get the key of the current item of the array

public key() : mixed

ksort()

Sort array by keys

public ksort([int $flags = SORT_REGULAR ][, bool $descending = false ]) : static
Parameters
$flags : int = SORT_REGULAR
$descending : bool = false
Return values
static

ksortDesc()

Sort array by keys, descending

public ksortDesc([int $flags = SORT_REGULAR ]) : static
Parameters
$flags : int = SORT_REGULAR
Return values
static

offsetExists()

ArrayAccess offsetExists

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

ArrayAccess offsetGet

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

offsetSet()

ArrayAccess offsetSet

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

ArrayAccess offsetUnset

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

parseNamespace()

Parse a raw namespace value typed by the user into a valid PHP namespace, a filesystem-safe kebab-case slug and a human-readable full name.

public static parseNamespace(string $input) : array{namespace: string, slug: string, fullName: string}
Parameters
$input : string
Tags
throws
Exception
Return values
array{namespace: string, slug: string, fullName: string}

resolveAppInstance()

Resolve a full instance of the consuming application, if one is scaffolded, merging $baseRoutes with its own app/src/Console/Command routes

public resolveAppInstance(string $dir, mixed $autoloader, array<string|int, mixed> $baseRoutes) : Application|null
Parameters
$dir : string
$autoloader : mixed
$baseRoutes : array<string|int, mixed>
Tags
throws
Exception
Return values
Application|null

serialize()

Serialize the array object

public serialize([bool $self = false ]) : string
Parameters
$self : bool = false
Return values
string

sort()

Sort array

public sort([int $flags = SORT_REGULAR ][, bool $assoc = true ][, bool $descending = false ]) : static
Parameters
$flags : int = SORT_REGULAR
$assoc : bool = true
$descending : bool = false
Return values
static

sortDesc()

Sort array descending

public sortDesc([int $flags = SORT_REGULAR ][, bool $assoc = true ]) : static
Parameters
$flags : int = SORT_REGULAR
$assoc : bool = true
Return values
static

split()

Split a string into an array object

public static split(string $string, string $separator[, int $limit = PHP_INT_MAX ]) : static
Parameters
$string : string
$separator : string
$limit : int = PHP_INT_MAX
Return values
static

toArray()

Get the values as an array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

uksort()

Sort array by user-defined callback using keys

public uksort(mixed $callback) : static
Parameters
$callback : mixed
Return values
static

usort()

Sort array by user-defined callback

public usort(mixed $callback[, bool $assoc = true ]) : static
Parameters
$callback : mixed
$assoc : bool = true
Return values
static

installFrontend()

Install front-end tooling (package.json, vite config, source assets)

protected installFrontend(string $frontend, string $location, string $namespace, string $script) : void
Parameters
$frontend : string
$location : string
$namespace : string
$script : string

splitIntoWords()

Split a single namespace segment into its component words, on non-alphanumeric separators and camelCase boundaries.

protected static splitIntoWords(string $segment) : array<string|int, mixed>
Parameters
$segment : string
Return values
array<string|int, mixed>

        
On this page

Search results