# |
Jul 17th 2019, 18:07 |
tmig |
I'll look at it, htank you |
# |
Jul 17th 2019, 18:02 |
graziel |
https://book.cakephp.org/3.0/en/orm/query-builder.html#custom-functions |
# |
Jul 17th 2019, 18:00 |
tmig |
I'm keeping reading the docs, but cannot figure out how to INSTR or TIMESTAMPDIFF |
# |
Jul 17th 2019, 17:59 |
tmig |
I'm looking for the way to make a INSTR in the cake ORM, can anybody help me do that ? |
# |
Jul 17th 2019, 17:58 |
tmig |
Hi all |
# |
Jul 17th 2019, 17:41 |
dereuromark |
throttling probably. see awesome list for this |
# |
Jul 17th 2019, 17:40 |
graziel |
what do you mean by 'secure'? |
# |
Jul 17th 2019, 17:35 |
maxxstyle06 |
Guys what is best way to secure an api that is public and that do not requires authentication ?? |
# |
Jul 17th 2019, 15:44 |
neon1024 |
Ah, it’s me being a spanner. Declare the connection config in the constructor, not in initialize :face_palm: :rubberduck: |
# |
Jul 17th 2019, 15:42 |
neon1024 |
:S |
# |
Jul 17th 2019, 15:42 |
neon1024 |
`var_dump(ConnectionManager::configured())` shows an array of two sources called `default` and `test`, but dumping the instances `var_dump($this->Calls->getConnection())` shows `NULL` |
# |
Jul 17th 2019, 15:41 |
neon1024 |
My datasource app config has a correctly configured `test` source |
# |
Jul 17th 2019, 15:40 |
neon1024 |
`$this->Calls->initialize(['connection' => ConnectionManager::get('test')]);` |
# |
Jul 17th 2019, 15:40 |
neon1024 |
Which leads to `$this->getConnection()` returning `null` in `Table.php`, however I’ve added a connection instance to the config when running `initialize` |
# |
Jul 17th 2019, 15:39 |
neon1024 |
However I encounter `Error: Call to a member function getSchemaCollection() on null` |
# |
Jul 17th 2019, 15:39 |
neon1024 |
I’d like to unit test that my table class has the correct data type set to the schema |
# |
Jul 17th 2019, 14:59 |
neon1024 |
Have a great day @scuadra |
# |
Jul 17th 2019, 14:59 |
itmpls |
Did you figure it out? |
# |
Jul 17th 2019, 14:58 |
scuadra |
I really appreciate everyone's help. Have a nice day |
# |
Jul 17th 2019, 13:58 |
scuadra |
I posted the wrong snippet |
# |
Jul 17th 2019, 13:58 |
scuadra |
but they are protected |
# |
Jul 17th 2019, 13:58 |
scuadra |
my mistake |
# |
Jul 17th 2019, 13:58 |
scuadra |
oh, sorry |
# |
Jul 17th 2019, 13:57 |
neon1024 |
The one you pasted is `public` |
# |
Jul 17th 2019, 13:56 |
scuadra |
yes, they are |
# |
Jul 17th 2019, 13:48 |
neon1024 |
Aren’t they `protected` ? |
# |
Jul 17th 2019, 13:47 |
scuadra |
I don't know if this helps but it seems that setters are not Working at all |
# |
Jul 17th 2019, 13:41 |
itmpls |
hm I can't spot anything off if you say it's like that |
# |
Jul 17th 2019, 13:40 |
scuadra |
so maybe the Entity is in the right place |
# |
Jul 17th 2019, 13:40 |
scuadra |
and I got the website of the member |
# |
Jul 17th 2019, 13:40 |
scuadra |
and after $user = $this->Members->get($this->Auth->user('id')); I did --> dd($user->get('website')); |
# |
Jul 17th 2019, 13:39 |
scuadra |
and I created _getWebsite() method in the Entity which returns the website |
# |
Jul 17th 2019, 13:39 |
scuadra |
for example I have field website |
# |
Jul 17th 2019, 13:35 |
scuadra |
namespace App\Model\Entity; use Cake\Auth\DefaultPasswordHasher; use Cake\ORM\Entity; class Member extends Entity { public function _setPassword($password) { if (strlen($password) > 0) { return (new DefaultPasswordHasher)->hash($password); } } } |
# |
Jul 17th 2019, 13:34 |
scuadra |
here are the contents |
# |
Jul 17th 2019, 13:34 |
scuadra |
it's in app/src/Model/Entity |
# |
Jul 17th 2019, 13:34 |
itmpls |
clearly something is off |
# |
Jul 17th 2019, 13:34 |
itmpls |
directory, namespace, class name |
# |
Jul 17th 2019, 13:33 |
scuadra |
@itmpls the filename is Member.php |
# |
Jul 17th 2019, 13:33 |
itmpls |
@scuadra ? |
# |
Jul 17th 2019, 13:32 |
itmpls |
what is the filename, and directory and class name and namespace? |