所以这是一个完全愚蠢的初学者问题,但是我花了很多时间来调查正在发生的事情,而且我完全没有更多的想法。
我正在尝试从CellLineRepository中获取名为“ Cell”的对象的私有值。吸气剂正在工作,它们正在另一个地方使用。
这是我的foreach的外观:
$all_cell_lines = CellLineRepository::findAll();
$allcells = [];
foreach ($all_cell_lines as $cell) {
$allcells[] = [
"CellID" => $cell->getId(),"iPSC-ID" => $cell->getIpscId(),"Lab-ID" => $cell->getLabId(),"altID" => $cell->getaltId(),"project" => $cell->getProject()
];
var_dump($allcells);
}
var_dump()
中的$all_cell_lines
看起来不错,但是我丢失了“ iPSC-ID”和“ Lab-ID”。
object(CellLine)#9 (79) {
[
"id": "CellLine":private
]=>
string(1) "1"
[
"created_date": "CellLine":private
]=>
string(10) "2019-05-22"
[
"created_by": "CellLine":private
]=>
string(3) "314"
[
"last_modified_date": "CellLine":private
]=>
string(10) "2019-11-22"
[
"last_modified_by": "CellLine":private
]=>
string(3) "301"
[
"tab_type": "CellLine":private
]=>
string(8) "internal"
[
"lab_id": "CellLine":private
]=>
string(5) "xxx"
[
"alt_id": "CellLine":private
]=>
string(7) "xxx"
[
"provider": "CellLine":private
]=>
string(36) "xxx"
var_dump()
中的$allcells
看起来像这样:
array(1) {
[
0
]=>
array(5) {
[
"CellID"
]=>
string(1) "1"
[
"iPSC-ID"
]=>
string(0) ""
[
"Lab-ID"
]=>
string(0) ""
[
"altID"
]=>
string(7) "xxx"
[
"project"
]=>
string(3) "xxx"
}
}
有人有线索吗?