Skip to content
Permalink
Browse files

Make debugInfo methods more resilient.

Make the debugInfo methods for ORM\Table and ORM\Query not fail when
they are used on partially complete objects.

Refs #7290
  • Loading branch information...
markstory committed Sep 16, 2015
1 parent 4216736 commit d0683081f6936c0419209459d11803526a61d2e2
Showing with 6 additions and 4 deletions.
  1. +2 −2 src/ORM/Query.php
  2. +4 −2 src/ORM/Table.php
@@ -826,8 +826,8 @@ public function __debugInfo()
'buffered' => $this->_useBufferedResults,
'formatters' => count($this->_formatters),
'mapReducers' => count($this->_mapReduce),
'contain' => $eagerLoader->contain(),
'matching' => $eagerLoader->matching(),
'contain' => $eagerLoader ? $eagerLoader->contain() : [],
'matching' => $eagerLoader ? $eagerLoader->matching() : [],
'extraOptions' => $this->_options,
'repository' => $this->_repository
];
@@ -2203,13 +2203,15 @@ public function buildRules(RulesChecker $rules)
public function __debugInfo()
{
$conn = $this->connection();
$associations = $this->_associations ?: false;
$behaviors = $this->_behaviors ?: false;
return [
'registryAlias' => $this->registryAlias(),
'table' => $this->table(),
'alias' => $this->alias(),
'entityClass' => $this->entityClass(),
'associations' => $this->_associations->keys(),
'behaviors' => $this->_behaviors->loaded(),
'associations' => $associations ? $associations->keys() : false,
'behaviors' => $behaviors ? $behaviors->loaded() : false,
'defaultConnection' => $this->defaultConnectionName(),
'connectionName' => $conn ? $conn->configName() : null
];

0 comments on commit d068308

Please sign in to comment.
You can’t perform that action at this time.