本文整理匯總了PHP中Fox::getCamelCase方法的典型用法代碼示例。如果您正苦於以下問題:PHP Fox::getCamelCase方法的具體用法?PHP Fox::getCamelCase怎麽用?PHP Fox::getCamelCase使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Fox
的用法示例。
在下文中一共展示了Fox::getCamelCase方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getPropertyName
/**
* Makes conventional property name from key
*
* @param string $key
* @return string
*/
public static function getPropertyName($key)
{
return Fox::getCamelCase($key);
}
示例2: _preSave
/**
* Process data before save
*
* @param array $data
* @return array
* @throws Exception if uploads directory not found
*/
protected function _preSave(array $data)
{
if (!empty($_FILES)) {
$path = Fox::getUploadDirectoryPath() . DIRECTORY_SEPARATOR . $this->_eav_entity_type;
if (!file_exists($path)) {
if (!@mkdir($path, 777, TRUE)) {
throw new Exception('uploads directory was not found.');
}
}
foreach ($_FILES as $key => $file) {
if (isset($file['tmp_name']) && $file['tmp_name']) {
if (($pos = strrpos($file['name'], '.')) > -1) {
$ext = substr($file['name'], $pos + 1);
$fileName = 'FILE-' . time() . '.' . $ext;
$filePath = $path . DIRECTORY_SEPARATOR;
$upload = new Zend_File_Transfer_Adapter_Http();
$upload->setDestination($filePath);
$upload->receive($key);
$uploadedfilepath = $upload->getFileName($key);
$filterFileRename = new Zend_Filter_File_Rename(array('target' => $filePath . $fileName, 'overwrite' => true));
$filterFileRename->filter($uploadedfilepath);
$method = Uni_Core_Model::SET . Fox::getCamelCase($key);
$this->{$method}($fileName);
}
}
}
}
return parent::_preSave($data);
}