create() public method

public create ( string $p_name = null ) : boolean
$p_name string
return boolean
Ejemplo n.º 1
0
    exit;
}
$id = Input::Get('id', 'int', -1);
// Delete author
$del_id = Input::Get('del_id', 'int', -1);
if ($del_id > -1) {
    $author = new Author($del_id);
    if ($author->delete()) {
        camp_html_add_msg($translator->trans('Author deleted.', array(), 'users'), 'ok');
    }
}
// Add new author type
$add_author_type = Input::Get('add_author', 'string', null);
if ($add_author_type !== null) {
    $authorTypeObj = new AuthorType();
    if ($authorTypeObj->create($add_author_type) === true) {
        camp_html_add_msg($translator->trans('Author type added.', array(), 'users'), 'ok');
    } else {
        camp_html_add_msg($translator->trans('Cannot add author type, this type already exists.', array(), 'users'));
    }
}
// Delete author type
$del_id_type = Input::Get('del_id_type', 'int', -1);
if ($del_id_type > -1) {
    $authorTypeObj = new AuthorType($del_id_type);
    if ($authorTypeObj->delete()) {
        camp_html_add_msg($translator->trans('Author type removed.', array(), 'users'), 'ok');
    } else {
        camp_html_add_msg($translator->trans('Cannot remove author type.', array(), 'users'));
    }
}