mirror of https://github.com/MISP/MISP
new: [Tag collections] Added boilerplate models
parent
10557c12da
commit
ecf52d5cb8
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
App::uses('AppModel', 'Model');
|
||||
|
||||
class TagCollection extends AppModel
|
||||
{
|
||||
public $useTable = 'tag_collections';
|
||||
|
||||
public $displayField = 'name';
|
||||
|
||||
public $actsAs = array(
|
||||
'Trim',
|
||||
'SysLogLogable.SysLogLogable' => array(
|
||||
'roleModel' => 'Role',
|
||||
'roleKey' => 'role_id',
|
||||
'change' => 'full'
|
||||
)
|
||||
);
|
||||
|
||||
public $whitelistedItems = false;
|
||||
|
||||
public $validate = array(
|
||||
'name' => array(
|
||||
'valueNotEmpty' => array(
|
||||
'rule' => array('valueNotEmpty'),
|
||||
),
|
||||
'unique' => array(
|
||||
'rule' => 'isUnique',
|
||||
'message' => 'A similar name already exists.',
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
App::uses('AppModel', 'Model');
|
||||
|
||||
class TagCollectionElement extends AppModel
|
||||
{
|
||||
public $useTable = 'tag_collection_elements';
|
||||
|
||||
public $displayField = 'name';
|
||||
|
||||
public $actsAs = array(
|
||||
'Trim',
|
||||
'SysLogLogable.SysLogLogable' => array(
|
||||
'roleModel' => 'Role',
|
||||
'roleKey' => 'role_id',
|
||||
'change' => 'full'
|
||||
)
|
||||
);
|
||||
|
||||
public $whitelistedItems = false;
|
||||
|
||||
public $validate = array(
|
||||
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue