added nicer overview and delete function
This commit is contained in:
@ -12,8 +12,8 @@ class Dog extends Model
|
||||
'size' => ['type' => 'text'], //in cm
|
||||
'birthday' => ['type' => 'text'],
|
||||
'agility_size' => ['type' => 'text'], //S,M,I,L
|
||||
'photo' => ['type' => 'text'],
|
||||
'active' => ['type' => 'int', 'default' => 1]
|
||||
'photo' => ['type' => 'text', 'default' => 'https://pictshare.net/1ch3e5.png'],
|
||||
'active' => ['type' => 'bool', 'default' => 1]
|
||||
);
|
||||
|
||||
function isMyDog($dog = false)
|
||||
|
@ -33,6 +33,16 @@ class User extends Model {
|
||||
unset($_SESSION['user']);
|
||||
}
|
||||
|
||||
function removeDog($dogid)
|
||||
{
|
||||
if(!$this->id) return false;
|
||||
if (in_array($dogid, $this->data['dogs']))
|
||||
{
|
||||
$this->data['dogs'] = array_diff($this->data['dogs'],[$dogid]);
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
|
||||
function getAll($filtered = true)
|
||||
{
|
||||
$keys = $this->redis->keys($this->dbTable.':*');
|
||||
|
Reference in New Issue
Block a user