本文整理汇总了PHP中form_edit_site_object_action::_update_object_operation方法的典型用法代码示例。如果您正苦于以下问题:PHP form_edit_site_object_action::_update_object_operation方法的具体用法?PHP form_edit_site_object_action::_update_object_operation怎么用?PHP form_edit_site_object_action::_update_object_operation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类form_edit_site_object_action
的用法示例。
在下文中一共展示了form_edit_site_object_action::_update_object_operation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function _update_object_operation()
{
if ($file = $this->dataspace->get('file')) {
$object_data =& fetch_requested_object();
$this->object->set_attribute('media_id', $object_data['media_id']);
$this->object->set_attribute('tmp_file_path', $file['tmp_name']);
$this->object->set_attribute('file_name', $file['name']);
$this->object->set_attribute('mime_type', $file['type']);
}
return parent::_update_object_operation();
}
示例2:
function _update_object_operation(&$object)
{
if (isset($_FILES[$this->name]['tmp_name']['file'])) {
if ($_FILES[$this->name]['size']['file'] > ini_get('upload_max_filesize') * 1024 * 1024) {
message_box::write_warning('uploaded file size exceeds limit');
return false;
}
$object_data =& fetch_mapped_by_url();
$object->set_attribute('media_id', $object_data['media_id']);
$object->set_attribute('tmp_file_path', $_FILES[$this->name]['tmp_name']['file']);
$object->set_attribute('file_name', $_FILES[$this->name]['name']['file']);
$object->set_attribute('mime_type', $_FILES[$this->name]['type']['file']);
}
return parent::_update_object_operation(&$object);
}