Skip to content

Instantly share code, notes, and snippets.

View backstageel's full-sized avatar

Elísio Leonardo backstageel

View GitHub Profile
<?php
/**
* Reorder Social Accounts
*/
private function up1024_reorderSocialAccountOptions($accounts) {
$socialAccounts = civicrm_api3('OptionValue', 'get', [
'option_group_id' => 'website_type',
'name' => ['IN' => $accounts],
]);
<?php
public function saveSomethig($data){
$datasource = $this->getDataSource();
$datasource->begin();
if(!$this-Model1->save($data)){
$datasource->rollback()
return false;
}
if(!$this-Model2->save($data)){
@backstageel
backstageel / base_fund
Created August 10, 2015 12:25
Funcao para preencher os campos do ficheiro de Financiamento
<?php
public function base_fund()
{
//Lemos a biblioteca PHPExcel
App::import('Helper', 'PhpExcel');
$this->PHPExcel = new PhpExcelHelper(new View());
//Lemos o ficheiro excel a preencher. Aquele que foi fornecido pelos financiadores
$xls = $this->PHPExcel->loadWorksheetFromS3('/Reports/Financas/base_fund.xlsx');