public function createDefaultToolMaskDecoders(Tool $tool)
    {
        foreach (ToolMaskDecoder::$defaultActions as $action) {
            $maskDecoder = $this->maskRepo
                ->findMaskDecoderByToolAndName($tool, $action);

            if (is_null($maskDecoder)) {
                $maskDecoder = new ToolMaskDecoder();
                $maskDecoder->setTool($tool);
                $maskDecoder->setName($action);
                $maskDecoder->setValue(ToolMaskDecoder::$defaultValues[$action]);
                $maskDecoder->setGrantedIconClass(
                    ToolMaskDecoder::$defaultGrantedIconClass[$action]
                );
                $maskDecoder->setDeniedIconClass(
                    ToolMaskDecoder::$defaultDeniedIconClass[$action]
                );
                $this->om->persist($maskDecoder);
            }
        }
        $this->om->flush();
    }
public function createDefaultToolMaskDecoders(Tool $tool)
    {
        foreach (ToolMaskDecoder::$defaultActions as $action) {
            $maskDecoder = $this->maskRepo
                ->findMaskDecoderByToolAndName($tool, $action);

            if (is_null($maskDecoder)) {
                $maskDecoder = new ToolMaskDecoder();
                $maskDecoder->setTool($tool);
                $maskDecoder->setName($action);
                $maskDecoder->setValue(ToolMaskDecoder::$defaultValues[$action]);
                $maskDecoder->setGrantedIconClass(
                    ToolMaskDecoder::$defaultGrantedIconClass[$action]
                );
                $maskDecoder->setDeniedIconClass(
                    ToolMaskDecoder::$defaultDeniedIconClass[$action]
                );
                $this->om->persist($maskDecoder);
            }
        }
        $this->om->flush();
    }
public function createDefaultToolMaskDecoders ( Tool $ tool ) { foreach ( ToolMaskDecoder :: $ defaultActions as $ action ) { $ maskDecoder = $ this -> maskRepo -> findMaskDecoderByToolAndName ( $ tool , $ action ) ; if ( is_null ( $ maskDecoder ) ) { $ maskDecoder = new ToolMaskDecoder ( ) ; $ maskDecoder -> setTool ( $ tool ) ; $ maskDecoder -> setName ( $ action ) ; $ maskDecoder -> setValue ( ToolMaskDecoder :: $ defaultValues [ $ action ] ) ; $ maskDecoder -> setGrantedIconClass ( ToolMaskDecoder :: $ defaultGrantedIconClass [ $ action ] ) ; $ maskDecoder -> setDeniedIconClass ( ToolMaskDecoder :: $ defaultDeniedIconClass [ $ action ] ) ; $ this -> om -> persist ( $ maskDecoder ) ; } } $ this -> om -> flush ( ) ; }
Create a mask decoder with default actions for a tool.

@param \Claroline\CoreBundle\Entity\Tool\Tool $tool
Create a mask decoder with default actions for a tool .