# |
Jul 1st 2017, 15:19 |
admad |
https://crud-view.readthedocs.io/en/latest/basic-usage.html#id2 |
# |
Jul 1st 2017, 15:15 |
admad |
*blacklist |
# |
Jul 1st 2017, 15:14 |
admad |
black the field so that it's not shown on form |
# |
Jul 1st 2017, 15:14 |
admad |
why are even changing modified field yourself? It's supposed to be handled by timestamp behavior |
# |
Jul 1st 2017, 15:11 |
pidlo |
ok admad i look for this in bootstrap |
# |
Jul 1st 2017, 15:10 |
pidlo |
but i dont know if is the best reason for this |
# |
Jul 1st 2017, 15:09 |
pidlo |
I found it $event->getSubject()->entity->modified = date( 'Y-m-d', strtotime($event->getSubject()->entity->modified) ); |
# |
Jul 1st 2017, 15:06 |
admad |
As i already told you earlier db types are configured in bootsrap. |
# |
Jul 1st 2017, 15:00 |
pidlo |
https://gist.github.com/anonymous/39deb8e1225c78ef0e7cfbaa8408292d |
# |
Jul 1st 2017, 14:56 |
pidlo |
please help me i try change date format in view i use friendsofcake crud and view i set d.m.y i view but in before save method i have d.m.y but except Y-m-d timestamp for database.. |
# |
Jul 1st 2017, 14:23 |
pidlo |
App\Controller\AppController cannot use Cake\Database\Type - it is not a trait |
# |
Jul 1st 2017, 14:23 |
pidlo |
hello where i can convert locale date in save record i add use \Cake\Database\Type; in appcontroller but i get error |
# |
Jul 1st 2017, 14:21 |
glanceded |
I found out that binary 16 is less performant than char 36. would cake be faster with binary than char, even if the db performs worse? I meanL maybe the binary type it would be more simple for cake to parse than char. You class is really slim. I see this class https://github.com/cakephp/cakephp/blob/master/src/Database/Type/BinaryType.php . Wouldn't be there a conflict if I create my own Binary type? |
# |
Jul 1st 2017, 14:17 |
glanceded |
@dereuromark Can I test your solution? It would work with Binary 16? |
# |
Jul 1st 2017, 14:16 |
glanceded |
@dereuromark Interesting solution |
# |
Jul 1st 2017, 14:15 |
glanceded |
@admad It works perfect now |
# |
Jul 1st 2017, 13:49 |
dereuromark |
I think that one was more for normal binary blob data :slightly_smiling_face: |
# |
Jul 1st 2017, 13:49 |
dereuromark |
binary16 would be best, but you would need to write your own type class here. I once tried https://github.com/dereuromark/cakephp-shim/blob/master/src/Database/Type/BinaryType.php not sure if it is actually still working though.. |
# |
Jul 1st 2017, 13:39 |
glanceded |
ok, thanks a lot, I will give it a try |
# |
Jul 1st 2017, 13:39 |
admad |
yes it will |
# |
Jul 1st 2017, 13:39 |
admad |
so either native uid type (postgres) or char 36 for mysql etc |
# |
Jul 1st 2017, 13:39 |
glanceded |
and it will create the uuid by it self if I set the collumn as char 36? |
# |
Jul 1st 2017, 13:38 |
admad |
@glanceded you need to use the field type that cakephp supports |
# |
Jul 1st 2017, 13:38 |
glanceded |
right now I'm creating the uuid manually |
# |
Jul 1st 2017, 13:38 |
glanceded |
In addition to use an auto-increment key as the primary key, you may also use UUID columns. CakePHP will create a unique 36 character UUID (Cake\Utility\Text::uuid()) whenever you save a new record using the Table::save() method. |
# |
Jul 1st 2017, 13:38 |
glanceded |
Yes , I respect the conventions, but I don't understand this p |
# |
Jul 1st 2017, 13:34 |
glanceded |
the problem is only on my subscriptions table, as I have more tables with guids and they work well |
# |
Jul 1st 2017, 13:34 |
cleptric |
> $user |
# |
Jul 1st 2017, 13:33 |
glanceded |
char 36 is less in size than binary 36? |
# |
Jul 1st 2017, 13:33 |
cleptric |
Should be `CHAR(36)` AFAIR |
# |
Jul 1st 2017, 13:32 |
glanceded |
$this->setDisplayField('guid'); $this->setPrimaryKey('guid'); |
# |
Jul 1st 2017, 13:32 |
glanceded |
binary 36 |
# |
Jul 1st 2017, 13:32 |
admad |
what's the field type for gui in db? |
# |
Jul 1st 2017, 13:31 |
cleptric |
I guid your primary key? |
# |
Jul 1st 2017, 13:29 |
glanceded |
in db the guids are ok |
# |
Jul 1st 2017, 13:29 |
glanceded |
all of my fields are accesibile |
# |
Jul 1st 2017, 13:29 |
glanceded |
why the guid is a resource |
# |
Jul 1st 2017, 13:28 |
slackebot |
{ 'time' => '2017-07-01T13:06:12+00:00', 'timezone' => 'UTC', 'fixedNowTime' => false } ] |
# |
Jul 1st 2017, 13:28 |
glanceded |
[ 'guid' => resource, 'plan_id' => (int) 1, 'next_plan_id' => null, 'next_customer_token' => null, 'expiry' => object(Cake\I18n\FrozenTime) { 'time' => '2017-07-15T13:06:11+00:00', 'timezone' => 'UTC', 'fixedNowTime' => false }, 'transaction_guid' => null, 'created' => object(Cake\I18n\FrozenTime) { 'time' => '2017-07-01T13:06:12+00:00', 'timezone' => 'UTC', 'fixedNowTime' => false }, 'modified' => object(Cake\I1 |
# |
Jul 1st 2017, 13:28 |
glanceded |
the result is this |
# |
Jul 1st 2017, 13:28 |
glanceded |
thanks for that, I found out that find("first") doesn't exists anymore |