Skip to content

Commit 0543b46

Browse files
committed
Did some renames of methods
1 parent 0ef31ae commit 0543b46

File tree

3 files changed

+38
-4
lines changed

3 files changed

+38
-4
lines changed

CHANGELOG.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
- `prependTo` to `prependToNode`
77
- `insertBefore` to `insertBeforeNode`
88
- `insertAfter` to `insertAfterNode`
9+
- `getNext` to `getNextNode`
10+
- `getPrev` to `getPrevNode`
911

1012
### 3.1.1
1113

src/Node.php

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Node extends Model
2121
* @param Node $parent
2222
*
2323
* @return $this
24-
*
24+
*
2525
* @deprecated since 4.1
2626
*/
2727
public function appendTo(self $parent)
@@ -65,6 +65,30 @@ public function insertAfter(self $node)
6565
return $this->insertAfterNode($node);
6666
}
6767

68+
/**
69+
* @param array $columns
70+
*
71+
* @return self|null
72+
*
73+
* @deprecated since 4.1
74+
*/
75+
public function getNext(array $columns = [ '*' ])
76+
{
77+
return $this->getNextNode($columns);
78+
}
79+
80+
/**
81+
* @param array $columns
82+
*
83+
* @return self|null
84+
*
85+
* @deprecated since 4.1
86+
*/
87+
public function getPrev(array $columns = [ '*' ])
88+
{
89+
return $this->getPrevNode($columns);
90+
}
91+
6892
/**
6993
* @return string
7094
*/

src/NodeTrait.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -833,21 +833,29 @@ public function getParentId()
833833
}
834834

835835
/**
836-
* @param array $columns
836+
* Returns node that is next to current node without constraining to siblings.
837+
*
838+
* This can be either a next sibling or a next sibling of the parent node.
839+
*
840+
* @param array $columns
837841
*
838842
* @return self
839843
*/
840-
public function getNext(array $columns = array( '*' ))
844+
public function getNextNode(array $columns = array( '*' ))
841845
{
842846
return $this->nextNodes()->first($columns);
843847
}
844848

845849
/**
850+
* Returns node that is before current node without constraining to siblings.
851+
*
852+
* This can be either a prev sibling or parent node.
853+
*
846854
* @param array $columns
847855
*
848856
* @return self
849857
*/
850-
public function getPrev(array $columns = array( '*' ))
858+
public function getPrevNode(array $columns = array( '*' ))
851859
{
852860
return $this->prevNodes()->first($columns);
853861
}

0 commit comments

Comments
 (0)