code/template/helper/grid.php
public function lock_message($config = array())
    {
        $config = new ObjectConfigJson($config);
        $config->append(array(
            'entity' => null
        ));

        if (!($config->entity instanceof ModelEntityInterface)) {
            throw new \UnexpectedValueException('$config->entity should be a ModelEntityInterface instance');
        }

        $entity = $config->entity;
        $message = '';

        if($entity->isLockable() && $entity->isLocked())
        {
            $user = $entity->getLocker();
            $date = $this->getObject('date', array('date' => $entity->locked_on));

            $message = $this->getObject('translator')->translate(
                'Locked by {name} {date}', array('name' => $user->getName(), 'date' => $date->humanize())
            );
        }

        return $message;
    }
public function lock_message($config = array())
    {
        $config = new ObjectConfigJson($config);
        $config->append(array(
            'entity' => null
        ));

        if (!($config->entity instanceof ModelEntityInterface)) {
            throw new \UnexpectedValueException('$config->entity should be a ModelEntityInterface instance');
        }

        $entity = $config->entity;
        $message = '';

        if($entity->isLockable() && $entity->isLocked())
        {
            $user = $entity->getLocker();
            $date = $this->getObject('date', array('date' => $entity->locked_on));

            $message = $this->getObject('translator')->translate(
                'Locked by {name} {date}', array('name' => $user->getName(), 'date' => $date->humanize())
            );
        }

        return $message;
    }
public function lock_message ( $ config = array ( ) ) { $ config = new ObjectConfigJson ( $ config ) ; $ config -> append ( array ( 'entity' => null ) ) ; if ( ! ( $ config -> entity instanceof ModelEntityInterface ) ) { throw new \ UnexpectedValueException ( '$config->entity should be a ModelEntityInterface instance' ) ; } $ entity = $ config -> entity ; $ message = '' ; if ( $ entity -> isLockable ( ) && $ entity -> isLocked ( ) ) { $ user = $ entity -> getLocker ( ) ; $ date = $ this -> getObject ( 'date' , array ( 'date' => $ entity -> locked_on ) ) ; $ message = $ this -> getObject ( 'translator' ) -> translate ( 'Locked by {name} {date}' , array ( 'name' => $ user -> getName ( ) , 'date' => $ date -> humanize ( ) ) ) ; } return $ message ; }
Get the locked information

@param  array|ObjectConfig $config An optional configuration array.
@throws \UnexpectedValueException
@return string The locked by "name" "date" message
Get the locked information