original_string: public function setSchema($schema)
      {
          if (is_array($schema)) {
              $constraints = [];
  
              if (isset($schema['_constraints'])) {
                  $constraints = $schema['_constraints'];
                  unset($schema['_constraints']);
              }
  
              $schema = new TableSchema($this->getTable(), $schema);
  
              foreach ($constraints as $name => $value) {
                  $schema->addConstraint($name, $value);
              }
          }
  
          $this->_schema = $schema;
  
          return $this;
      }
code: public function setSchema($schema)
      {
          if (is_array($schema)) {
              $constraints = [];
  
              if (isset($schema['_constraints'])) {
                  $constraints = $schema['_constraints'];
                  unset($schema['_constraints']);
              }
  
              $schema = new TableSchema($this->getTable(), $schema);
  
              foreach ($constraints as $name => $value) {
                  $schema->addConstraint($name, $value);
              }
          }
  
          $this->_schema = $schema;
  
          return $this;
      }
code_tokens: public function setSchema ( $ schema ) { if ( is_array ( $ schema ) ) { $ constraints = [ ] ; if ( isset ( $ schema [ '_constraints' ] ) ) { $ constraints = $ schema [ '_constraints' ] ; unset ( $ schema [ '_constraints' ] ) ; } $ schema = new TableSchema ( $ this -> getTable ( ) , $ schema ) ; foreach ( $ constraints as $ name => $ value ) { $ schema -> addConstraint ( $ name , $ value ) ; } } $ this -> _schema = $ schema ; return $ this ; }
docstring: Sets the schema table object describing this table's properties.
  
  If an array is passed, a new TableSchema will be constructed
  out of it and used as the schema for this table.
  
  @param array|\Cake\Database\Schema\TableSchema $schema Schema to be used for this table
  @return $this
docstring_tokens: Sets the schema table object describing this table s properties .