Skip to content

Commit

Permalink
Added deleting permissions when profile was deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeysviridenko authored and sergeyklay committed Feb 8, 2018
1 parent 740d5e3 commit c1011d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/Profiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace Vokuro\Models;

use Phalcon\Mvc\Model;
use Phalcon\Mvc\Model\Relation;

/**
* Vokuro\Models\Profiles
Expand Down Expand Up @@ -35,7 +36,10 @@ public function initialize()
]);

$this->hasMany('id', __NAMESPACE__ . '\Permissions', 'profilesId', [
'alias' => 'permissions'
'alias' => 'permissions',
'foreignKey' => [
'action' => Relation::ACTION_CASCADE
]
]);
}
}

0 comments on commit c1011d6

Please sign in to comment.