public static function findPreviousElement(Model $model, $type=null)
	{
		if($type === null) {
			$type = $model->getType();
		}

		$column = array('pid=?', 'ptable=?', 'type=?', 'sorting<?');
		$values = array($model->pid, $model->ptable, $model->getTypeName($type), $model->sorting);

		return \ContentModel::findOneBy($column, $values);
	}
public static function findPreviousElement(Model $model, $type=null)
	{
		if($type === null) {
			$type = $model->getType();
		}

		$column = array('pid=?', 'ptable=?', 'type=?', 'sorting<?');
		$values = array($model->pid, $model->ptable, $model->getTypeName($type), $model->sorting);

		return \ContentModel::findOneBy($column, $values);
	}
public static function findPreviousElement ( Model $ model , $ type = null ) { if ( $ type === null ) { $ type = $ model -> getType ( ) ; } $ column = array ( 'pid=?' , 'ptable=?' , 'type=?' , 'sorting<?' ) ; $ values = array ( $ model -> pid , $ model -> ptable , $ model -> getTypeName ( $ type ) , $ model -> sorting ) ; return \ ContentModel :: findOneBy ( $ column , $ values ) ; }
try to find previous element of same type or specified type

@param Model $model
@param null $type

@return \Model|null
try to find previous element of same type or specified type