Permalink
Browse files

Save department on create

  • Loading branch information...
protich committed Oct 24, 2016
1 parent efdbdb3 commit c664c936bbad1d85df39bf0bac8aa96871c83a7e
Showing with 6 additions and 3 deletions.
  1. +6 −3 include/class.dept.php
View
@@ -469,7 +469,7 @@ private function setFlag($flag, $val) {
}
/*----Static functions-------*/
static function getIdByName($name, $pid=null) {
static function getIdByName($name, $pid=null) {
$row = static::objects()
->filter(array(
'name' => $name,
@@ -579,9 +579,12 @@ static function create($vars=false, &$errors=array()) {
static function __create($vars, &$errors) {
$dept = self::create($vars);
$dept->update($vars, $errors);
if (!$dept->update($vars, $errors))
return false;
$dept->save();
return isset($dept->id) ? $dept : null;
return $dept;
}
function save($refetch=false) {

0 comments on commit c664c93

Please sign in to comment.