How do I get a field value? I am using the Business Hours module. It allows you to specify two time periods per day, for the 7 days of the week. So you could, for example, say: 9 t 1 Mondays to Fridays, and 2 - 5, Mondays to Fridays. 

My problem is getting access to these values as I need to expose it in a custom module. With print_r($node), I can see the following.

[field_office_hours] =&gt; Array(
  [x-default] =&gt; Array(
    [0] =&gt; Array(
      [day] =&gt; 0
      [starthours] =&gt; 900
      [endhours] =&gt; 1700
    )
    [1] =&gt; Array(
      [day] =&gt; 1
      [starthours] =&gt; 900
      [endhours] =&gt; 1700
    )
    /* Omissis */
  )
)


I have no idea how to get this as array. I know that the module requires the "Date" module, so these are probably Date fields, but how do I actually get the values as array?

$node-&gt;field_office_hours-&gt;value doesn't work.
Nevermind, this worked for me:

$node-&gt;get('field_office_hours')-&gt;getValue();