To make this method a little easier, I wrap the access to the variable in a second function that takes a configuration key name and a default value, as shown below.
为使这个方法更加简单,将对变量的访问封装在第二个函数中,该函数使用配置键名及一个缺省值作为参数,如下所示。
The simplest way to access persistent data is by using the find method. Here is an example of an application using the entity manager to find an object by its primary key.
最简单的访问持久性数据的方法是使用find方法。
In all cases, the return value of the method can be processed using a foreach loop, and you can also access specific values by key as needed.
所有方法的返回值都可用foreach循环来处理,需要的话也可按键访问特定的值。
应用推荐