This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
indIEDest = 2 | |
try: | |
inv.partner_id.inscr_est | |
indIEDest = 1 | |
except NameError: | |
indIEDest = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# i dont know if inv.partner_id.inscr_est is set | |
if inv.partner_id.inscr_est: | |
indIEDest = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function add() | |
{ | |
$userId = null; | |
$client = $this->Clients->newEntity(); | |
$client = $this->Clients->patchEntity($client, $this->request->data); | |
if ($this->request->is('post')) { | |
$user = $this->Clients->User->newEntity(); | |
$user->role_id = 2; | |
$user->username = $this->request->data['cnpj']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# ClientsController | |
# | |
# I have this Client table, and User table, need to create a user(login/password) when creating a client | |
# | |
public function add() { | |
$client = $this->Clients->newEntity(); | |
if ($this->request->is('post')) { | |
$client = $this->Clients->patchEntity($client, $this->request->data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# ClientsController | |
# | |
public function add() | |
{ | |
$client = $this->Clients->newEntity(); | |
if ($this->request->is('post')) { | |
$this->request->data['user'] = [ 'username' => 'teste', 'password' => 'teste' ]; | |
debug($this->request->data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function index() | |
{ | |
$this->paginate = [ | |
'contain' => ['Roles'] | |
]; | |
$this->set('users', $this->paginate($this->Users)); | |
$this->set('_serialize', ['users']); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object(Cake\ORM\Query) { | |
'sql' => 'SELECT PriceLists.description AS `PriceLists__description` FROM price_lists PriceLists', | |
'params' => [], | |
'defaultTypes' => [ | |
'PriceLists.id' => 'integer', | |
'id' => 'integer', | |
'PriceLists.description' => 'string', | |
'description' => 'string', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$priceLists = $this->Products->PriceLists->find('list', array('fields' => 'description')); | |
debug($priceLists); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
public function view($category = null ,$slug = null) { | |
if (! $slug) { | |
$this->Flash->success ( 'Invalid id for Product' ); | |
$this->redirect ( '/products' ); | |
} | |
$query = $this->Products->find()->where( | |
[ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
public function view($category = null ,$slug = null) { | |
if (! $slug) { | |
$this->Flash->success ( 'Invalid id for Product' ); | |
$this->redirect ( '/products' ); | |
} | |
$query = $this->Products->find()->where( | |
[ |