public function register_asset( \Amarkal\Assets\AbstractAsset $new_asset )
    {
        if( NULL == $this->assets ) {
            $this->assets = array();
            $this->assets[] = $new_asset;
        }
        else {
            foreach( $this->assets as $asset ) {
                if( $asset->handle == $new_asset->handle && get_class($asset) == get_class($new_asset) ) {
                    throw new DuplicateAssetException("An asset with the handle {$new_asset->handle} already exists");
                }
            }
            $this->assets[] = $new_asset;
        }
    }
public function register_asset( \Amarkal\Assets\AbstractAsset $new_asset )
    {
        if( NULL == $this->assets ) {
            $this->assets = array();
            $this->assets[] = $new_asset;
        }
        else {
            foreach( $this->assets as $asset ) {
                if( $asset->handle == $new_asset->handle && get_class($asset) == get_class($new_asset) ) {
                    throw new DuplicateAssetException("An asset with the handle {$new_asset->handle} already exists");
                }
            }
            $this->assets[] = $new_asset;
        }
    }
public function register_asset ( \ Amarkal \ Assets \ AbstractAsset $ new_asset ) { if ( NULL == $ this -> assets ) { $ this -> assets = array ( ) ; $ this -> assets [ ] = $ new_asset ; } else { foreach ( $ this -> assets as $ asset ) { if ( $ asset -> handle == $ new_asset -> handle && get_class ( $ asset ) == get_class ( $ new_asset ) ) { throw new DuplicateAssetException ( "An asset with the handle {$new_asset->handle} already exists" ) ; } } $ this -> assets [ ] = $ new_asset ; } }
Register a single asset

@param \Amarkal\Assets\AbstractAsset $new_asset The asset to enqueue
@throws DuplicateAssetException    If the a duplicated asset handle exists
Register a single asset