Example #1
0
 /**
  * @param $table
  * @return $this
  */
 public function setTable($table)
 {
     $this->class = $table;
     $class = explode('\\', $table);
     $class = end($class);
     $this->table = isset($this->options['prefix']) ? $this->options['prefix'] . TextTransform::pluralize(strtolower($class)) : TextTransform::pluralize(strtolower($class));
     $this->alias = strtolower(substr($class, 0, 1));
     return $this;
 }
Example #2
0
 /**
  * @param $table
  * @return $this
  */
 public function setTable($table)
 {
     $this->class = $table;
     $class = explode('\\', $table);
     $class = strtolower(preg_replace('/\\B([A-Z])/', '_$1', end($class)));
     $this->table = isset($this->options['prefix']) ? $this->options['prefix'] . TextTransform::pluralize($class) : TextTransform::pluralize($class);
     $this->alias = substr($class, 0, 1);
     return $this;
 }