I am using PHP with an active php entry. When I retrieve a record from the database, the attributes are listed as private. I need to iterate over the attributes and get a key => value pair. How can this be done?
$row = \Models\Locations::find(2); Models\Locations Object ( [errors] => [attributes:ActiveRecord\Model:private] => Array ( [id] => 2 [customer_id] => 6 [name] => test location [address_line1] => 123 test Drive [address_line2] => [city] => Moon Township [state] => AZ [zip] => 12345 [country] => USA [primary_phone_number] => 123.456.7890 [latitude] => 0 [longitude] => 0 [coordinate_precision] => ) [__dirty:ActiveRecord\Model:private] => Array ( ) [__readonly:ActiveRecord\Model:private] => [__relationships:ActiveRecord\Model:private] => Array ( ) [__new_record:ActiveRecord\Model:private] => )
source share