sammarks / ablecore

A library for Drupal developers.
MIT License
5 stars 4 forks source link

Add withType() to the Node class. #10

Open sammarks opened 10 years ago

sammarks commented 10 years ago

In conjunction with the new current() function, this function would make the API more expressive.

For example, the following would return the current node if it matches the "service" type. Else, it would return false.

$node = AbleCore\Node::current()->withType('service');

Developers can determine exactly what the code is doing this way.