title: How to get tablename from Event in Behavior
body: <p>I'm writing a behavior in CakePHP 3.0.11, and I can var_dump() and Log::debug() the $event object in my behavior's beforeSave() method, and can see the object data, but cannot access the object's properties.
  I am simply trying to get the table (alias, className, tablename, anything) name from the object.<br>
  I would like to do something like this in my Behavior:</p>
  
  <pre><code>public function beforeSave(Event $event, Entity $entity)
  {
      $table = $event-&gt;_alias;
      // etc.
  }
  </code></pre>
  
  <p>I tried the event's subject() method which extracts the table object from the event, </p>
  
  <pre><code>$table = $event-&gt;subject();
  </code></pre>
  
  <p>When I var_dump or debug the object returned, it shows:</p>
  
  <pre><code>Debug: App\Model\Table\CompaniesTable Object
  (
      [registryAlias] =&gt; Companies
      [table] =&gt; companies
      [alias] =&gt; Companies
      [entityClass] =&gt; App\Model\Entity\Company
      [associations] =&gt; Array
          (
              [0] =&gt; defaultshippingusers
      (...)
      [defaultConnection] =&gt; default
      [connectionName] =&gt; default
  )
  </code></pre>
  
  <p>But I cannot access 'table', 'alias', etc. from my $table object.
  When I do, I get a fatal error:</p>
  
  <blockquote>
    <p>Table Companies is not associated with 'alias'</p>
  </blockquote>
  
  <p>Is there a simple way to get the Table name from the $event object in a behavior?</p>