How to get values from referenced entity

Assume we have a $node object and it has some reference field, we get to that field with 

$node->get($field)->referencedEntities();

where we get array of entites we can loop now, se lets say this reference field is even paragraph which has another reference field in it which is taxonomy term, we will loop this field like this

Coding cron job in Drupal 8

Coding a cron job in drupal 8 is pretty easy. All you have to do is go to your module folder, open .module file and add hook_cron function, so lets add some content with our hook_cron

Add BigInt type of data to your custom entity

To have integer go to BigInt type you will need to use setSettings in your BaseFieldDefinition for your custom entity, with this you will have space for 19 digits numbers, with unsigned property making this all positive numbers.

Access levels - Showing different content per user role with view modes

This solution is useful If you want to have something like standard and premium users and show different content for each role. What we mean here is to show just part of the node for normal user and full node for premium users. So how do we do this? We build 2 different view modes for that node type.