Adding a profile picture

We now want to be able to add profile pictures of the employees. This is also one of the really easy ones.

We once again extends the Employee object, by adding to the buildStructure() function:

  ...
  'profile_pic' => array(
    'label' => 'Profile picture',
    'fieldtype' => self::FIELDTYPE_IMAGE,
    'folder' => 'profile_pictures'
  ),
  ...

And remember to call $instance→initializeDatabase() afterwards.

That's it. And if you want to know where the file ends up, it ends up in the storage folder configured in tutorial step 2 in a subfolder corresponding to the instance ID and another subfolder named profile_pictures.