# |
May 1st 2019, 15:46 |
neon1024 |
Lucky you’re in Cake 2 then! |
# |
May 1st 2019, 15:46 |
neothermic |
I do enjoy typehinting things that PHPStorm is unaware about, like the result of Guzzle's Promise\unwrap :) |
# |
May 1st 2019, 15:46 |
admad |
Fatal error: enough grey matter not found :P |
# |
May 1st 2019, 15:45 |
neon1024 |
Syntax error. |
# |
May 1st 2019, 15:45 |
neothermic |
`/** @var MaybeHumanInterface $neon1024 */` |
# |
May 1st 2019, 15:45 |
neon1024 |
How rude. I at least implement HumanBeingInterface and PSR8 |
# |
May 1st 2019, 15:44 |
neothermic |
`/** @var object $neon1024 */` |
# |
May 1st 2019, 15:40 |
neon1024 |
Ahh, just needed a typehint! |
# |
May 1st 2019, 15:39 |
neon1024 |
Lazy perhaps, but `$query->count()` is a thing right? As `count($query->toArray())` seem silly, and I was certain that ResultSet implemented Collection, either trait or interface |
# |
May 1st 2019, 14:44 |
mrgrimpy |
thank you |
# |
May 1st 2019, 14:44 |
mrgrimpy |
ok |
# |
May 1st 2019, 14:39 |
admad |
There isn't |
# |
May 1st 2019, 14:29 |
mrgrimpy |
Is there a way to prevent the whitespaces and \n in the generated key? |
# |
May 1st 2019, 14:27 |
mrgrimpy |
Good morning, I have a question concerning the bin/cake bake i18n command and the way I format the translation IDs. If I do: <p> </p> |
# |
May 1st 2019, 13:45 |
devito |
thanks |
# |
May 1st 2019, 13:45 |
neon1024 |
https://github.com/cakephp/docs/blob/3.0/en/orm/entities.rst |
# |
May 1st 2019, 13:44 |
neon1024 |
You can either browse the 3.next docs, or read the docs on github |
# |
May 1st 2019, 13:44 |
devito |
https://book.cakephp.org/3.0/en/orm/entities.html |
# |
May 1st 2019, 13:44 |
devito |
yeah sorry ment the cookbook |
# |
May 1st 2019, 13:43 |
slackebot |
https://www.facebook.com/CakePHP/posts/10158433586508135?__xts__[0]=68.ARBntP4IpOStJlFTvmOFQdD9cb6f3kFQd12uPPTOm4IQCoG-TQV2Y3orLzhRpnntz1EBptjAqF8IWNjkqmn51Wg_sz8qqIzCYqsFj7R7QANIkup5UdeT7QsNgEihGjJh-G-_uvCC7K-T-bqXyER0oKp-hq7dI64cZX9Q_HcZvFLD47LYK7lex-OfUIj5DmsqPx8q6ReYTh86qty-JaoneATlTdmo5T2LDDMMikpuPUUXEP46Ct9jTrgrMD31nxIpm-cdibUtbhOKT8GvOUccNesqC0DJBBS35RtjACocEAZTDM8qCll88cDywlnzM2xgGa3rRmeoQ-EaKwq7Tsxuand__tn__=-R |
# |
May 1st 2019, 13:43 |
neon1024 |
The book is down currently though, |
# |
May 1st 2019, 13:42 |
neon1024 |
Er, it’s up for me |
# |
May 1st 2019, 13:42 |
devito |
where did cakephp.org go? |
# |
May 1st 2019, 13:23 |
noel |
Plugins can also suit a micro-services architecture quite well because it (more-or-less) creates a black-box. |
# |
May 1st 2019, 13:21 |
neon1024 |
No harm in splitting up functionality into plugins though, but it will add some overhead for maintaining things as you’ll have to remember plugin prefixes and such everywhere |
# |
May 1st 2019, 13:20 |
neon1024 |
@maymeow Also worth remembering that without routing configuration plugins will add a plugin prefix to your routes |
# |
May 1st 2019, 13:17 |
noel |
If you’re looking for re-use within a single project then you should be looking at Components and Behaviours |
# |
May 1st 2019, 13:16 |
noel |
@maymeow my understanding that the point of plugins is re-usability across projects. So if you’re only needing this code for a single project, there’s no reason to make it a plugin. |
# |
May 1st 2019, 13:11 |
maymeow |
hmm maybe stupid question but i trying to read some "best practices for cakephp" and where to put business logic and im curious what about Plugins? When to use it and when its dont necessary? For example lets say im creating blog .. its better to create Blog plugin or put NodesController right in src? |
# |
May 1st 2019, 13:03 |
neon1024 |
Threading, I meant |
# |
May 1st 2019, 13:01 |
neon1024 |
If you need more levels, nesting and such you might consider the Tree behaviour though |
# |
May 1st 2019, 13:00 |
neon1024 |
Hope this helps :thumbsup: |
# |
May 1st 2019, 13:00 |
neon1024 |
Which’ll be an array of `ContentEntity` |
# |
May 1st 2019, 12:59 |
neon1024 |
The property will be ’$contentEntity->get(‘children’)` |
# |
May 1st 2019, 12:59 |
neon1024 |
Should probably be ‘Parents’ on looking at it again :man-shrugging: |
# |
May 1st 2019, 12:58 |
neon1024 |
Then you can inverse it with a hasMany too like `$this->Contents->find()->contain(['Children']);` |
# |
May 1st 2019, 12:58 |
slackebot |
<neon1024> |
# |
May 1st 2019, 12:58 |
neon1024 |
So I can do `$this->Contents->find()->contain(['Parent']);` |
# |
May 1st 2019, 12:57 |
neon1024 |
For example, I have this in my `ContentsTable` |
# |
May 1st 2019, 12:57 |
slackebot |
<neon1024> |
# |
May 1st 2019, 12:57 |
neon1024 |
@noel You can create an association which just specifies all the options, and set them to the same table. The main thing to remember is that the Aliased name of the table will be how you refer to it. |