Fionn Posted January 18, 2020 Share Posted January 18, 2020 I need help understanding what this code is doing: $alias = $this->select('url_alias', 'ua') ->fields('ua', ['alias']) ->condition('ua.source', 'node/' . $nid) ->execute() ->fetchField(); Thank you for any insight Quote Link to comment https://forums.phpfreaks.com/topic/309890-newbie-format-question/ Share on other sites More sharing options...
Barand Posted January 18, 2020 Share Posted January 18, 2020 It's calling those five methods (select, fields, condition, execute, fetchField) in sequence and putting the result into $alias. Quote Link to comment https://forums.phpfreaks.com/topic/309890-newbie-format-question/#findComment-1573616 Share on other sites More sharing options...
Fionn Posted January 18, 2020 Author Share Posted January 18, 2020 Thank you, Barand. I am just learning and I am not familiar with that notation (using -> to call methods). Quote Link to comment https://forums.phpfreaks.com/topic/309890-newbie-format-question/#findComment-1573618 Share on other sites More sharing options...
Barand Posted January 18, 2020 Share Posted January 18, 2020 This will give you a basic intro to objects and methods Quote Link to comment https://forums.phpfreaks.com/topic/309890-newbie-format-question/#findComment-1573619 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.