<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
class Music_Plugin_Composer extends Core_Plugin_Abstract
{
  public function onAttachMusic($data)
  {
    if( !is_array($data) || empty($data['song_id']) ) 
      return;

    $song = Engine_Api::_()->getItem('music_playlist_song', $data['song_id']);
    if( !($song instanceof Core_Model_Item_Abstract) || !$song->getIdentity() )
      return;
    
    return $song;
  }
}
