Cake\ORM\Table::associations PHP Method

associations() public method

Get the associations collection for this table.
public associations ( ) : Cake\ORM\AssociationCollection
return Cake\ORM\AssociationCollection The collection of association objects.
    public function associations()
    {
        return $this->_associations;
    }

Usage Example

Example #1
1
 /**
  * Get the array of junction aliases for all the BelongsToMany associations
  *
  * @param Table $table Table
  * @return array junction aliases of all the BelongsToMany associations
  */
 public function belongsToManyJunctionAliases(Table $table)
 {
     $extractor = function ($val) {
         return $val->junction()->alias();
     };
     return array_map($extractor, $table->associations()->type('BelongsToMany'));
 }
All Usage Examples Of Cake\ORM\Table::associations