Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Recupera gli annunci relazionati
*
* Priorità di ricerca:
*
* 1. Filtro annunci con stesse regioni + settori + tags (`Regions.id` e `Sectors.id` e `Tags.id`)
* 2. Filtro annunci con stesse regioni + settori (`Regions.id` e `Sectors.id`)
* 3. Filtro annunci con stessi settori (`Sectors.id`)
* 4. Filtro annunci stesse regioni (`Regions.id`)
<?php
/**
* Recupera i tags associati alla tabella
* Le opzioni che vengono utilizzate sono:
*
* - association: (obbligatorio) Nome dell'associazione da utilizzare per il recupero dei tags
* - matching: (opzionale) Utilizzato per modificare il tipo di query da eseguire
* matching() o contain()
* - query_conditions: (opzionale) Array con le condizioni di filtro da applicare
* - query_order: (opzionale) Array con le condizioni di ordinamento da applicare
<?php
/*
* Controlla se l'annuncio è di un determinato utente
*
* @param integer $adId Id annuncio
* @param integer $userId Id utente
* @return boolean L'annuncio è dell'utente?
*/
/**
* Filtro per il recupero degli annunci che appartengono a determinati servizi
*
* @param Query $query
* @param array $options
* @return Query
*/
public function findServices(Query $query, array $options)
{
if (empty($options['matching'])) {
/**
* Recupero numero totale degli annunci di ogni settore.
* Di default vengono restituiti i dati della tabella tags ed un campo aggiuntivo
* chiamato `total_ads` che indica il numero totale degli annunci associati a
* quel singolo tag settoriale.
*
* Opzioni utilizzabili:
*
* - tagGroupId: (default: 1) E' il gruppo di associazione con la tabella Ads
* - scope: (default: 1) E' lo scope che identifica tutti i tag settoriali
<?php
$this->assertEquals('Questo è un testo di prova su più righe.
Seconda
Terza
Quarta
Testo finale',
trim($this->tika->getText($this->fixture . 'text.pdf'))
);
<script>
$(document).ready(function() {
$(document).on("page:update", function() {
var config = {
'.chosen-select' : {},
'.chosen-select-deselect' : {allow_single_deselect:true},
'.chosen-select-no-single' : {disable_search_threshold:10},
'.chosen-select-no-results': {no_results_text:'Oops, nothing found!'},
'.chosen-select-width' : {width:"95%"}
};
<?php
$text = $this->getMockBuilder('\Cake\Utility\Text')
->getMock();
$text->method('uuid')
->willReturn('ciao');
$table = $this->table('ads');
$table
->renameColumn('url', 'slug')
->update();
<?php
namespace UserTags\View\Helper;
use Cake\View\Helper;
use Cake\View\View;
use UserTags\Traits\TagTrait;
/**
* Tag helper
*/