Clever/clever-php — pull request #18 by fixedd (2014-08-07 16:57:27+00:00)
Title: Calling ->district() on a CleverSchool object results in a CleverObject object, not a CleverDistrict object.

This code:

$school = CleverSchool::retrieve('ABC123');
$district = $school->district();
var_dump($district);

results in:

object(CleverObject)#6 (3) {
["_auth":protected]=>
array(1) {
["apiKey"]=>
string(32) "ABC123"
}
["_values":protected]=>
array(3) {
["id"]=>
string(24) "123123123123123123"
["name"]=>
string(21) "#DEMO Sandbox"
["mdr_number"]=>
string(0) ""
}
["logger":protected]=>
object(Psr\Log\NullLogger)#7 (0) {
}
}

So, a CleverObject instead of the expected CleverDistrict.

I'm not sure if this pull request is the best solution to the problem, but it seems to have solved the problem for me.