/**
  * Sets $this->needs and returns the Needs associated with this Project. Delegate of __get().
  * Note: only active, visible needs are returned.
  *
  * @return array Needs as returned by API
  */
 private function _get_needs()
 {
     if (empty($this->needs)) {
         $result = civicrm_api3('VolunteerNeed', 'get', array('is_active' => '1', 'project_id' => $this->id, 'visibility_id' => CRM_Core_OptionGroup::getValue('visibility', 'public', 'name'), 'options' => array('sort' => 'start_time', 'limit' => 0)));
         $this->needs = $result['values'];
         foreach (array_keys($this->needs) as $need_id) {
             $this->needs[$need_id]['quantity_assigned'] = CRM_Volunteer_BAO_Need::getAssignmentCount($need_id);
         }
     }
     return $this->needs;
 }