Exemplo n.º 1
0
 public function getRelationshipSummary()
 {
     $ret = array();
     if ($this->hasExtension('Person')) {
         $catNames = array(1 => 'Position', 3 => 'Membership', 2 => 'Education', 5 => 'Donation/grant', 6 => 'Transaction', 7 => 'Lobbying', 4 => 'Family', 8 => 'Social', 9 => 'Professional', 10 => 'Ownership');
     } else {
         $catNames = array(1 => 'Position', 3 => 'Membership', 2 => 'Education', 5 => 'Donation/grant', 6 => 'Transactions', 7 => 'Lobbying', 10 => 'Ownership');
     }
     $entity_relationships = $this->getEntitiesWithRelationships();
     foreach ($catNames as $catId => $catName) {
         $catAry = EntityTable::filterEntitiesWithRelationships($entity_relationships, $catId);
         if (count($catAry)) {
             $ret[$catName] = count($catAry);
         }
     }
     return $ret;
 }
Exemplo n.º 2
0
 public function executeLobbying($request)
 {
     $this->checkEntity($request, false, false);
     $page = $request->getParameter('page', 1);
     $num = $request->getParameter('num', 20);
     $entity_relationships = $this->entity->getEntitiesWithRelationships(array(RelationshipTable::LOBBYING_CATEGORY), null, $orderBynum = false);
     $lobbying_relationships = EntityTable::filterEntitiesWithRelationships($entity_relationships, array(RelationshipTable::LOBBYING_CATEGORY));
     $this->lobbying_pager = new LsDoctrinePager($lobbying_relationships, $page, $num);
     $this->lobbying_pager->setAjax(true);
     $this->lobbying_pager->setAjaxUpdateId('relationship_tabs_content');
     $this->lobbying_pager->setAjaxIndicatorId('indicator');
     $this->lobbying_pager->setAjaxHash('lobbying');
 }