The Scope Interface
The scope interface can be found here: coldbox.system.ioc.scopes.IScope.
Please note that you DO NOT need to add the implements to your code. We actually highly suggest you don't. There are many issues with interfaces yet in multiple CFML engines. So we do runtime checks for it, instead at compile time.
1
/**
2
* Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
3
* www.ortussolutions.com
4
* ---
5
* The main interface to produce WireBox storage scopes
6
**/
7
interface {
8
9
/**
10
* Configure the scope for operation and returns itself
11
*
12
* @injector The linked WireBox injector
13
* @injector.doc_generic coldbox.system.ioc.Injector
14
*
15
* @return coldbox.system.ioc.scopes.IScope
16
*/
17
function init( required injector );
18
19
/**
20
* Retrieve an object from scope or create it if not found in scope
21
*
22
* @mapping The linked WireBox injector
23
* @mapping.doc_generic coldbox.system.ioc.config.Mapping
24
* @initArguments The constructor struct of arguments to passthrough to initialization
25
*/
26
function getFromScope( required mapping, struct initArguments );
27
28
29
/**
30
* Indicates whether an object exists in scope
31
*
32
* @mapping The linked WireBox injector
33
* @mapping.doc_generic coldbox.system.ioc.config.Mapping
34
*
35
* @return coldbox.system.ioc.scopes.IScope
36
*/
37
boolean function exists( required mapping );
38
39
}
40
Copied!
Copy link
Edit on GitHub