miércoles, 8 de mayo de 2013

cakephp: condition OR most basic

        $recipients = $this->Client->Recipient->find('list', array(
            'conditions' => array(
                'OR' => array(
                    array('Recipient.client_id' => $id),
                    array('Recipient.client_id' => null),
                )
            ),
            'order' => 'name'
                ));

db: add constraint para evitar/remover duplicados

ALTER IGNORE TABLE asistencias ADD UNIQUE INDEX idx_date_empl(as_date, employee_id );