<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
class Engine_Filter_StringLength implements Zend_Filter_Interface
{
  protected $_maxLength;
  
  public function __construct($options = array())
  {
    if( !empty($options['max']) )
    {
      $this->_maxLength = $options['max'];
    }
  }

  public function filter($value)
  {
    return Engine_String::substr($value, 0, $this->_maxLength);
  }
}
