See also
Nos\Orm_Behaviour_Virtualname for configuration and methods.
Required. Column name use for save virtual path.
Required. If it’s a string, it will be appended to the virtual path. If it’s an array:
before: String to add to extension start. after: String to add to extension end. property: Column name used to store the extension.
Required. Name of the parent relation use to generate the first part of the virtual path.
Parameters: |
|
---|---|
Returns: | Virtual path of the item. |
Returns: | Return extension part of the virtual path. |
---|
<?php
class Model_Page extends \Nos\Orm\Model
{
protected static $_behaviours = array(
'Nos\Orm_Behaviour_Virtualpath' => array(
'events' => array('before_save', 'after_save', 'change_parent'),
'virtual_name_property' => 'page_virtual_name',
'virtual_path_property' => 'page_virtual_url',
'extension_property' => '.html',
'parent_relation' => 'parent',
),
);
}