spit generatePrivate into attr and event part (given long runtime).
pull/63/head
noud 2012-11-29 15:10:18 +01:00
parent 2daba5a3c2
commit c6bdf794c1
1 changed files with 10 additions and 1 deletions

View File

@ -406,9 +406,14 @@ class AppController extends Controller {
}
public function generatePrivate() {
$this->generatePrivateForAttributes();
$this->generatePrivateForEvents();
}
public function generatePrivateForAttributes() {
if (!self::_isAdmin()) throw new NotFoundException();
$this->loadModel('Correlation');
$this->loadModel('Attribute');
$attributes = $this->Attribute->find('all',array('recursive' => 0));
foreach ($attributes as $attribute) {
@ -419,6 +424,10 @@ class AppController extends Controller {
}
$this->Attribute->save($attribute);
}
}
public function generatePrivateForEvents() {
if (!self::_isAdmin()) throw new NotFoundException();
$this->loadModel('Event');
$events = $this->Event->find('all',array('recursive' => 0));