|
@@ 1002-1009 (lines=8) @@
|
| 999 |
|
* |
| 1000 |
|
* @since 2.0 |
| 1001 |
|
*/ |
| 1002 |
|
public static function pre_save( $type, $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) { |
| 1003 |
|
self::field_loader( $type ); |
| 1004 |
|
|
| 1005 |
|
if ( 1 == pods_v( 'field_pre_save', $options, 1 ) && method_exists( self::$loaded[ $type ], 'pre_save' ) ) |
| 1006 |
|
$value = self::$loaded[ $type ]->pre_save( $value, $id, $name, $options, $fields, $pod, $params ); |
| 1007 |
|
|
| 1008 |
|
return $value; |
| 1009 |
|
} |
| 1010 |
|
|
| 1011 |
|
/** |
| 1012 |
|
* Save the value to the DB |
|
@@ 1027-1036 (lines=10) @@
|
| 1024 |
|
* |
| 1025 |
|
* @since 2.3 |
| 1026 |
|
*/ |
| 1027 |
|
public static function save( $type, $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) { |
| 1028 |
|
self::field_loader( $type ); |
| 1029 |
|
|
| 1030 |
|
$saved = null; |
| 1031 |
|
|
| 1032 |
|
if ( 1 == pods_v( 'field_save', $options, 1 ) && method_exists( self::$loaded[ $type ], 'save' ) ) |
| 1033 |
|
$saved = self::$loaded[ $type ]->save( $value, $id, $name, $options, $fields, $pod, $params ); |
| 1034 |
|
|
| 1035 |
|
return $saved; |
| 1036 |
|
} |
| 1037 |
|
|
| 1038 |
|
/** |
| 1039 |
|
* Delete the value from the DB |
|
@@ 1051-1060 (lines=10) @@
|
| 1048 |
|
* |
| 1049 |
|
* @since 2.3 |
| 1050 |
|
*/ |
| 1051 |
|
public static function delete( $type, $id = null, $name = null, $options = null, $pod = null ) { |
| 1052 |
|
self::field_loader( $type ); |
| 1053 |
|
|
| 1054 |
|
$deleted = null; |
| 1055 |
|
|
| 1056 |
|
if ( 1 == pods_v( 'field_delete', $options, 1 ) && method_exists( self::$loaded[ $type ], 'delete' ) ) |
| 1057 |
|
$deleted = self::$loaded[ $type ]->delete( $id, $name, $options, $pod ); |
| 1058 |
|
|
| 1059 |
|
return $deleted; |
| 1060 |
|
} |
| 1061 |
|
|
| 1062 |
|
/** |
| 1063 |
|
* Check if a user has permission to be editing a field |