/** * Get Index * * Gets the index of the column * * @access public * @return string Index */ public function get_index() { // Lazy set the index if (!$this->has_data('index')) { $this->set_data('index', \Str::alphanumeric($this->get_identifier(), '_')); } return $this->get_data('index'); }
/** * Add Massaction * * Adds a massaction to * the grid * * @access public * @param string Identifier * @param array Attributes * @return Spark\Grid */ public function add_massaction($identifier = null, array $attributes = array()) { // Sanitise the identifier $identifier = \Str::alphanumeric($identifier, '_'); // Only add the massaction if it doesn't exist if (!$this->get_massactions()->has_data($identifier)) { // Set the massaction $this->get_massactions()->set_data($identifier, \Grid_Massaction::factory($identifier, $attributes)->set_grid($this)->make_recursive()); // Set we're using a container if (!$this->get_uses_container()) { $this->set_uses_container(true); } } return $this; }