Log message #4181107

# At Username Text
# Mar 27th 2019, 16:04 alexdd55 :face_palm:
# Mar 27th 2019, 16:04 alexdd55 why so ever.. solution is easy
# Mar 27th 2019, 16:03 alexdd55 `implode('|', $object->toArray())`
# Mar 27th 2019, 16:03 cnizzardini What are you trying to accomplish
# Mar 27th 2019, 16:03 cnizzardini Why do you need this?
# Mar 27th 2019, 16:03 alexdd55 oh… i got it
# Mar 27th 2019, 16:03 cnizzardini Though it depends on the use cases
# Mar 27th 2019, 16:02 cnizzardini ^
# Mar 27th 2019, 16:02 neon1024 Full text search I mean, although I’d probably look at a specific solution for it like Elasticsearch
# Mar 27th 2019, 16:02 neon1024 Although there is probably a plugin for this kind of thing
# Mar 27th 2019, 16:02 neon1024 Or just as @cnizzardini said, add a mutation method or implement toString
# Mar 27th 2019, 16:01 alexdd55 i could iterate over the object, i hoped that there is some easier way to do that
# Mar 27th 2019, 16:01 neon1024 :man-shrugging:
# Mar 27th 2019, 16:01 neon1024 `array_keys($entity->toArray())`
# Mar 27th 2019, 16:01 alexdd55 then i got the keys.. not the values…
# Mar 27th 2019, 16:01 neon1024 Might be `->getSchema()` let me check
# Mar 27th 2019, 16:01 neon1024 ..using the Table instance
# Mar 27th 2019, 16:00 neon1024 So if you want entity keys, you can inspect the schema
# Mar 27th 2019, 16:00 cnizzardini just iterate over the array and append to a string
# Mar 27th 2019, 16:00 cnizzardini this sounds like custom code, not really specific to cakephp
# Mar 27th 2019, 16:00 alexdd55 ```App\Model\Entity\Organization Object ( [id] => 2034 [company_id] => 65 [organizationtype_id] => 4 [name] => Kreuznacher Stadtwerke [description] => [zip] => 55543 [city] => Bad Kreuznach [latitude] => 0 [longitude] => 0 [phone] => [mobile] => [email] => [website] => ```
# Mar 27th 2019, 16:00 cnizzardini i think at least
# Mar 27th 2019, 15:59 cnizzardini You can override it
# Mar 27th 2019, 15:59 alexdd55 also adds the keys
# Mar 27th 2019, 15:59 cnizzardini https://www.php.net/manual/en/language.oop5.magic.php#object.tostring
# Mar 27th 2019, 15:58 cnizzardini __toString()
# Mar 27th 2019, 15:57 neon1024 Or at least, what’s the object you’re inspecting?
# Mar 27th 2019, 15:57 alexdd55 fulltext search approach
# Mar 27th 2019, 15:57 neon1024 What’s the feature?
# Mar 27th 2019, 15:57 neon1024 Why do you need that?
# Mar 27th 2019, 15:56 alexdd55 i want to build a string with all values of an object (no keys)
# Mar 27th 2019, 15:56 neon1024 Sounds like XY to me. What is it you’re actually trying to do?
# Mar 27th 2019, 15:56 neon1024 Then there are no non-static or public properties
# Mar 27th 2019, 15:55 alexdd55 @neon1024 its empty, thats why i am asking
# Mar 27th 2019, 15:52 alexdd55 or more direct: is there a way to get all values of an object, do not need the keys
# Mar 27th 2019, 15:52 neon1024 https://www.php.net/manual/en/function.get-object-vars.php
# Mar 27th 2019, 15:51 alexdd55 is there a way to get all “keys” of an object?
# Mar 27th 2019, 15:34 cnizzardini the -o helped a lot
# Mar 27th 2019, 15:30 cnizzardini Reading the docs, I think you meant -o
# Mar 27th 2019, 15:29 cnizzardini furthmore, when running `bin/cake upgrade skeleton -f /var/www/my-app` it fails with `Error: Unknown short option `f``
# Mar 27th 2019, 15:28 slackebot2 Cake\Console\ShellDispatcher->_dispatch(Array) #7 /var/www/personal/upgrade/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(128): Cake\Console\ShellDispatcher->dispatch(Array) #8 /var/www/personal/upgrade/bin/cake.php(21): Cake\Console\ShellDispatcher::run(Array) #9 {main}