$posts = $em->find('Application\BlogBundle\Entity\Post',1);
print_r ($posts);
Run Code Online (Sandbox Code Playgroud)
我为什么得到它?
Barii\BlogBundle\Entity\Post Object ( [id:Barii\BlogBundle\Entity\Post:private] => 1 [title:Application\BlogBundle\Entity\Post:private] => something [body:Application\BlogBundle\Entity\Post:private] => content )
Run Code Online (Sandbox Code Playgroud)
而不是像这样的简单数组:
array ( [id] => 1,
[title] => "something",
[body] => "content" )
Run Code Online (Sandbox Code Playgroud)
我在Symfony 2中使用它.
我正在尝试理解此代码:https : //github.com/CameronAavik/AdventOfCode/blob/master/Challenges/2018/Day03.fs
但我找不到有关此“放一些东西(...){...} = ...”语法的任何信息,例如:
let processBoundary (prevY, claimSet, total) {cursor=cursor; isAdding=isAdding; data=(top, height)} = ...
Run Code Online (Sandbox Code Playgroud)
这是什么?让我想起元组和破坏性结构,但事实并非如此。
谢谢