本文整理汇总了PHP中Set::classicExtract方法的典型用法代码示例。如果您正苦于以下问题:PHP Set::classicExtract方法的具体用法?PHP Set::classicExtract怎么用?PHP Set::classicExtract使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Set
的用法示例。
在下文中一共展示了Set::classicExtract方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formatCanteenOrder
/**
* Extract all required information from a CanteenOrder to send to the GatewayAccount Processor
* @param CanteenOrder $CanteenOrder
* @return Array:
*/
public static function formatCanteenOrder($CanteenOrder)
{
$t = array();
$customer = $CanteenOrder['BillingAddress'];
#TRANSACTION
$t['Transaction']['currency_id'] = Set::classicExtract($CanteenOrder, "CanteenOrder.currency_id");
$t['Transaction']['amount'] = Set::classicExtract($CanteenOrder, "CanteenOrder.grand_total");
$t['Transaction']['foreign_key'] = Set::classicExtract($CanteenOrder, "CanteenOrder.id");
$t['Transaction']['model'] = "CanteenOrder";
#CUSTOMER
$t['Customer']['first_name'] = Set::classicExtract($customer, "first_name");
$t['Customer']['last_name'] = Set::classicExtract($customer, "last_name");
$t['Customer']['address'] = Set::classicExtract($customer, "street") . " " . Set::classicExtract($customer, "apt");
$t['Customer']['postal'] = Set::classicExtract($customer, "postal_code");
$t['Customer']['country'] = Set::classicExtract($customer, "country_code");
$t['Customer']['email'] = Set::classicExtract($customer, "email");
$t['Customer']['city'] = Set::classicExtract($customer, "city");
$t['Customer']['state'] = Set::classicExtract($customer, "state");
$t['Customer']['phone'] = Set::classicExtract($customer, "phone");
$t['Customer']['user_id'] = Set::classicExtract($customer, "user_id");
#CARD DATA
$t['CardData']['number'] = Set::classicExtract($CanteenOrder, "CardData.number");
$t['CardData']['exp_year'] = Set::classicExtract($CanteenOrder, "CardData.exp_year");
$t['CardData']['exp_month'] = Set::classicExtract($CanteenOrder, "CardData.exp_month");
$t['CardData']['code'] = Set::classicExtract($CanteenOrder, "CardData.code");
return $t;
}
示例2: admin_index
function admin_index()
{
$model = 'Telefone';
$this->set('model', $model);
//// Find de apoio à listagem. Filtro
//// Relacionamento:
//// - Empresa
//==============================================================
$this->set('setores', $this->{$model}->Setor->find('list', array('fields' => array('id', 'setor'), 'conditions' => array('ativo' => 1))));
//==============================================================
//// FILTRO:
//==============================================================
if (!empty($this->request->data['filtro']['Setores'])) {
$ids_empresas = '';
foreach ($this->request->data['filtro']['Setores'] as $r) {
$ids_empresas = $ids_empresas . $r . ',';
}
$sql_conteudo_id = "SELECT DISTINCT Telefone.id\n\t\t\t\t\t\t\t\tFROM tb_telefones as Telefone\n\t\t\t\t\t\t\t\tINNER JOIN tb_telefones_setores as TE ON (TE.telefone_id = Telefone.id)\n\t\t\t\t\t\t\t\tINNER JOIN tb_setores as Setor ON (TE.setor_id = Setor.id) \n\t\t\t\t\t\t\t\tWHERE Setor.id IN (" . substr_replace($ids_empresas, '', -1, 1) . ")";
$conteudos = $this->{$model}->query($sql_conteudo_id);
//////============>>>
//Desmontar Array
$conteudo_id = Set::classicExtract($conteudos, '{n}.Telefone.id');
/////////////////
$this->paginate['contain'] = array('Setor');
$this->paginate['conditions'] = array('Telefone.id' => $conteudo_id);
}
//==============================================================
$this->paginate['fields'] = array('id', 'telefones', 'ativo');
$this->set('registros', $this->paginate($model));
}
示例3: testGetPathToRole
/**
* testGetPathToRole
*
* @return void
*/
public function testGetPathToRole()
{
$expected = array(Role::SUPER, Role::ADMIN, Role::MOD, Role::USER);
$result = $this->Role->getPathToRole(Role::USER);
$actual = Set::classicExtract($result, '{n}.Role.name');
$this->assertEquals($expected, $actual, 'path to user role should go super->admin->mod->user');
}
示例4: getMessages
/**
* Get thread's messages
*
*/
public function getMessages($threadId = 0)
{
$messages = $this->find('all', array('conditions' => array('admin_thread_id' => $threadId), 'recursive' => -1, 'order' => array('created')));
if (!$messages) {
return array();
}
$today = date('Y-m-d');
$dayOfWeekList = array(0 => '日', '月', '火', '水', '木', '金', '土');
foreach ($messages as $key => $message) {
// Prepare file attach message
if (isset($message['AdminChat']['file']) && $message['AdminChat']['file']) {
$messages[$key]['AdminChat']['file'] = Router::url(array('controller' => 'admin_messages', 'action' => 'file', $message['AdminChat']['id']));
}
$messages[$key]['AdminChat']['message_content'] = $message['AdminChat']['message'];
unset($messages[$key]['AdminChat']['message']);
// Prepare sent date
if (isset($message['AdminChat']['created']) && $message['AdminChat']['created']) {
$sentDate = date('Y-m-d', strtotime($message['AdminChat']['created']));
$sentHour = date('H:i', strtotime($message['AdminChat']['created']));
$sentDoW = $dayOfWeekList[date('w', strtotime($message['AdminChat']['created']))];
$messages[$key]['AdminChat']['last_sent'] = $sentDate;
if ($sentDate == $today) {
$messages[$key]['AdminChat']['display_date'] = '今日';
} else {
$messages[$key]['AdminChat']['display_date'] = str_replace('-', '/', str_replace(date('Y') . '-', '', $sentDate)) . '(' . $sentDoW . ')';
}
$messages[$key]['AdminChat']['display_hour'] = $sentHour;
}
}
return Set::classicExtract($messages, '{n}.AdminChat');
}
示例5: importElements
private function importElements()
{
App::import('Core', 'GummFolder');
$Folder = new GummFolder(GUMM_LAYOUT_ELEMENTS);
$elementFiles = $Folder->findRecursive('.*\\.php');
$Folder->cd(GUMM_LAYOUT_ELEMENTS_SINGLE);
$elementFiles = array_merge($elementFiles, $Folder->findRecursive('.*\\.php'));
$availableElements = Set::flatten(Set::classicExtract(array_values(Configure::read('Data.BuilderElements')), '{n}.elements'));
$elementsAvaialbleMap = array();
foreach ($elementFiles as $layoutElementFullPath) {
$basename = basename($layoutElementFullPath, '.php');
if (in_array($basename, $availableElements)) {
$elementsAvaialbleMap[$basename] = $layoutElementFullPath;
}
}
foreach ($availableElements as $basename) {
if (isset($elementsAvaialbleMap[$basename])) {
require_once $elementsAvaialbleMap[$basename];
$className = Inflector::camelize($basename) . 'LayoutElement';
$settings = array();
if ($this->post) {
$settings['postId'] = $this->post->ID;
}
$obj = new $className($settings);
$this->elementsAvailable[Inflector::underscore($basename)] = $obj;
}
}
}
示例6: index
/**
* index method
*
* @return void
*/
public function index()
{
$this->loadModel('User');
$this->loadModel('Wallet');
$this->TransferWallet->recursive = 0;
$id_auth = $this->Auth->user('id');
$findWallet = $this->User->findWalletAuth($id_auth);
$result_wallet_selected = Set::classicExtract($findWallet, '{n}.wallets.id');
// search
$sentWalletId = $this->request->query('sent_wallet_id');
$recieveWalletId = $this->request->query('receive_wallet_id');
$money = $this->request->query('transfer_money');
$day = $this->request->query('day_start');
$month = $this->request->query('month_start');
$year = $this->request->query('year_start');
$conditions = array('TransferWallet.sent_wallet_id is not null', 'TransferWallet.receive_wallet_id is not null');
if (!empty($sentWalletId)) {
$conditions['TransferWallet.sent_wallet_id'] = $sentWalletId;
} else {
$conditions['TransferWallet.sent_wallet_id'] = $result_wallet_selected;
}
if (!empty($recieveWalletId)) {
$conditions['TransferWallet.receive_wallet_id'] = $recieveWalletId;
} else {
$conditions['TransferWallet.receive_wallet_id'] = $result_wallet_selected;
}
if (!empty($money)) {
if ($money >= 500001) {
$conditions[] = 'TransferWallet.transfer_money >' . $money;
} else {
$conditions[] = 'TransferWallet.transfer_money <=' . $money;
}
}
if (!empty($day)) {
$conditions['day(TransferWallet.created)'] = $day;
} else {
$conditions[] = 'day(TransferWallet.created) is not null';
}
if (!empty($month)) {
$conditions['month(TransferWallet.created)'] = $month;
}
if (!empty($year)) {
$conditions['YEAR(TransferWallet.created)'] = $year;
}
$countTransfer = count($this->TransferWallet->find('all', array('conditions' => $conditions)));
// check if wallet count >= 2
$countWallets = $this->Wallet->countWallets($id_auth);
if ($countWallets[0][0]['count(*)'] < 2) {
$this->Flash->error(__('you must have two wallets before add transfer!'));
$this->redirect(array('controller' => 'wallets', 'action' => 'index'));
}
$this->paginate = array('conditions' => $conditions, 'limit' => 20);
$sentWallets = $this->TransferWallet->getListWalletSent($result_wallet_selected);
$receiveWallets = $this->TransferWallet->getListWalletReceive($result_wallet_selected);
$this->set('transferWallets', $this->Paginator->paginate());
$this->set('countTransfer', $countTransfer);
$this->set(compact('sentWallets', 'receiveWallets'));
}
示例7: read
/**
* @param string $path
* @param bool $forUser
* @return void
*/
public function read($path = '', $forUser = true)
{
if (!$path) {
return;
}
$path = $this->_getPath($path, $forUser);
$__cookie = $this->_getGummCookie();
return Set::classicExtract($__cookie, $path);
}
示例8: getLast
public function getLast($user_id, $limit = 20)
{
$results = $this->find('all', array('conditions' => array('Notification.user_id' => $user_id, "Notification.created >" => date('Y-m-d', strtotime("-1 weeks"))), 'limit' => $limit));
$ids = Set::classicExtract($results, '{n}.Notification.id');
$subjects = $this->Subject->findAllByNotificationId($ids);
foreach ($results as $k => $result) {
$s = Set::extract('/.[notification_id=' . $result['Notification']['id'] . ']', $subjects);
foreach ($s as $t) {
$results[$k][$t['model']] = $t[$t['model']];
}
}
return $results;
}
示例9: find
/**
* @param int $postId
* @param string $metaId
* @param bool $single
* @return mixed
*/
public function find($postId, $metaId, $single = true)
{
$metaId = $this->gummOptionId($metaId, true);
$meta = false;
if (strpos($metaId, '.') !== false) {
$parts = explode('.', $metaId);
$rootId = array_shift($parts);
$rootMetaData = get_post_meta($postId, $rootId, $single);
$metaXPath = implode('.', $parts);
$meta = Set::classicExtract($rootMetaData, $metaXPath);
if ($meta === null || $rootMetaData === '' && !$meta) {
$meta = false;
}
} else {
$meta = get_post_meta($postId, $metaId, $single);
// if ($postId == 442 && $metaId == 'nova_postmeta') {
// debug(get_post_meta(442, 'nova_postmeta'), true);
// d($meta);
// } else {
// debug($postId);
// debug($metaId);
// }
}
// debug($metaId);
$_post = get_post($postId);
$friendlyId = $this->friendlyOptionId($metaId);
$postTypes = array($_post->post_type);
if (in_array($_post->post_type, $this->Post->getPostTypes())) {
$postTypes[] = 'single';
}
if (!$meta && isset($this->_schema[$friendlyId])) {
$meta = $this->_schema[$friendlyId];
} elseif ($friendlyId == 'postmeta') {
foreach ($postTypes as $postType) {
if (isset($this->_schema[$postType]) && isset($this->_schema[$postType]['postmeta'])) {
if (!$meta) {
$meta = $this->_schema[$postType]['postmeta'];
} else {
$meta = array_merge($this->_schema[$postType]['postmeta'], (array) $meta);
}
if (is_array($meta)) {
$meta = Set::booleanize($meta);
}
}
}
}
if ($meta && !is_admin() && function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
$meta = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($meta);
}
return $meta;
}
示例10: index
/**
* index method
*
* @return void
*/
public function index()
{
$this->loadModel('User');
$this->loadModel('Wallet');
$this->Transaction->recursive = 0;
$id_auth = $this->Auth->user('id');
$findWallet = $this->User->findWalletAuth($id_auth);
$result_wallet_id = Set::classicExtract($findWallet, '{n}.wallets.id');
$categorieId = $this->request->query('categorie_id');
$walletId = $this->request->query('wallet_id');
$money = $this->request->query('money');
$day = $this->request->query('day_start');
$month = $this->request->query('month_start');
$year = $this->request->query('year_start');
$conditions = array('Wallet.id is not null', 'Categorie.id is not null');
if (!empty($categorieId)) {
$conditions['Transaction.categorie_id'] = $categorieId;
}
if (!empty($walletId)) {
$conditions['Transaction.wallet_id'] = $walletId;
} else {
$conditions['Transaction.wallet_id'] = $result_wallet_id;
}
if (!empty($money)) {
$conditions[] = 'Transaction.transaction_money <=' . $money;
}
if (!empty($day)) {
$conditions['day(Transaction.day_transaction)'] = $day;
}
if (!empty($month)) {
$conditions['month(Transaction.day_transaction)'] = $month;
}
if (!empty($year)) {
$conditions['year(Transaction.day_transaction)'] = $year;
}
$this->paginate = array('conditions' => $conditions, 'limit' => 20);
$countTransaction = count($this->Transaction->find('all', array('conditions' => $conditions)));
$countWallets = $this->Wallet->countWallets($id_auth);
if ($countWallets[0][0]['count(*)'] < 1) {
$this->Flash->error(__('you must add wallet before add transaction!'));
$this->redirect(array('controller' => 'wallets', 'action' => 'index'));
}
$categoriesIncome = $this->Transaction->getAllCategoriesIncome();
$categoriesExpense = $this->Transaction->getAllCategoriesExpense();
$categories = $this->Transaction->findListCategory();
$wallets = $this->Transaction->findIdWalletAuth($result_wallet_id);
$this->set('transactions', $this->Paginator->paginate());
$this->set('countTransaction', $countTransaction);
$this->set(compact('categoriesIncome', 'categoriesExpense', 'categories', 'wallets'));
}
示例11: afterFind
public function afterFind($results, $primary = false)
{
if ($primary) {
$ids = Set::classicExtract($results, '{n}.Notification.id');
$subjects = $this->Subject->findAllByNotificationId($ids);
foreach ($results as $k => $result) {
$s = Set::extract('/.[notification_id=' . $result['Notification']['id'] . ']', $subjects);
foreach ($s as $t) {
$results[$k][$t['model']] = $t[$t['model']];
}
}
}
return $results;
}
示例12: advisor_index
/**
* CCL002 - history answer advisor
*
* @return void
* @author huyenlt
**/
public function advisor_index()
{
$this->set('title_for_layout', '回答履歴一覧');
$advisorProfile = $this->AdvisorProfile->find('first', array('contain' => array('Advisor' => array('username'), 'AdvisorInterview' => array('id', 'AdvisorStat'), 'AdvisorRatingStat' => array('id', 'avg_rating')), 'fields' => array('id', 'image_url', 'fullname', 'point', 'public_flag'), 'conditions' => array('AdvisorProfile.id' => $this->Auth->user('id'))));
$conditions = array('DiscussionBid.delete_flag' => 0, 'OR' => array('DiscussionBid.complete_flag' => 1, 'DiscussionBid.order_flag' => array(3, 6)));
$dateNow = date('Y-m-d');
$this->Paginator->settings = array('fields' => array('DiscussionBid.rating', 'DiscussionBid.advisor_interview_id', 'DiscussionBid.complete_flag', 'DiscussionBid.discussion_id', 'DiscussionBid.advisor_bid_money', 'DiscussionBid.order_flag', 'AdvisorReview.id'), 'limit' => 20, 'contain' => array('Discussion' => array('fields' => 'title', 'delivery_date', 'complete_date', 'amount', 'business_field_id', 'id', 'complete_flag', 'user_id', 'BusinessField' => array('conditions' => 'Discussion.business_field_id = BusinessField.id', 'fields' => array('BusinessField.field_name', 'BusinessField.id')), 'UserProfile' => array('conditions' => 'Discussion.user_id = UserProfile.id', 'fields' => array('UserProfile.fullname', 'UserProfile.id', 'UserProfile.public_flag')))), 'joins' => array(array('table' => 'tb_advisor_interviews', 'alias' => 'AdvisorInterview', 'type' => 'INNER', 'conditions' => array('DiscussionBid.advisor_interview_id = AdvisorInterview.id', 'AdvisorInterview.delete_flag = 0', 'AdvisorInterview.advisor_id' => $this->Auth->user('id'))), array('table' => 'tb_advisor_reviews', 'alias' => 'AdvisorReview', 'type' => 'LEFT', 'conditions' => array('AdvisorReview.discussion_id = DiscussionBid.discussion_id', 'AdvisorReview.advisor_interview_id = DiscussionBid.advisor_interview_id', 'AdvisorReview.user_id = Discussion.user_id', 'AdvisorReview.review_direction_flag' => 1))), 'conditions' => $conditions);
$discussionBids = $this->Paginator->paginate('DiscussionBid');
$userProfileIds = Hash::extract($discussionBids, '{n}.Discussion.UserProfile.id');
$userNames = $this->User->find('list', array('fields' => array('username'), 'conditions' => array('User.id' => $userProfileIds)));
$discussionIds = Set::classicExtract($discussionBids, '{n}.Discussion.id');
$countUnopenedAnwsers = $this->DiscussionAnswer->find('all', array('joins' => array(array('table' => 'tb_advisor_interviews', 'alias' => 'AdvisorInterview', 'type' => 'INNER', 'conditions' => array('DiscussionAnswer.advisor_interview_id = AdvisorInterview.id', 'AdvisorInterview.delete_flag = 0', 'AdvisorInterview.advisor_id' => $this->Auth->user('id')))), 'contain' => array('DiscussionBid.order_flag'), 'conditions' => array('DiscussionAnswer.discussion_id' => $discussionIds, 'DiscussionAnswer.opened_flag' => 0, 'DiscussionAnswer.direction_flag' => 0, 'DiscussionBid.order_flag' => 1), 'fields' => array('DiscussionAnswer.discussion_id', 'COUNT(DiscussionAnswer.id) AS count_unopened'), 'group' => array('DiscussionAnswer.discussion_id'), 'recursive' => -1));
$countUnopenedAnwsers = Set::combine($countUnopenedAnwsers, '{n}.DiscussionAnswer.discussion_id', '{n}.0.count_unopened');
$this->set(compact('discussionBids', 'advisorProfile', 'countUnopenedAnwsers', 'userNames'));
}
示例13: admin_index
function admin_index()
{
$model = 'Mapa';
$this->set('model', $model);
$empresas = $this->Empresa->find('list', array('fields' => array('id', 'empresa'), 'conditions' => array('ativo' => 1)));
$this->set('empresas', $empresas);
$estado = $this->Estado->find('list', array('fields' => array('uf')));
$cidade = $this->Cidade->find('list', array('fields' => array('nome')));
$this->set(array('cidades' => $cidade, 'estados' => $estado));
///++++=====>>>> AREA DE BUSCA
///====================================================================
///====================================================================
/// Variáveis alocadas:
$array_conditions = array();
///====================================================================
/// ==> Find dos registros da categoria selecionada
if (!empty($this->request->data['filtro']['Empresas'])) {
$ids_empresas = '';
foreach ($this->request->data['filtro']['Empresas'] as $r) {
$ids_empresas = $ids_empresas . $r . ',';
}
$sql_manifestacao_id = "SELECT DISTINCT Mapa.id\n\t\t\t\t\t\t\t\tFROM tb_manifestacao as Mapa\n\t\t\t\t\t\t\t\tINNER JOIN\n\t\t\t\t\t\t\t\ttb_manifestacao_empresa as ME ON (ME.manifestacao_id=Mapa.id)\n\t\t\t\t\t\t\t\tINNER JOIN\n\t\t\t\t\t\t\t\ttb_empresas as Empresa ON (ME.empresa_id=Empresa.id) WHERE Empresa.id IN (" . substr_replace($ids_empresas, '', -1, 1) . ")";
$mapas = $this->{$model}->query($sql_manifestacao_id);
//////============>>>
//Desmontar Array
$manifestacoes_ids = Set::classicExtract($mapas, '{n}.Mapa.id');
/////////////////
array_push($array_conditions, array('Mapa.id' => $manifestacoes_ids));
}
/// ==> Find dos campo de busca
if (!empty($this->request->data['filtro']['busca'])) {
array_push($array_conditions, array('OR' => array('Mapa.local like "%' . $this->request->data['filtro']['busca'] . '%" ', 'Mapa.ponto_partida like "%' . $this->request->data['filtro']['busca'] . '%" ', 'Mapa.ponto_termino like "%' . $this->request->data['filtro']['busca'] . '%" ', 'Mapa.horario like "%' . $this->request->data['filtro']['busca'] . '%" ', 'Mapa.total_manifestantes like "%' . $this->request->data['filtro']['busca'] . '%" ', 'Mapa.txt_impacto like "%' . $this->request->data['filtro']['busca'] . '%" ')));
}
/// ==> Find dos campo de busca
if (!empty($this->request->data['filtro']['estado_id'])) {
array_push($array_conditions, array('Mapa.estado_id' => $this->request->data['filtro']['estado_id'], 'Mapa.cidade_id' => $this->request->data['filtro']['cidade_id']));
}
/// Verifica se existe algo na busca
if (!empty($array_conditions)) {
//echo 'aqui';
//print_r($array_conditions);
$this->paginate['conditions'] = $array_conditions;
}
///====================================================================
///====================================================================
$this->set('manifestacoes', $this->paginate($model));
}
示例14: find
public function find($type = 'first', $params = array())
{
$ret = null;
if (!CakeSession::check('TempItems')) {
return false;
}
$ret = CakeSession::read('TempItems');
if (isset($params['conditions'])) {
if (isset($params['conditions']['id'])) {
$id = $params['conditions']['id'];
if ($id == 0) {
$ret = Set::classicExtract($ret, "{$id}");
} else {
$ret = array(Set::classicExtract($ret, "{$id}"));
}
}
}
if (isset($params['order'])) {
if ($params['order'] == 'DESC') {
$ret = array_reverse($ret);
}
}
if ($ret == null) {
return false;
}
switch ($type) {
case 'first':
return $ret[0];
break;
case 'all':
return $ret;
break;
case 'list':
$ret2 = array();
// debug($ret);
foreach ($ret as $key => $val) {
$ret2[$key] = isset($val['tytul']) ? $val['tytul'] : '[Nowy wskaźnik]';
}
return $ret2;
break;
case 'count':
return count($ret);
break;
}
return false;
}
示例15: admin_index
function admin_index($categoria_id = null)
{
$model = 'Conteudo';
$this->set('model', $model);
$this->set('categoria_id', $categoria_id);
/// ==> Lista das Categorias existentes
$categorias = $this->Categoria->find('list', array('fields' => array('id', 'categoria')));
$setores = $this->Setor->find('list', array('fields' => array('id', 'setor'), 'conditions' => array('ativo' => 1)));
$this->set(array('categorias' => $categorias, 'setores' => $setores));
//print_r($this->request->data);
///++++=====>>>> AREA DE BUSCA
///====================================================================
///====================================================================
/// Variáveis alocadas:
$array_conditions = array();
///====================================================================
/// ==> Find dos registros de empresas selecionada
if (!empty($this->request->data['filtro']['Setores'])) {
$ids_setores = '';
foreach ($this->request->data['filtro']['Setores'] as $r) {
$ids_setores = $ids_setores . $r . ',';
}
$sql_conteudo_id = "SELECT DISTINCT Conteudo.id\n\t\t\t\t\t\t\t\tFROM tb_conteudo as Conteudo\n\t\t\t\t\t\t\t\tINNER JOIN\n\t\t\t\t\t\t\t\ttb_conteudo_setores as CE ON (CE.conteudo_id=Conteudo.id)\n\t\t\t\t\t\t\t\tINNER JOIN\n\t\t\t\t\t\t\t\ttb_setores as Setor ON (CE.setor_id=Setor.id) WHERE Setor.id IN (" . substr_replace($ids_setores, '', -1, 1) . ")";
$conteudos = $this->{$model}->query($sql_conteudo_id);
//////============>>>
//Desmontar Array
$conteudo_id = Set::classicExtract($conteudos, '{n}.Conteudo.id');
/////////////////
array_push($array_conditions, array('Conteudo.id' => $conteudo_id));
}
/// ==> Find dos registros da categoria selecionada
if (!empty($this->request->data['filtro']['categorias'])) {
array_push($array_conditions, array('Conteudo.categoria_id' => $this->request->data['filtro']['categorias']));
}
/// ==> Find dos campo de busca
if (!empty($this->request->data['filtro']['busca'])) {
array_push($array_conditions, array('OR' => array('Conteudo.titulo like "%' . $this->request->data['filtro']['busca'] . '%" ', 'Conteudo.texto like "%' . $this->request->data['filtro']['busca'] . '%" ')));
}
/// Verifica se existe algo na busca
if (!empty($array_conditions)) {
$this->paginate['conditions'] = $array_conditions;
}
///====================================================================
///====================================================================
$this->set('conteudos', $this->paginate($model));
}