views::get (public)

 views::get [ -object_id object_id ]

Defined in packages/views/tcl/views-procs.tcl

Return an array (which you have to set with "array set your_array [views::get -object_id $object_id]") with the elements:

  • views_count
  • unique_views
  • last_viewed

Switches:
-object_id (optional)
ID of the object for which you want to return the views

Testcases:
view_api_test_without_type, view_api_test_with_type
Source code:
    if {[db_0or1row views { } -column_array ret] } {
        db_foreach select_views_by_type { } {
            set ret($view_type$views_count
        }
        return [array get ret]
    }
    return {views_count {} unique_views {} last_viewed {}}
Generic XQL file:
<fullquery name="views::get.views">
    <querytext>
	select views_count, unique_views, to_char(last_viewed,'YYYY-MM-DD HH24:MI:SS') as last_viewed
    from view_aggregates
    where object_id = :object_id
	</querytext>
</fullquery>

<fullquery name="views::get.select_views_by_type">
    <querytext>
	select view_type, views_count
    from view_aggregates_by_type
    where object_id = :object_id
</querytext>
</fullquery>
packages/views/tcl/views-procs.xql

PostgreSQL XQL file:
packages/views/tcl/views-procs-postgresql.xql

Oracle XQL file:
packages/views/tcl/views-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: