Skip to content
Permalink
Browse files

Rename AssociationCollection::type() to AssociationCollection::getByT…

…ype()

Closes #11220
  • Loading branch information...
ADmad committed Sep 21, 2017
1 parent 46f7e4a commit 2db733604b0502116d4f59a74fa754bd1a450cad
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/ORM/AssociationCollection.php
@@ -114,8 +114,22 @@ public function keys()
* @param string|array $class The type of associations you want.
* For example 'BelongsTo' or array like ['BelongsTo', 'HasOne']
* @return array An array of Association objects.
* @deprecated 3.6.0 Use getByType() instead.
*/
public function type($class)
{
return $this->getByType($class);
}
/**
* Get an array of associations matching a specific type.
*
* @param string|array $class The type of associations you want.
* For example 'BelongsTo' or array like ['BelongsTo', 'HasOne']
* @return array An array of Association objects.
* @since 3.5.3
*/
public function getByType($class)
{
$class = array_map('strtolower', (array)$class);

0 comments on commit 2db7336

Please sign in to comment.
You can’t perform that action at this time.