public function register($class, $transforms)
    {
        if (!is_array($transforms)) {
            $transforms = array($transforms);
        }
        foreach ($transforms as $t) {
            if (!($t instanceof TransformationInterface)) {
                throw new \InvalidArgumentException("Only instances of TransformationInterface can be registered");
            }
        }

        if (!isset($this->transforms[$class])) {
            $this->classes[] = $class;
            $this->transforms[$class] = array();
        }

        foreach ($transforms as $t) {
            $this->transforms[$class][] = $t;
        }
    }
public function register($class, $transforms)
    {
        if (!is_array($transforms)) {
            $transforms = array($transforms);
        }
        foreach ($transforms as $t) {
            if (!($t instanceof TransformationInterface)) {
                throw new \InvalidArgumentException("Only instances of TransformationInterface can be registered");
            }
        }

        if (!isset($this->transforms[$class])) {
            $this->classes[] = $class;
            $this->transforms[$class] = array();
        }

        foreach ($transforms as $t) {
            $this->transforms[$class][] = $t;
        }
    }
public function register ( $ class , $ transforms ) { if ( ! is_array ( $ transforms ) ) { $ transforms = array ( $ transforms ) ; } foreach ( $ transforms as $ t ) { if ( ! ( $ t instanceof TransformationInterface ) ) { throw new \ InvalidArgumentException ( "Only instances of TransformationInterface can be registered" ) ; } } if ( ! isset ( $ this -> transforms [ $ class ] ) ) { $ this -> classes [ ] = $ class ; $ this -> transforms [ $ class ] = array ( ) ; } foreach ( $ transforms as $ t ) { $ this -> transforms [ $ class ] [ ] = $ t ; } }
Register a set of transformations for a given class.

@param string $class
@param array|TransformationInterface Either an array of transformations or a single transformation
Register a set of transformations for a given class .