public function init($model = null, $model_id = null)
    {
        # If there is a Model and ModelID on parameters, get or create a folder for it
        if ($model && $model_id) {
            # Searching for folder that belongs to this particular $model and $model_id
            if (!$album = $this->getAttachedAlbum($model, $model_id)) {
                # If there is no Album , lets create one for it
                $album = $this->createInitAlbum($model, $model_id);
            }
        } else {
            # If there is no model on parameters, lets create a generic folder
            $album = $this->createInitAlbum(null, null);
        }

        return $album;
    }
public function init($model = null, $model_id = null)
    {
        # If there is a Model and ModelID on parameters, get or create a folder for it
        if ($model && $model_id) {
            # Searching for folder that belongs to this particular $model and $model_id
            if (!$album = $this->getAttachedAlbum($model, $model_id)) {
                # If there is no Album , lets create one for it
                $album = $this->createInitAlbum($model, $model_id);
            }
        } else {
            # If there is no model on parameters, lets create a generic folder
            $album = $this->createInitAlbum(null, null);
        }

        return $album;
    }
public function init ( $ model = null , $ model_id = null ) { # If there is a Model and ModelID on parameters, get or create a folder for it if ( $ model && $ model_id ) { # Searching for folder that belongs to this particular $model and $model_id if ( ! $ album = $ this -> getAttachedAlbum ( $ model , $ model_id ) ) { # If there is no Album , lets create one for it $ album = $ this -> createInitAlbum ( $ model , $ model_id ) ; } } else { # If there is no model on parameters, lets create a generic folder $ album = $ this -> createInitAlbum ( null , null ) ; } return $ album ; }
Create an album record on database
@param $model
@param $model_id
Create an album record on database