ADDITIONAL METHODS
with_times
This is a modifier for any search() (including the helpers below) which will add the following additional synthesized columns to the result set:
- lastchange_stamp
with_is_free
This is a modifier for any search() (including the helpers below) which will add the following additional synthesized columns to the result set:
- is_free
In the $cond hash (the first parameter) pass in the age_num which must be an integer, and the age_unit which must be a string of either days, weeks, months or years.
only_free_ports
This is a modifier for any search() (including the helpers below) which will restrict results based on whether the port is considered "free".
In the $cond hash (the first parameter) pass in the age_num which must be an integer, and the age_unit which must be a string of either days, weeks, months or years.
with_properties
This is a modifier for any search() which will add the following additional synthesized columns to the result set:
- error_disable_cause
- remote_is_discoverable (boolean)
- remote_is_wap (boolean)
- remote_is_phone (boolean)
- remote_dns
- ifindex
with_remote_inventory
This is a modifier for any search() which will add the following additional synthesized columns to the result set:
- remote_vendor
- remote_model
- remote_os_ver
- remote_serial
with_vlan_count
This is a modifier for any search() (including the helpers below) which will add the following additional synthesized columns to the result set:
- vlan_count
SPECIAL METHODS
delete( \%options? )
Overrides the built-in DBIx::Class delete method to more efficiently handle the removal or archiving of nodes.
order_by_port_name( \@also )
Orders the result set the way the device Ports tab shows ports, using the port_sortkey() function schema version 99 installs. Any further ordering terms are passed in \@also and applied after the port name.
The port key has to lead, and this method exists so that only one place knows it. When connected nodes are prefetched, DBIC collapses the rows into objects and needs each port's rows contiguous, which a node column sorted ahead of the port name would break. Passing the node terms here rather than chaining a second order_by also avoids the other half of that trap: a chained order_by replaces the previous one rather than appending to it.
The tiebreak on the raw port name is not decoration. port_sortkey() deliberately ties equivalent names, 10GigabitEthernet1/1 against GigabitEthernet1/1, and without a tiebreak the order within a tie is whatever Postgres happens to return, which is what makes paging unsafe.
Both comparisons are COLLATE "C", matching the JavaScript, which compares strings by code unit.