protected function moveAllInstances(array $ids)
    {
        $rootClass = $this->getClassService()->getRootClass();

        if (in_array($rootClass->getUri(), $ids)) {
            throw new InvalidArgumentException(sprintf('Root class "%s" cannot be moved', $rootClass->getUri()));
        }

        $destinationClass = new \core_kernel_classes_Class($this->getRequestParameter('destinationClassUri'));

        if (!$destinationClass->isSubClassOf($rootClass) && $destinationClass->getUri() != $rootClass->getUri()) {
            throw new InvalidArgumentException(sprintf('Instance "%s" cannot be moved to another root class', $destinationClass->getUri()));
        }

        list($statuses, $instances, $classes) = $this->getInstancesList($ids);
        $movableInstances = $this->getInstancesToMove($classes, $instances, $statuses);

        $statuses = $this->move($destinationClass, $movableInstances, $statuses);

        return [
            'success' => true,
            'data' => $statuses
        ];
    }
protected function moveAllInstances(array $ids)
    {
        $rootClass = $this->getClassService()->getRootClass();

        if (in_array($rootClass->getUri(), $ids)) {
            throw new InvalidArgumentException(sprintf('Root class "%s" cannot be moved', $rootClass->getUri()));
        }

        $destinationClass = new \core_kernel_classes_Class($this->getRequestParameter('destinationClassUri'));

        if (!$destinationClass->isSubClassOf($rootClass) && $destinationClass->getUri() != $rootClass->getUri()) {
            throw new InvalidArgumentException(sprintf('Instance "%s" cannot be moved to another root class', $destinationClass->getUri()));
        }

        list($statuses, $instances, $classes) = $this->getInstancesList($ids);
        $movableInstances = $this->getInstancesToMove($classes, $instances, $statuses);

        $statuses = $this->move($destinationClass, $movableInstances, $statuses);

        return [
            'success' => true,
            'data' => $statuses
        ];
    }
protected function moveAllInstances ( array $ ids ) { $ rootClass = $ this -> getClassService ( ) -> getRootClass ( ) ; if ( in_array ( $ rootClass -> getUri ( ) , $ ids ) ) { throw new InvalidArgumentException ( sprintf ( 'Root class "%s" cannot be moved' , $ rootClass -> getUri ( ) ) ) ; } $ destinationClass = new \ core_kernel_classes_Class ( $ this -> getRequestParameter ( 'destinationClassUri' ) ) ; if ( ! $ destinationClass -> isSubClassOf ( $ rootClass ) && $ destinationClass -> getUri ( ) != $ rootClass -> getUri ( ) ) { throw new InvalidArgumentException ( sprintf ( 'Instance "%s" cannot be moved to another root class' , $ destinationClass -> getUri ( ) ) ) ; } list ( $ statuses , $ instances , $ classes ) = $ this -> getInstancesList ( $ ids ) ; $ movableInstances = $ this -> getInstancesToMove ( $ classes , $ instances , $ statuses ) ; $ statuses = $ this -> move ( $ destinationClass , $ movableInstances , $ statuses ) ; return [ 'success' => true , 'data' => $ statuses ] ; }
Move instances to another class

{
"destinationClassUri": "http://test.it",
"ids": [
"http://resource1",
"http://resource2",
"http://class1",
"http://class2"
]
}
@requiresRight destinationClassUri WRITE
@params array $ids The list of instance uris to move

@throws common_exception_Error
Move instances to another class