| @@ 177-185 (lines=9) @@ | ||
| 174 | * |
|
| 175 | * @since 2.0 |
|
| 176 | */ |
|
| 177 | public function pre_save ( $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) { |
|
| 178 | $length = (int) pods_var( self::$type . '_max_length', $options, 0 ); |
|
| 179 | ||
| 180 | if ( 0 < $length && $length < pods_mb_strlen( $value ) ) { |
|
| 181 | $value = pods_mb_substr( $value, 0, $length ); |
|
| 182 | } |
|
| 183 | ||
| 184 | return $value; |
|
| 185 | } |
|
| 186 | } |
|
| 187 | ||
| @@ 185-193 (lines=9) @@ | ||
| 182 | * @return mixed|string |
|
| 183 | * @since 2.0 |
|
| 184 | */ |
|
| 185 | public function pre_save ( $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) { |
|
| 186 | $length = (int) pods_var( self::$type . '_max_length', $options, 255 ); |
|
| 187 | ||
| 188 | if ( 0 < $length && $length < pods_mb_strlen( $value ) ) { |
|
| 189 | $value = pods_mb_substr( $value, 0, $length ); |
|
| 190 | } |
|
| 191 | ||
| 192 | return $value; |
|
| 193 | } |
|
| 194 | } |
|
| 195 | ||