LazyRecord\Metadata::hasAttribute PHP Method

hasAttribute() public method

Check if a key exists in the database.
public hasAttribute ( string $key )
$key string
    public function hasAttribute($key)
    {
        $stm = $this->connection->prepare('select * from __meta__ where name = :name');
        $stm->execute(array(':name' => $key));
        $data = $stm->fetch(PDO::FETCH_OBJ);
        return $data ? true : false;
    }