public function findBySelector( $selector, $media = '', $rootId = null )
    {
        $rootId = ( (int) $rootId ) ?: null;
        $rule   = $this->getMapper()
                       ->findBySelector( $selector, $media, $rootId );

        if ( empty( $rule ) )
        {
            $rule = $this->getMapper()
                         ->create( array(
                             'media'            => $media,
                             'selector'         => $selector,
                             'rootParagraphId'  => $rootId,
                         ) );
        }

        return $rule;
    }
public function findBySelector( $selector, $media = '', $rootId = null )
    {
        $rootId = ( (int) $rootId ) ?: null;
        $rule   = $this->getMapper()
                       ->findBySelector( $selector, $media, $rootId );

        if ( empty( $rule ) )
        {
            $rule = $this->getMapper()
                         ->create( array(
                             'media'            => $media,
                             'selector'         => $selector,
                             'rootParagraphId'  => $rootId,
                         ) );
        }

        return $rule;
    }
public function findBySelector ( $ selector , $ media = '' , $ rootId = null ) { $ rootId = ( ( int ) $ rootId ) ? : null ; $ rule = $ this -> getMapper ( ) -> findBySelector ( $ selector , $ media , $ rootId ) ; if ( empty ( $ rule ) ) { $ rule = $ this -> getMapper ( ) -> create ( array ( 'media' => $ media , 'selector' => $ selector , 'rootParagraphId' => $ rootId , ) ) ; } return $ rule ; }
Get rule by selector & media

@param string $selector
@param string $media [optional]
@param null|int $rootId [optional]
@return \Customize\Model\Rule\Structure
Get rule by selector & media