Exemplo n.º 1
0
 public static function Init($data)
 {
     if (isset($data['page']['params']['id'])) {
         $Account = AccountController::Get(array('ids' => $data['page']['params']['id']));
         $Memberships = MembershipController::Search(array('account_id' => $Account['id'], 'operator' => 'eq'));
         foreach ($Memberships as $Membership) {
             $Act = ActController::Get(array('ids' => $Membership['act_id']));
             $Roles = RoleController::Search(array('membership_id' => $Membership['id'], 'operator' => 'eq'));
             foreach ($Roles as $Role) {
                 $Tag = TagController::Get(array('ids' => $Role['tag_id']));
                 $Act['roles'][$Tag['title']] = $Tag['title'];
                 $Account['roles'][$Tag['title']][$Act['id']] = $Act;
             }
             $Performances = PerformanceController::Search(array('act_id' => $Act['id']));
             foreach ($Performances as $Performance) {
                 $Event = EventController::Get(array('ids' => $Performance['event_id']));
                 $Account['performances'][$Performance['id']] = array('where' => $Event, 'as' => $Act, 'when' => $Performance, 'with' => array());
                 $Act['performances'][$Event['id']] = $Event;
             }
             $Account['acts'][$Act['id']] = $Act;
         }
         $Attendings = AttendeeController::Search(array('account_id' => $Account['id'], 'operator' => 'eq'));
         foreach ($Attendings as $Attending) {
             $Event = EventController::Get(array('ids' => $Attending['event_id']));
             $Account['attending'][$Event['id']] = $Event;
         }
         $data['account'] = $Account;
     } else {
     }
     self::SetData($data);
 }
Exemplo n.º 2
0
 public static function Init($data)
 {
     if (isset($data['page']['params']['id'])) {
         $Act = ActController::Get(array('ids' => $data['page']['params']['id']));
         $Memberships = MembershipController::Search(array('act_id' => $Act['id'], 'operator' => 'eq'));
         foreach ($Memberships as $Membership) {
             $Member = AccountController::Get(array('ids' => $Membership['account_id']));
             $Roles = RoleController::Search(array('membership_id' => $Membership['id'], 'operator' => 'eq'));
             foreach ($Roles as $Role) {
                 $Tag = TagController::Get(array('ids' => $Role['tag_id']));
                 $Act['roles'][$Tag['title']] = $Tag['title'];
                 $Member['roles'][] = $Tag['title'];
             }
             $Act['members'][$Member['id']] = $Member;
         }
         $data['act'] = $Act;
     } else {
     }
     self::SetData($data);
 }