PageRenderTime 17ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/SampleApplication/ColdBox3/model/artist/ArtistService.cfc

http://github.com/bobsilverberg/ValidateThisColdBoxPlugin
ColdFusion CFScript | 54 lines | 24 code | 6 blank | 24 comment | 0 complexity | 8e4979a8eb408fe715811a0fcf4ed1e7 MD5 | raw file
 1component extends="model.abstract.AbstractService" singleton="true"
 2{
 3	/*
 4	---------------------------------------------------------------------------
 5	constructor
 6	---------------------------------------------------------------------------
 7	*/
 8	ArtistService function init()
 9	{
10		super.init();
11		return this;
12	}
13
14	/*
15	---------------------------------------------------------------------------
16	public
17	---------------------------------------------------------------------------
18	*/
19	
20	/**
21	* returns an Artist by id, if the id is not found a new Artist is returned
22	* @param1 the unique id
23	*/
24	Artist function getArtistById( required id )
25	{
26		return getById( 'Artist', arguments.id );
27	}
28	
29	/**
30	* returns a struct of required properties
31	*/
32	struct function getArtistRequiredFields()
33	{
34		return getRequiredFields( 'Artist' );
35	}
36
37	/**
38	* returns an array of artists
39	*/	
40	array function getArtists()
41	{
42		return findByfilter( 'Artist', {}, "lastname,firstname" );
43	}
44
45	/**
46	* delete an artist by id
47	* @param1 the unique id
48	*/	
49	boolean function deleteArtistById( required id )
50	{
51		return deleteById( 'Artist', arguments.id );
52	}
53	
54}