AppScopeTrait¶
-
trait
atk4\core\
AppScopeTrait
¶ - Typical software design will create the application scope. Most frameworksrelies on “static” properties, methods and classes. This does puts somelimitations on your implementation (you can’t have multiple applications).App Scope will pass the ‘app’ property into all the object that you’readding, so that you know for sure which application you work with.
Source: vendor/atk4/core/src/AppScopeTrait.php#13
Properties¶
-
public static property
atk4\core\AppScopeTrait::$
_appScopeTrait
¶ - Check this property to see if trait is present in the object.
Source: vendor/atk4/core/src/AppScopeTrait.php#20 Type: bool
-
public static property
atk4\core\AppScopeTrait::$
app
¶ - Always points to current Application.
Source: vendor/atk4/core/src/AppScopeTrait.php#27 Type: \atk4\ui\App
-
public static property
atk4\core\AppScopeTrait::$
max_name_length
¶ - When using mechanism for ContainerTrait, they inherit name of theparent to generate unique name for a child. In a framework it makessense if you have a unique identifiers for all the objects becausethis enables you to use them as session keys, get arguments, etc.Unfortunately if those keys become too long it may be a problem,so ContainerTrait contains a mechanism for auto-shortening thename based around max_name_length. The mechanism does only workif AppScopeTrait is used, $app property is set and has amax_name_length defined.Minimum is 20See http://stackoverflow.com/a/9399615/1466341 for more info.
Source: vendor/atk4/core/src/AppScopeTrait.php#47 Type: int
-
public static property
atk4\core\AppScopeTrait::$
unique_hashes
¶ - As more names are shortened, the substituted part is being placed intothis hash and the value contains the new key. This helps to avoid creatingmany sequential prefixes for the same character sequence. Thosehashes can also be used to re-build the long name of the object, butthis functionality is not essential and excluded from traits. Youcan find it in a test suite.
Source: vendor/atk4/core/src/AppScopeTrait.php#59 Type: array