Bug fixing, new map info dialog

This commit is contained in:
Exodus4D
2015-08-25 23:04:47 +02:00
parent e3591e5d05
commit 52957d1ac8
70 changed files with 3320 additions and 1452 deletions

View File

@@ -60,8 +60,14 @@ class BasicModel extends \DB\Cortex {
$this->afterupdate( function($self){
$self->clearCacheData();
});
// model updated
$this->beforeinsert( function($self){
$self->beforeInsertEvent($self);
});
}
/**
* @param string $key
* @param mixed $val
@@ -243,7 +249,7 @@ class BasicModel extends \DB\Cortex {
*/
public function getById($id, $ttl = 3) {
return $this->getByForeignKey('id', (int)$id, array('limit' => 1), $ttl);
return $this->getByForeignKey('id', (int)$id, ['limit' => 1], $ttl);
}
/**
@@ -277,7 +283,7 @@ class BasicModel extends \DB\Cortex {
* @param int $ttl
* @return \DB\Cortex
*/
public function getByForeignKey($key, $id, $options = array(), $ttl = 60){
public function getByForeignKey($key, $id, $options = [], $ttl = 60){
$querySet = [];
$query = [];
@@ -297,6 +303,15 @@ class BasicModel extends \DB\Cortex {
return $this->load( $querySet, $options, $ttl );
}
/**
* Event "Hook" function
* can be overwritten
* return false will stop any further action
*/
public function beforeInsertEvent(){
return true;
}
/**
* function should be overwritten in child classes with access restriction
* @param $accessObject