Skip to content
Advertisement

Virtual fields with Cakephp 3

I need to have a virtual property in my user entity. I followed the CakePHP book.

UserEntity.php

JavaScript

In a controller

JavaScript

I followed exactly the book and I only get a null value.

Advertisement

Answer

According to @ndm, the problem was due to a bad file naming. I named the user entity class UserEntity.php. The CakePHP name conventions says that:

The Entity class OptionValue would be found in a file named OptionValue.php.

Thanks.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement