# |
Jul 1st 2018, 16:16 |
chris-andre |
@marceltbr Hard to tell what triggers the error from what you have told and posted. To use enum column type, I think you will need to use an adapter. |
# |
Jul 1st 2018, 16:11 |
slackebot4 |
->addIndex('username', ['unique' => true]) ->create(); }``` |
# |
Jul 1st 2018, 16:11 |
marceltbr |
```public function change() { $table = $this->table('users'); $table-> addColumn('first_name', 'string', ['limit' => 100]) ->addColumn('email', 'string', ['limit' => 100]) ->addColumn('password', 'string') ->addColumn('role', 'enum', ['values' => 'admin', 'user']) ->addColumn('active', 'boolean') ->addColumn('created', 'datetime') |
# |
Jul 1st 2018, 16:11 |
slackebot4 |
->addColumn('created', 'datetime') ->addIndex('username', ['unique' => true]) ->create(); }`` |
# |
Jul 1st 2018, 16:11 |
marceltbr |
My Migration class change() method is the following: ``public function change() { $table = $this->table('users'); $table-> addColumn('first_name', 'string', ['limit' => 100]) ->addColumn('email', 'string', ['limit' => 100]) ->addColumn('password', 'string') ->addColumn('role', 'enum', ['values' => 'admin', 'user']) ->addColumn('active', 'boolean') |
# |
Jul 1st 2018, 16:09 |
marceltbr |
`In Column.php line 622: "0" is not a valid column option` |
# |
Jul 1st 2018, 16:09 |
marceltbr |
Hi! I'm new to cakephp and I'm getting the following error while trying to run 'bin/cake migrations migrate' |
# |
Jul 1st 2018, 12:08 |
michaelze |
Hi everyone! I have a form that allows to modify certain fields of an entity and I want to validate some of the values against other fields of the entity which are not edited using the form (hence, they are not part of the posted and validated data). How would I best access these other fields? I need the same values from the entity on multiple validation rules... |
# |
Jun 29th 2018, 20:33 |
saeideng |
it is possible |
# |
Jun 29th 2018, 20:33 |
saeideng |
anyway for receiving deprecations in html (directly ) , you can disable deprecation panel in debug_kit |
# |
Jun 29th 2018, 20:31 |
saeideng |
I receive deprecation warning with `bin/cake server` |
# |
Jun 29th 2018, 20:31 |
saeideng |
but |
# |
Jun 29th 2018, 20:29 |
chrisshick |
just from bin/cake server and postman call |
# |
Jun 29th 2018, 20:28 |
camdenbassett |
Hello everyone. Is there a standard way to do a REPLACE INTO query using the query builder? I could just write some custom SQL, but if there's a way using the query builder then I think that might be better. |
# |
Jun 29th 2018, 20:19 |
saeideng |
on debug_kit ? |
# |
Jun 29th 2018, 20:19 |
chrisshick |
For some reason the deprecation doesn't show on my local machine XD |
# |
Jun 29th 2018, 20:18 |
chrisshick |
ahhh gotcha XD |
# |
Jun 29th 2018, 20:14 |
saeideng |
if you dont want to change that |
# |
Jun 29th 2018, 20:14 |
saeideng |
just do `return $value` |
# |
Jun 29th 2018, 20:14 |
saeideng |
exactly |
# |
Jun 29th 2018, 20:13 |
chrisshick |
ahh we have to use every method |
# |
Jun 29th 2018, 20:13 |
saeideng |
yes you have not `marshal()` method |
# |
Jun 29th 2018, 20:12 |
slackebot4 |
@param Driver $driver database driver * @return mixed|string */ public function toDatabase($value, Driver $driver) { return inet_pton($value); } /** * @param string $value statement value * @param Driver $driver database driver * @return int|mixed */ public function toStatement($value, Driver $driver) { return PDO::PARAM_LOB; } } ``` |
# |
Jun 29th 2018, 20:12 |
chrisshick |
``` <?php namespace App\Database\Type; use Cake\Database\Driver; use Cake\Database\Type; use PDO; class IpAddressType extends Type { /** * * @param mixed $value database value * @param Driver $driver database driver * @return bool|mixed|null|string */ public function toPHP($value, Driver $driver) { return inet_ntop($value); } /** * * @param string $value php value * |
# |
Jun 29th 2018, 20:11 |
chrisshick |
all I did was |
# |
Jun 29th 2018, 20:11 |
chrisshick |
yep |
# |
Jun 29th 2018, 20:11 |
saeideng |
can you post a text with your use case ? |
# |
Jun 29th 2018, 20:10 |
saeideng |
https://github.com/cakephp/cakephp/issues/12257 |
# |
Jun 29th 2018, 20:10 |
saeideng |
there are open issue about this |
# |
Jun 29th 2018, 20:09 |
saeideng |
you can not use base type with default body |
# |
Jun 29th 2018, 20:09 |
saeideng |
specify all methods |
# |
Jun 29th 2018, 20:08 |
saeideng |
or |
# |
Jun 29th 2018, 20:08 |
saeideng |
it say you must use one of class |
# |
Jun 29th 2018, 20:08 |
chrisshick |
My type is in specific calls |
# |
Jun 29th 2018, 20:07 |
saeideng |
> @deprecated 3.1 All types should now be a specific class |
# |
Jun 29th 2018, 20:02 |
chrisshick |
Type::_basicTypeCast() is deprecated |
# |
Jun 29th 2018, 20:02 |
chrisshick |
anyone getting deprecation error for core code?? |
# |
Jun 29th 2018, 20:00 |
chrispecoraro |
I don't understand how to instantiate the PaginatorHelper. |
# |
Jun 29th 2018, 19:52 |
chrispecoraro |
``` $this->PaginatorHelper = new PaginatorHelper(); $this->Paginator->settings = ['limit' => 10, 'recursive'=>-1];``` |
# |
Jun 29th 2018, 19:52 |
chrispecoraro |
And then I do this: |
# |
Jun 29th 2018, 19:51 |
chrispecoraro |
``` public function index(){ $this->Paginator->settings = ['limit' => 10, 'recursive'=>-1]; $this->renderView($this->Paginator->paginate('Employer')); } ``` |