コード例 #1
0
 /**
  * set activity identifier
  */
 public function setIdentifier()
 {
     $reportingOrg = $this->organizationModel->find($this->orgId)->reporting_org;
     $reportingOrgIdentifier = $reportingOrg[0]['reporting_organization_identifier'];
     $activityIdentifier = $this->activity['activity_identifier'];
     $this->activityData['identifier'] = ["activity_identifier" => $activityIdentifier, 'iati_identifier_text' => sprintf('%s-%s', $reportingOrgIdentifier, $activityIdentifier)];
 }
コード例 #2
0
 /**
  * return all organization data
  */
 public function get()
 {
     $id = request()->segment(2);
     $orgData = OrgData::where('organization_id', $id)->first()->toArray();
     $orgData['reporting_org'] = Organization::find($id)->reporting_org;
     return $orgData;
 }
コード例 #3
0
 /**
  * return activity data with results and transactions
  * @param int $id
  */
 private function getActivityData($id)
 {
     $activityData = Activity::find($id);
     if ($activityData) {
         $activityData = $activityData->toArray();
         $reportingOrg = Organization::find($activityData['organization_id'])->reporting_org;
         $results = ActivityResult::where('activity_id', $id)->get()->toArray();
         $transactions = Transaction::where('activity_id', $id)->get()->toArray();
         $documentLinks = ActivityDocumentLink::where('activity_id', $id)->get()->toArray();
         $activityData['results'] = $results;
         $activityData['transactions'] = $transactions;
         $activityData['document_link'] = $documentLinks;
         $activityData['reporting_organization'] = $reportingOrg;
     }
     return $activityData;
 }
コード例 #4
0
 public function edit($id)
 {
     $organization = Organization::find($id);
     return view('backend.organizations.edit')->with(compact('organization'));
 }
コード例 #5
0
 /**
  * @param $id
  * @return model
  */
 public function getOrganization($id)
 {
     return $this->org->find($id);
 }