You are here

function photos_node_update in Album Photos 8.4

Same name and namespace in other branches
  1. 8.5 photos.module \photos_node_update()
  2. 7.3 photos.module \photos_node_update()
  3. 6.0.x photos.module \photos_node_update()

Implements hook_ENTITY_TYPE_update().

File

./photos.module, line 835
Implementation of photos.module.

Code

function photos_node_update(NodeInterface $node) {
  if ($node
    ->getType() == 'photos') {
    $db = \Drupal::database();
    $db
      ->update('photos_album')
      ->fields([
      'data' => serialize($node->album),
    ])
      ->condition('pid', $node
      ->id())
      ->execute();
    PhotosAlbum::setCount('user_album', $node
      ->getOwnerId());
  }
}