Exemple #1
0
 /**
  * Inicializa los datos iniciales.
  *
  * Los acos se deben generar antes, ejecutando:
  * `./Console/cake AclExtras.AclExtras aco_sync`
  *
  * @return bool
  */
 private function initBasicData()
 {
     $group = new Group();
     $user = new User();
     $person = new Person();
     $genre = new Genre();
     if ($genre->countItems() == 0) {
         self::initGenres($genre);
     }
     if ($person->countItems() == 0 || !$person->exists(1)) {
         self::initPeople($person);
     }
     if ($group->countItems() == 0) {
         self::initGroups($group);
     }
     if ($user->countItems() == 0) {
         self::initUsers($user);
     }
     $hr = $user->query('SELECT COUNT(*) AS count FROM `aros_acos`');
     // debug($hr[0][0]['count']);
     if ((int) $hr[0][0]['count'] == 0) {
         $this->initGroupsPermissions();
     }
     return true;
 }