Skip to content

Commit 5987b8f

Browse files
committed
Deprecate method on relationship helper trait.
1 parent 3823705 commit 5987b8f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/Validator/Helper/RelationshipTrait.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ trait RelationshipTrait
3434
*/
3535
abstract public function getKeyedRelationships();
3636

37+
/**
38+
* @param $key
39+
* @param $typeOrTypes
40+
* @param array $options
41+
* @return $this
42+
* @deprecated use `hasOne` instead
43+
*/
44+
public function belongsTo($key, $typeOrTypes, array $options = [])
45+
{
46+
return $this->hasOne($key, $typeOrTypes, $options);
47+
}
48+
3749
/**
3850
* Helper method to add a belongs to validator for the specified key.
3951
*
@@ -42,7 +54,7 @@ abstract public function getKeyedRelationships();
4254
* @param array $options
4355
* @return $this
4456
*/
45-
public function belongsTo($key, $typeOrTypes, array $options = [])
57+
public function hasOne($key, $typeOrTypes, array $options = [])
4658
{
4759
$relationships = $this->getKeyedRelationships();
4860

0 commit comments

Comments
 (0)